com.lightstep.tracer:lightstep-tracer-jre

LightStep Tracer Java (parent)

License

License

GroupId

GroupId

com.lightstep.tracer
ArtifactId

ArtifactId

lightstep-tracer-jre
Last Version

Last Version

0.30.5
Release Date

Release Date

Type

Type

jar
Description

Description

LightStep Tracer Java (parent)
Project Organization

Project Organization

LightStep

Download lightstep-tracer-jre

How to add to project

<!-- https://jarcasting.com/artifacts/com.lightstep.tracer/lightstep-tracer-jre/ -->
<dependency>
    <groupId>com.lightstep.tracer</groupId>
    <artifactId>lightstep-tracer-jre</artifactId>
    <version>0.30.5</version>
</dependency>
// https://jarcasting.com/artifacts/com.lightstep.tracer/lightstep-tracer-jre/
implementation 'com.lightstep.tracer:lightstep-tracer-jre:0.30.5'
// https://jarcasting.com/artifacts/com.lightstep.tracer/lightstep-tracer-jre/
implementation ("com.lightstep.tracer:lightstep-tracer-jre:0.30.5")
'com.lightstep.tracer:lightstep-tracer-jre:jar:0.30.5'
<dependency org="com.lightstep.tracer" name="lightstep-tracer-jre" rev="0.30.5">
  <artifact name="lightstep-tracer-jre" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.lightstep.tracer', module='lightstep-tracer-jre', version='0.30.5')
)
libraryDependencies += "com.lightstep.tracer" % "lightstep-tracer-jre" % "0.30.5"
[com.lightstep.tracer/lightstep-tracer-jre "0.30.5"]

Dependencies

compile (3)

Group / Artifact Type Version
com.lightstep.tracer : java-common jar 0.30.3
com.lightstep.tracer : java-metrics-reporter jar 0.1.6
org.slf4j : slf4j-api jar 1.7.25

provided (3)

Group / Artifact Type Version
org.slf4j : slf4j-simple jar 1.7.25
io.grpc : grpc-netty jar 1.23.0
io.netty : netty-tcnative-boringssl-static jar 2.0.25.Final

test (2)

Group / Artifact Type Version
com.lightstep.tracer : tracer-grpc jar 0.30.3
junit : junit jar 4.13.1

Project Modules

There are no modules declared in this project.

lightstep-tracer-java

Download Circle CI MIT license

The LightStep distributed tracing library for the standard Java runtime environment.

Getting started: JRE

The JRE library is hosted on Maven Central.

Note: Starting from version 0.30.0, lightstep-tracer-java-common and lightstep-tracer-java artifacts use the same major/minor version, only differing in the patch part.

Maven

<dependency>
    <groupId>com.lightstep.tracer</groupId>
    <artifactId>lightstep-tracer-jre</artifactId>
    <version> VERSION </version>
</dependency>
<dependency>
   <groupId>com.lightstep.tracer</groupId>
   <artifactId>tracer-okhttp</artifactId>
   <version> VERSION </version>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>1.7.25</version>
</dependency>
  • Be sure to replace VERSION with the current version of the library. For TRACER-GRPC-VERSION you can refer to lightstep-tracer-common which contains tracer-grpc (and tracer-okhttp).
  • LightStep libraries use provided scope for grpc-netty, netty-tcnative-boringssl-static and slf4j. In other words, LightStep tracer libraries will rely on whichever gRPC/Netty/sl4j version is currently available (i.e. pulled in at runtime) to avoid conflicting with existing versions within your project

Gradle

In most cases, modifying your build.gradle with the below is all that is required:

repositories {
    mavenCentral() // OR jcenter()
}
dependencies {
    compile 'com.lightstep.tracer:lightstep-tracer-jre:VERSION'
    compile 'com.lightstep.tracer:tracer-okhttp:VERSION'
    compile 'org.slf4j:slf4j-simple:1.7.25'
}
  • Be sure to replace VERSION with the current version of the library
  • The artifact is published to both jcenter() and mavenCentral(). Use whichever you prefer.

Initializing the LightStep Tracer

// Important the OpenTracing interfaces
import io.opentracing.Span;
import io.opentracing.Tracer;

// ...

// Initialize the OpenTracing Tracer with LightStep's implementation
Tracer tracer = new com.lightstep.tracer.jre.JRETracer(
         new com.lightstep.tracer.shared.Options.OptionsBuilder()
            .withAccessToken("{your_access_token}")
            .build()
);

// Start and finish a Span
Span span = tracer.buildSpan("my_span").start();
this.doSomeWorkHere();
span.finish();

