{"id":15137824,"url":"https://github.com/newrelic/newrelic-tracer-java","last_synced_at":"2025-09-29T06:31:08.228Z","repository":{"id":44718911,"uuid":"214515824","full_name":"newrelic/newrelic-tracer-java","owner":"newrelic","description":"Tracer Plugin for the Java SpecialAgent which provides automatic OpenTracing-based instrumentation for 3rd-party Java libraries","archived":true,"fork":false,"pushed_at":"2022-01-28T18:15:14.000Z","size":670,"stargazers_count":1,"open_issues_count":0,"forks_count":7,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-01-11T13:01:20.462Z","etag":null,"topics":["monitoring","newrelic","open-telemetry","open-tracing","telemetry-java"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/newrelic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-11T19:38:05.000Z","updated_at":"2023-01-28T03:36:34.000Z","dependencies_parsed_at":"2022-07-20T15:02:17.939Z","dependency_job_id":null,"html_url":"https://github.com/newrelic/newrelic-tracer-java","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newrelic%2Fnewrelic-tracer-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newrelic%2Fnewrelic-tracer-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newrelic%2Fnewrelic-tracer-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newrelic%2Fnewrelic-tracer-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/newrelic","download_url":"https://codeload.github.com/newrelic/newrelic-tracer-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234597573,"owners_count":18857980,"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":["monitoring","newrelic","open-telemetry","open-tracing","telemetry-java"],"created_at":"2024-09-26T07:02:28.502Z","updated_at":"2025-09-29T06:31:07.875Z","avatar_url":"https://github.com/newrelic.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Archived header](https://github.com/newrelic/open-source-office/raw/master/examples/categories/images/Archived.png)](https://github.com/newrelic/open-source-office/blob/master/examples/categories/index.md#archived)\n\n# Archival Notice\n\n❗Notice: This project has been archived _as is_ and is no longer actively maintained.\n\nOpenTracing has been superseded by OpenTelemetry and it is highly recommended that you move all projects to OpenTelemetry at this time. Please see the links below to learn more about how to send data from OpenTelemetry data sources to the New Relic platform.\n\nThe current recommended approaches for sending OpenTelemetry data to the New Relic platform are as follows:\n* Configure your OpenTelemetry data source to send data to the [OpenTelemetry Collector](https://docs.newrelic.com/docs/integrations/open-source-telemetry-integrations/opentelemetry/introduction-opentelemetry-new-relic/#collector) using the OpenTelemetry Protocol (OTLP) and configure the collector to forward the data using the [New Relic collector exporter](https://github.com/newrelic-forks/opentelemetry-collector-contrib/tree/newrelic-main/exporter/newrelicexporter).\n* Configure your OpenTelemetry data source to send data to the native OpenTelemetry Protocol (OTLP) data ingestion endpoint. [OTLP](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md) is an open source gRPC based protocol for sending telemetry data. The protocol is vendor agnostic and open source.\n\nFor more details please see:\n* [OpenTelemetry quick start](https://docs.newrelic.com/docs/integrations/open-source-telemetry-integrations/opentelemetry/opentelemetry-quick-start/)\n* [Introduction to OpenTelemetry with New Relic](https://docs.newrelic.com/docs/integrations/open-source-telemetry-integrations/opentelemetry/introduction-opentelemetry-new-relic/)\n* [Native OpenTelemetry Protocol (OTLP) support](https://docs.newrelic.com/whats-new/2021/04/native-support-opentelemetry/)\n\n---\n\n# New Relic OpenTracing Tracer Plugin\n\nAn OpenTracing [TracerFactory](https://github.com/opentracing-contrib/java-tracerresolver) that utilizes the OpenTelemetry [TraceShim](https://github.com/open-telemetry/opentelemetry-java/blob/master/opentracing_shim/src/main/java/io/opentelemetry/opentracingshim/TraceShim.java) \nto convert to an OpenTelemetry Tracer. This functions as a [Tracer Plugin](https://github.com/opentracing-contrib/java-specialagent#43-tracer-plugin) \nfor the [Java SpecialAgent](https://github.com/opentracing-contrib/java-specialagent) which provides automatic OpenTracing-based instrumentation for 3rd-party Java libraries.\n \nData collected by the Tracer is sent to New Relic by the [New Relic OpenTelemetry Exporter](https://github.com/newrelic/opentelemetry-exporter-java).\n\n\u003e ⚠️ **NOTICE**: The Tracer Plugin utilizes the [Alpha v0.2 release](https://github.com/open-telemetry/opentelemetry-specification/blob/master/milestones.md#alpha-v02) of OpenTelemetry APIs. OpenTelemetry APIs are subject to change while approaching a stable release and are not yet recommended for use in production environments.\n\n#### Provided Instrumentation\n\nSee [Instrumentation plugins](https://github.com/opentracing-contrib/java-specialagent#61-instrumentation-plugins) and [rules](https://github.com/opentracing-contrib/java-specialagent#63-instrumented-libraries-by-existing-rules) for lists of all instrumentation provided by the SpecialAgent.\n\n## Getting Started\n\nSee [Usage](#usage)\n\n## Usage\n\nThe Tracer Plugin has not yet been publish but can be built and added to a project as a jar file dependency.\n\nGradle:  \n\n```\ndependencies {\n    implementation files('libs/newrelic-tracer-java-0.2.0-SNAPSHOT-all.jar')\n}\n```\n\nTo use with manual OpenTracing instrumentation simply create an instance of the `NewRelicTracerFactory` and get a `Tracer` implementation from it via `getTracer()`:\n\n```java\nNewRelicTracerFactory newRelicTracerFactory = new NewRelicTracerFactory();\nTracer newrelicTracer = newRelicTracerFactory.getTracer();\n```\n\nTo use the Tracer Plugin with the [Java Special Agent for OpenTracing](https://github.com/opentracing-contrib/java-specialagent#43-tracer-plugin) simply add system properties such as the following to the run configuration of your service:\n\n```java\n-javaagent:path/to/opentracing-specialagent-1.5.7. -Dsa.tracer=./libs/newrelic-tracer-java-0.2.0-SNAPSHOT-all.jar -Dsa.log.level=INFO -Dnr.apiKey=XXX -Dnr.serviceName=\"MyService\"\n```\n\n## Building\n\n* Requirements: Java 8 or greater\n\n`./gradlew shadowJar`\n\n### Configuration\n\nA New Relic [API insert key](https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/introduction-event-api#register) is required to send data to New Relic. The API insert key can be configured directly via a system property or with an optional config file.\n\n#### Config Mechanisms\n\n(Option 1) Individual system properties\n\n`-Dnr.apiKey=123xyz -Dnr.serviceName=foo`\n\n(Option 2) Config file `nr_tracer.properties` specified by the Java SpecialAgent system property\n\n`-Dsa.config=nr_tracer.properties`\n\nwith the contents:\n\n```\nnr.apiKey=123xyz\nnr.serviceName=foo\n```\n\nAdditionally, while this is subject to change, the `OC_RESOURCE_LABELS` OpenConsensus environment variable currently will decorate the generated OpenTelemetry spans with attributes that you specify:\n\n`export OC_RESOURCE_LABELS=\"service.name=foo,env=prod,host=bar\"`\n\n#### Config Properties\n\nList of all configurable Tracer properties\n\n| Config Key       | Value                                                     | Required |\n| :--------------  | :-------------------------------------------------------- | :------  |\n| `nr.apiKey`      | New Relic Insights API Insert key                         | Yes      |\n| `nr.serviceName` | Display name of service, sets `service.name` on the spans | No       |\n\n## Testing\n\n`TODO`\n\n## Support\n\nShould you need assistance with New Relic products, you are in good hands with several support channels.\n\nIf the issue has been confirmed as a bug or is a feature request, file a GitHub issue.\n\n**Support Channels**\n\n* [New Relic Documentation](https://docs.newrelic.com/docs/agents/java-agent/configuration/java-agent-configuration-config-file#h2-transaction-tracer): Comprehensive guidance for using our platform\n* [New Relic Community](https://discuss.newrelic.com/tags/javaagent): The best place to engage in troubleshooting questions\n* [New Relic Developer](https://developer.newrelic.com/): Resources for building a custom observability applications\n* [New Relic University](https://learn.newrelic.com/): A range of online training for New Relic users of every level\n\n## Privacy\nAt New Relic we take your privacy and the security of your information seriously, and are committed to protecting your information. We must emphasize the importance of not sharing personal data in public forums, and ask all users to scrub logs and diagnostic information for sensitive information, whether personal, proprietary, or otherwise.\n\nWe define “Personal Data” as any information relating to an identified or identifiable individual, including, for example, your name, phone number, post code or zip code, Device ID, IP address, and email address.\n\nFor more information, review [New Relic’s General Data Privacy Notice](https://newrelic.com/termsandconditions/privacy).\n\n## Contribute\n\nWe encourage your contributions to improve newrelic-tracer-java! Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project.\n\nIf you have any questions, or to execute our corporate CLA (which is required if your contribution is on behalf of a company), drop us an email at opensource@newrelic.com.\n\n**A note about vulnerabilities**\n\nAs noted in our [security policy](../../security/policy), New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.\n\nIf you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through [HackerOne](https://hackerone.com/newrelic).\n\nIf you would like to contribute to this project, review [these guidelines](./CONTRIBUTING.md).\n\nTo [all contributors](https://github.com/newrelic/newrelic-tracer-java/graphs/contributors), we thank you!  Without your contribution, this project would not be what it is today.  We also host a community project page dedicated to [New Relic OpenTracing Tracer Plugin](https://opensource.newrelic.com/projects/newrelic/newrelic-tracer-java).\n\n### Licensing\n\nThe newrelic-tracer-java is licensed under the Apache 2.0 License.\n\nThe newrelic-tracer-java may use source code from third party libraries.\nFull details on which libraries are used and the terms under which they are licensed can be found in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewrelic%2Fnewrelic-tracer-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewrelic%2Fnewrelic-tracer-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewrelic%2Fnewrelic-tracer-java/lists"}