Skip to content
An OpenTelemetry exporter that sends telemetry to New Relic
Java Kotlin Shell
Branch: master
Clone or download
jkwatson Merge pull request #12 from newrelic/use_telemetry_client_retries
Use the TelemetryClient for retry logic
Latest commit 0ba488c Feb 7, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper Boilerplate for initial project setup Sep 30, 2019
src
.gitignore add pre-commit hook script and .gitignore Sep 30, 2019
CHANGELOG.md update to be compliant with 0.2.0-SNAPSHOT of Open Telemetry Nov 1, 2019
CODE_OF_CONDUCT.md
CONTRIBUTING.md WIP adding to readme, fix link in Contributing Oct 15, 2019
LICENSE.md Boilerplate for initial project setup Sep 30, 2019
README.md Update the README to be more accurate Jan 7, 2020
azure-pipelines-publish.yml Update azure-pipelines-publish.yml for Azure Pipelines Nov 21, 2019
azure-pipelines.yml try removing a needed bit, but maybe it will fix things Nov 21, 2019
build.gradle.kts revert to non-snapshot version to see if that helps Jan 7, 2020
gradle.properties update to be compliant with 0.2.0-SNAPSHOT of Open Telemetry Nov 1, 2019
gradlew Boilerplate for initial project setup Sep 30, 2019
gradlew.bat Boilerplate for initial project setup Sep 30, 2019
pre-commit-hook.sh add pre-commit hook script and .gitignore Sep 30, 2019
settings.gradle Boilerplate for initial project setup Sep 30, 2019

README.md

New Relic OpenTelemetry Span Exporter

An OpenTelemetry reporter for sending spans to New Relic using the New Relic Java Telemetry SDK. For the juicy details on how OpenTelemetry spans are mapped to New Relic spans, see documentation in Our Exporter Specifications Documentation

How To Use

In order to send spans to New Relic, you will need an Insights Insert API Key. Please see New Relic Api Keys for more information.

  1. Create a NewRelicSpanExporter
NewRelicSpanExporter.newBuilder()
        .apiKey(System.getenv("INSIGHTS_INSERT_KEY"))
        .commonAttributes(new Attributes().put("service.name", "best service ever")).build();
  1. Build the OpenTelemetry BatchSpansProcessor with the NewRelicSpanExporter
BatchSpansProcessor.newBuilder(exporter).build();
  1. Create the OpenTelemetry TracerSdk and add the BatchSpanProcessor to the tracerSdk.
TracerSdk tracerSdk = new TracerSdk();
    tracerSdk.addSpanProcessor(spanProcessor);

Gradle

build.gradle:

repositories {
    maven {
        url = "https://oss.sonatype.org/content/repositories/snapshots"
    }
}
implementation("com.newrelic.telemetry:opentelemetry-exporters-newrelic:0.2.0-SNAPSHOT")
implementation("io.opentelemetry:opentelemetry-sdk:0.2.0")
implementation("com.newrelic.telemetry:telemetry-core:0.3.2")
implementation("com.newrelic.telemetry:telemetry-http-okhttp:0.3.2")

Building

CI builds are run on Azure Pipelines: Build Status

The project uses gradle 5 for building, and the gradle wrapper is provided.

To compile, run the tests and build the jar:

$ ./gradlew build

Contributing

Full details are available in our CONTRIBUTING.md file. We'd love to get your contributions to improve the New Relic OpenTelemetry Exporter! Keep in mind 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. To execute our corporate CLA, which is required if your contribution is on behalf of a company, or if you have any questions, please drop us an email at open-source@newrelic.com.

You can’t perform that action at this time.