API Documentation

Tracing instrumentation should use the OpenTracing APIs to stay portable and in sync with the standard:

For reference, the generated LightStep documentation is also available:

Options

Setting a custom component name

To set the name used in the LightStep UI for this instance of the Tracer, call withComponentName() on the OptionsBuilder object:

options = new com.lightstep.tracer.shared.Options.OptionsBuilder()
                      .withAccessToken("{your_access_token}")
                      .withComponentName("your_custom_name")
                      .build();

Disabling the reporting loop

By default, the Java library does a report of any buffered data on a fairly regular interval. To disable this behavior and rely only on explicit calls to flush() to report data, initialize with:

options = new com.lightstep.tracer.shared.Options.OptionsBuilder()
                      .withAccessToken("{your_access_token}")
                      .withDisableReportingLoop(true)
                      .build();

To then manually flush by using the LightStep tracer object directly:

// Flush any buffered tracing data
((com.lightstep.tracer.jre.JRETracer)tracer).flush();

Flushing the report at exit

In order to send a final flush of the data prior to exit, clients should manually flush by using the LightStep tracer object as described above.

Disabling default clock correction

By default, the Java library performs clock correction based on timestamp information provided in the spans. To disable this behavior, initialize with:

options = new com.lightstep.tracer.shared.Options.OptionsBuilder()
                      .withAccessToken("{your_access_token}")
                      .withClockSkewCorrection(false)
                      .build();

Advanced Option: Transport and Serialization Protocols

By following the above configuration, the tracer will send information to LightStep using HTTP and Protocol Buffers which is the recommended configuration. If there are no specific transport protocol needs you have, there is no need to change this default.

There are two options for transport protocols:

  • Protocol Buffers over HTTP using OkHttp - The recommended and default solution.
  • Protocol Buffers over GRPC - This is a more advanced solution that might be desirable if you already have gRPC networking configured.

You can configure the tracer to support gRPC by replacing com.lightstep.tracer:tracer-okhttp with com.lightstep.tracer:tracer-grpc when including the tracer dependency and including a grpc dependency. i.e.

Maven

<dependency>
  <groupId>com.lightstep.tracer</groupId>
  <artifactId>lightstep-tracer-jre</artifactId>
  <version> VERSION </version>
</dependency>
<dependency>
   <groupId>com.lightstep.tracer</groupId>
   <artifactId>tracer-grpc</artifactId>
   <version> VERSION </version>
</dependency>
<dependency>
    <groupId>io.grpc</groupId>
    <artifactId>grpc-netty</artifactId>
    <version>1.23.0</version>
</dependency>
<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-tcnative-boringssl-static</artifactId>
    <version>2.0.25.Final</version>
</dependency>

Gradle

repositories {
    mavenCentral() // OR jcenter()
}
dependencies {
    compile 'com.lightstep.tracer:lightstep-tracer-jre:VERSION'
    compile 'com.lightstep.tracer:tracer-grpc:VERSION'
    compile 'io.grpc:grpc-netty:1.23.0'
    compile 'io.netty:netty-tcnative-boringssl-static:2.0.25.Final'
}

Development info

See DEV.md for information on contributing to this instrumentation library.

com.lightstep.tracer

Lightstep

Versions

Version
0.30.5
0.30.4
0.30.3
0.30.2
0.30.1
0.30.0
0.20.1
0.20.0
0.19.0
0.18.4
0.18.3
0.18.2
0.18.2-alpha-1
0.18.1
0.18.0
0.17.3
0.17.1
0.17.0
0.16.4
0.16.3
0.16.2
0.16.1
0.16.0
0.15.4
0.15.3
0.15.2
0.15.1
0.15.0
0.14.8
0.14.7
0.14.6
0.14.5
0.14.4
0.14.3
0.14.2
0.14.1
0.14.0
0.13.1
0.12.15
0.12.14
0.12.10
0.12.9
0.12.8
0.12.7
0.12.6
0.12.5
0.12.4
0.12.3
0.12.2
0.12.1
0.12.0.RC1
0.11.1
0.11.0
0.10.1
0.10.0
0.9.28
0.9.27
0.9.26
0.9.25
0.9.24
0.9.23
0.9.18
0.9.17
0.9.16
0.9.15
0.9.13
0.9.12
0.9.11
0.9.9
0.9.8
0.9.7
0.9.6
0.9.4
0.9.3
0.9.2
0.8.23
0.8.22
0.8.21
0.8.20
0.8.19
0.8.17