Git Product home page Git Product logo

sentry-http-interceptors's Introduction

๐Ÿ”ฆ Sentry HTTP Interceptors

Maven Central Java CI with Maven ko-fi

Sends tracing information about Apache HttpClient calls to Sentry:

  • Creates a http.client span that shows the HTTP method and the full target URL
  • Adds a breadcrumb containing the HTTP URL, HTTP method and the HTTP response status code
  • Includes Sentry trace and baggage headers to requests made with Apache HttpClient
  • Supports version 4 and version 5 of Apache HttpClient
  • Easy to use
  • Well documented with Javadoc

๐Ÿ”ง Usage

You need to provide your Apache HTTP Client 4 or 5 dependency on your own like this. For example for Apache HttpClient 4:

Maven

<dependency>
  <groupId>org.apache.httpcomponents</groupId>
  <artifactId>httpclient</artifactId>
  <version>4.5.14</version>
</dependency>

Groovy

implementation 'org.apache.httpcomponents:httpclient:4.5.14'

Kotlin

implementation("org.apache.httpcomponents:httpclient:4.5.14")

or Apache HttpClient 5:

<dependency>
  <groupId>org.apache.httpcomponents.client5</groupId>
  <artifactId>httpclient5</artifactId>
  <version>5.2.1</version>
</dependency>

Groovy

implementation 'org.apache.httpcomponents.client5:httpclient5:5.2.1'

Kotlin

implementation("org.apache.httpcomponents.client5:httpclient5:5.2.1")

Then include the dependency

Maven

<dependency>
  <groupId>org.drjekyll</groupId>
  <artifactId>sentry-http-interceptors</artifactId>
  <version>6.28.0</version>
</dependency>

Groovy

implementation 'org.drjekyll:sentry-http-interceptors:6.28.0'

Kotlin

implementation("org.drjekyll:sentry-http-interceptors:6.28.0")

Run your build tool and add the interceptors like in the following example:

Apache Http Client 5:

CloseableHttpClient client=HttpClientBuilder.create()
  .addRequestInterceptorFirst(new SentryHttpRequestInterceptor(HubAdapter.getInstance()))
  .addResponseInterceptorLast(new SentryHttpResponseInterceptor(HubAdapter.getInstance()))
  .build();

Apache Http Client 4:

CloseableHttpClient client=HttpClientBuilder.create()
  .addInterceptorFirst(new SentryHttpRequestInterceptor(HubAdapter.getInstance()))
  .addResponseInterceptorLast(new SentryHttpResponseInterceptor(HubAdapter.getInstance()))
  .build();

After that the requests will be traced by Sentry, if Sentry is correctly configured in your application.

๐Ÿ˜Ž Development

To build and locally install the library and run the tests, just call

mvn install

๐Ÿค Contributing

Please read the contribution document for details on our code of conduct, and the process for submitting pull requests to us.

๐Ÿ““ Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

๐Ÿ“œ License

This project is licensed under the LGPL License - see the license file for details.

๐Ÿ“ข Release Notes

>= 6.24.0-1

Added support for Apache HttpClient versions 4 and 5 simultaneously.

>= 6.19.2

Using Apache HttpClient version 5 now. Java 11 is required.

> 6.9.0

Upgrade dependencies

6.9.0

Use Sentry version number to let consumer find the correct version more easily

1.0.2

Dependency updates

1.0.1

First public version

sentry-http-interceptors's People

Contributors

dependabot[bot] avatar dheid avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.