{"id":18767785,"url":"https://github.com/lightstep/lightstep-tracer-java","last_synced_at":"2025-04-13T06:32:31.664Z","repository":{"id":52275140,"uuid":"56890246","full_name":"lightstep/lightstep-tracer-java","owner":"lightstep","description":"The Lightstep distributed tracing library for JRE","archived":false,"fork":false,"pushed_at":"2023-10-06T01:24:42.000Z","size":41028,"stargazers_count":44,"open_issues_count":8,"forks_count":24,"subscribers_count":67,"default_branch":"master","last_synced_at":"2025-03-26T23:21:56.957Z","etag":null,"topics":["opentracing"],"latest_commit_sha":null,"homepage":"https://lightstep.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lightstep.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-04-22T23:13:55.000Z","updated_at":"2024-05-31T07:20:08.000Z","dependencies_parsed_at":"2022-09-12T04:20:45.300Z","dependency_job_id":null,"html_url":"https://github.com/lightstep/lightstep-tracer-java","commit_stats":null,"previous_names":[],"tags_count":128,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Flightstep-tracer-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Flightstep-tracer-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Flightstep-tracer-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Flightstep-tracer-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightstep","download_url":"https://codeload.github.com/lightstep/lightstep-tracer-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248674678,"owners_count":21143760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["opentracing"],"created_at":"2024-11-07T19:08:33.873Z","updated_at":"2025-04-13T06:32:28.278Z","avatar_url":"https://github.com/lightstep.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lightstep-tracer-java [Deprecated]\n\n[ ![Download](https://maven-badges.herokuapp.com/maven-central/com.lightstep.tracer/lightstep-tracer-java/badge.svg) ](https://maven-badges.herokuapp.com/maven-central/com.lightstep.tracer/lightstep-tracer-java) [![Circle CI](https://circleci.com/gh/lightstep/lightstep-tracer-java.svg?style=shield)](https://circleci.com/gh/lightstep/lightstep-tracer-java) [![MIT license](http://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)\n\nIn August 2023, [Lightstep became ServiceNow\nCloud Observability](https://docs.lightstep.com/docs/banner-faq). To ease the\ntransition, all code artifacts will continue to use the Lightstep name. You\ndon't need to do anything to keep using this repository.\n\nThe LightStep distributed tracing library for the standard Java runtime environment.\n\n* [Getting Started](#getting-started)\n  * [JRE](#getting-started-jre)\n* [API documentation](#apidocs)\n* [Options](#options)\n\n\u003ca name=\"#getting-started\"\u003e\u003c/a\u003e\n\u003ca name=\"#getting-started-jre\"\u003e\u003c/a\u003e\n\n## Getting started: JRE\n\nThe JRE library is hosted on  Maven Central. \n\n**Note**: Starting from version 0.30.0, lightstep-tracer-java-common and lightstep-tracer-java artifacts use the same\nmajor/minor version, only differing in the patch part.\n\n### Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.lightstep.tracer\u003c/groupId\u003e\n    \u003cartifactId\u003elightstep-tracer-jre\u003c/artifactId\u003e\n    \u003cversion\u003e VERSION \u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n   \u003cgroupId\u003ecom.lightstep.tracer\u003c/groupId\u003e\n   \u003cartifactId\u003etracer-okhttp\u003c/artifactId\u003e\n   \u003cversion\u003e VERSION \u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.slf4j\u003c/groupId\u003e\n    \u003cartifactId\u003eslf4j-simple\u003c/artifactId\u003e\n    \u003cversion\u003e1.7.25\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n* Be sure to replace `VERSION` with the current version of the library. For `TRACER-GRPC-VERSION` you can refer to  [lightstep-tracer-common](https://github.com/lightstep/lightstep-tracer-java-common) which contains `tracer-grpc` (and `tracer-okhttp`).\n* 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\n\n### Gradle\n\nIn most cases, modifying your `build.gradle` with the below is all that is required:\n\n```\nrepositories {\n    mavenCentral() // OR jcenter()\n}\ndependencies {\n    compile 'com.lightstep.tracer:lightstep-tracer-jre:VERSION'\n    compile 'com.lightstep.tracer:tracer-okhttp:VERSION'\n    compile 'org.slf4j:slf4j-simple:1.7.25'\n}\n```\n\n* Be sure to replace `VERSION` with the current version of the library\n* The artifact is published to both `jcenter()` and `mavenCentral()`. Use whichever you prefer.\n\n### Initializing the LightStep Tracer\n\n```java\n// Important the OpenTracing interfaces\nimport io.opentracing.Span;\nimport io.opentracing.Tracer;\n\n// ...\n\n// Initialize the OpenTracing Tracer with LightStep's implementation\nTracer tracer = new com.lightstep.tracer.jre.JRETracer(\n         new com.lightstep.tracer.shared.Options.OptionsBuilder()\n            .withAccessToken(\"{your_access_token}\")\n            .build()\n);\n\n// Start and finish a Span\nSpan span = tracer.buildSpan(\"my_span\").start();\nthis.doSomeWorkHere();\nspan.finish();\n```\n\n\u003ca name=\"apidocs\"\u003e\u003c/a\u003e\n## API Documentation\n\nTracing instrumentation should use the OpenTracing APIs to stay portable and in sync with the standard:\n\n* [OpenTracing API (javadoc)](http://javadoc.io/doc/io.opentracing/opentracing-api)\n\n\nFor reference, the generated LightStep documentation is also available:\n\n* [lightstep-tracer-jre (javadoc)](http://javadoc.io/doc/com.lightstep.tracer/lightstep-tracer-jre)\n\n## Options\n\n### Setting a custom component name\n\nTo set the name used in the LightStep UI for this instance of the Tracer, call `withComponentName()` on the `OptionsBuilder` object:\n\n```java\noptions = new com.lightstep.tracer.shared.Options.OptionsBuilder()\n                      .withAccessToken(\"{your_access_token}\")\n                      .withComponentName(\"your_custom_name\")\n                      .build();\n\n```\n\n### Disabling the reporting loop\n\nBy 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:\n\n```java\noptions = new com.lightstep.tracer.shared.Options.OptionsBuilder()\n                      .withAccessToken(\"{your_access_token}\")\n                      .withDisableReportingLoop(true)\n                      .build();\n```\n\nTo then manually flush by using the LightStep tracer object directly:\n\n```java\n// Flush any buffered tracing data\n((com.lightstep.tracer.jre.JRETracer)tracer).flush();\n```\n\n### Flushing the report at exit\n\nIn 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.\n\n### Disabling default clock correction\n\nBy default, the Java library performs clock correction based on timestamp information provided in the spans. To disable this behavior, initialize with: \n\n```java\noptions = new com.lightstep.tracer.shared.Options.OptionsBuilder()\n                      .withAccessToken(\"{your_access_token}\")\n                      .withClockSkewCorrection(false)\n                      .build();\n```\n\n### Advanced Option: Transport and Serialization Protocols\n\nBy 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.\n\nThere are two options for transport protocols:\n\n- [Protocol Buffers](https://developers.google.com/protocol-buffers/) over HTTP using [OkHttp](http://square.github.io/okhttp/) - The recommended and default solution.\n- [Protocol Buffers](https://developers.google.com/protocol-buffers/) over [GRPC](https://grpc.io/) - This is a more advanced solution that might be desirable if you already have gRPC networking configured.\n\nYou 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.\n\n#### Maven \n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.lightstep.tracer\u003c/groupId\u003e\n  \u003cartifactId\u003elightstep-tracer-jre\u003c/artifactId\u003e\n  \u003cversion\u003e VERSION \u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n   \u003cgroupId\u003ecom.lightstep.tracer\u003c/groupId\u003e\n   \u003cartifactId\u003etracer-grpc\u003c/artifactId\u003e\n   \u003cversion\u003e VERSION \u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.grpc\u003c/groupId\u003e\n    \u003cartifactId\u003egrpc-netty\u003c/artifactId\u003e\n    \u003cversion\u003e1.23.0\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.netty\u003c/groupId\u003e\n    \u003cartifactId\u003enetty-tcnative-boringssl-static\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.25.Final\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### Gradle\n\n```\nrepositories {\n    mavenCentral() // OR jcenter()\n}\ndependencies {\n    compile 'com.lightstep.tracer:lightstep-tracer-jre:VERSION'\n    compile 'com.lightstep.tracer:tracer-grpc:VERSION'\n    compile 'io.grpc:grpc-netty:1.23.0'\n    compile 'io.netty:netty-tcnative-boringssl-static:2.0.25.Final'\n}\n```\n\n## Development info\n\nSee [DEV.md](DEV.md) for information on contributing to this instrumentation library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightstep%2Flightstep-tracer-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightstep%2Flightstep-tracer-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightstep%2Flightstep-tracer-java/lists"}