Jaeger Bindings for Java OpenTracing API
Java Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github Adding new issue and pull request template (#451) Jun 14, 2018
config/checkstyle Clean up code style and javadoc warnings (#305) Dec 11, 2017
gradle Bump gradle wrapper to 4.7 (#419) May 16, 2018
idl @ 95d8550 Rename to io.jaegertracing (#375) Apr 10, 2018
jaeger-client Fix jaeger-client dependency jaeger-thrift no-shadow artifact Jul 12, 2018
jaeger-core Use abstract factory pattern to allow subclassing core Jaeger types (#… Aug 21, 2018
jaeger-crossdock Fixes #494 - removed unwanted classes from jaeger-thrift shadowed jar ( Jul 23, 2018
jaeger-micrometer Define some classes internal Jul 4, 2018
jaeger-thrift Fixes #494 - removed unwanted classes from jaeger-thrift shadowed jar ( Jul 23, 2018
jaeger-tracerresolver Define some classes internal Jul 4, 2018
jaeger-zipkin Fix Zipkin readme Jul 12, 2018
travis Adjust thrift shadow configuration and version Jun 19, 2018
.gitignore Fix version retrieval from jaeger.properties Jul 5, 2018
.gitmodules Point IDL submodule git link to jaegertracing org (#377) Apr 4, 2018
.travis.yml Revert "Fix travis release and prepare for 0.29.1 (#443)" (#446) Jun 8, 2018
CHANGELOG.md Back to development 0.30.5-SNAPSHOT Aug 13, 2018
CONTRIBUTING.md Make jaeger-thrift's shaded JAR the default one Jun 21, 2018
DCO Update to Apache License v. 2 (#262) Oct 9, 2017
LICENSE Update to Apache License v. 2 (#262) Oct 9, 2017
Makefile Give Gradle 1gb of memory; log test names being executed (#324) Jan 30, 2018
README.md Add jaeger-client module Jul 6, 2018
RELEASE.md Change changelog from rst to md (#427) May 23, 2018
build.gradle Back to development 0.30.5-SNAPSHOT Aug 13, 2018
codecov.yml Add code coverage ignores (#153) Apr 27, 2017
gradlew Automated the release process (#201) Jun 29, 2017
gradlew.bat Bump gradle version to 3.5 (#150) Apr 26, 2017
license-template Update to Apache License v. 2 (#262) Oct 9, 2017
settings.gradle Add jaeger-client module Jul 6, 2018

README.md

Build Status Coverage Status Released Version FOSSA Status

Jaeger's Tracing Instrumentation Library for Java

  • Intended to be used with Jaeger backend, but can also be configured to send traces to Zipkin.
  • Implements OpenTracing Java API.
  • Supports Java 1.6 and above

Package rename to io.jaegertracing

The group ID com.uber.jaeger has been deprecated and moved to a different repository. Please switch to io.jaegertracing, as the old group ID will be maintained only for bug fixes.

Contributing and Developing

Please see CONTRIBUTING.md.

Core Modules

Click through for more detailed docs on specific modules.

  • jaeger-client: the module that instrumented applications should usually include
  • jaeger-core: the core implementation of the OpenTracing API Java Docs
  • jaeger-thrift: set of components that send data to the backend

Add-on Modules

Importing Dependencies

All artifacts are published to Maven Central. Snapshot artifacts are also published to Sonatype. Follow these instructions to add the snapshot repository to your build system.

Please use the latest version: Released Version

In the usual case, you just need to include the following dependency to your project:

<dependency>
    <groupId>io.jaegertracing</groupId>
    <artifactId>jaeger-client</artifactId>
    <version>$jaegerVersion</version>
</dependency>

This will bring a concrete sender, such as jaeger-thrift, as well as the jaeger-tracerresolver and jaeger-core.

Thrift version conflicts

The Jaeger Java Client uses org.apache.thrift:libthrift:0.11.0. By default, declaring a dependency on the jaeger-thrift module will bring a shaded version of Thrift (and others), making it safe to use your own versions of such dependencies. A non-shaded version of the dependency is available with the classifier no-shadow, but the transitive dependencies (Thrift included) will have to be added manually to your project.

Instantiating the Tracer

Please see jaeger-core/README.

Testing

When testing tracing instrumentation it is often useful to make sure that all spans are being captured, which is not the case in production configurations where heavy sampling is applied by default. The following configuration can be provided to affect which sampling is applied to the new traces:

sampler:
   type: const # can either be const, probabilistic, or ratelimiting
   param: 1  # can either be an integer, a double, or an integer

The valid values for type are:

  • const: configures a sampler that always makes the same decision for new traces depending on the param: always no for param=0, always yes otherwise.
  • probabilistic: configures a sampler that samples traces with probability equal to param (must be between 0.0 and 1.0)
  • ratelimiting: configures a samlper that samples traces with a certain rate per second equal to param

Debug Traces (Forced Sampling)

Programmatically

The OpenTracing API defines a sampling.priority standard tag that can be used to affect the sampling of a span and its children:

import io.opentracing.tag.Tags;

Tags.SAMPLING_PRIORITY.set(span, 1);

Via HTTP Headers

Jaeger Tracer also understands a special HTTP Header jaeger-debug-id, which can be set in the incoming request, e.g.

curl -H "jaeger-debug-id: some-correlation-id" http://myhost.com

When Jaeger sees this header in the request that otherwise has no tracing context, it ensures that the new trace started for this request will be sampled in the "debug" mode (meaning it should survive all downsampling that might happen in the collection pipeline), and the root span will have a tag as if this statement was executed:

span.setTag("jaeger-debug-id", "some-correlation-id")

This allows using Jaeger UI to find the trace by this tag.

License

Apache 2.0 License.