OpenTelemetry is a toolkit you can use to gather telemetry data from your apps or services and then export that data to New Relic. If you're familiar with OpenTelemetry and are ready to start setting up your app or service, you're in the right place.
If you'd rather try out OpenTelemetry on a demo app, or see other setup options, see How to get started with OpenTelemetry.
The following five steps will help you instrument your own app or service with OpenTelemetry:
- Prerequisites
- Instrument your app or service with OpenTelemetry
- Review configurations for exporting telemetry data to New Relic
- Complete the export configuration steps
- View your data in the New Relic UI
Step 1: Before you start
- If you haven't already done so, sign up for a free New Relic account.
- Get the license key for the New Relic account to which you want to report data.
Step 2: Instrument your app or service with OpenTelemetry
To help you get started with instrumentation, OpenTelemetry provides language-specific products and SDKs. Many languages offer out-the-box instrumentation for common libraries and frameworks. Each language also provides an API to help you manually instrument your code to gather telemetry.
Go to the repository for your language and follow the instructions to instrument your code. When you're done, return here to complete Step 3: Review configurations for exporting telemetry data to New Relic.
- C++
- Erlang
- Go
- Java
- Javascript/Node.js
- .NET
- PHP
- Python
- Ruby
- Rust
- Swift
- ...See a complete list of languages in GitHub
Step 3: Review configurations for exporting telemetry data to New Relic
Before you set up the export of your telemetry data, you first need to review and bookmark this section of settings for New Relic. You'll need this information when you later go to other pages explaining the export steps.
The export relies on the OpenTelemetry Protocol, or OTLP for short, which is a general purpose telemetry data delivery protocol designed for the OpenTelemetry project. This protocol describes how to encode and transmit telemetry data, which makes it a natural choice for data transport. Each language SDK provides an OTLP exporter you can configure to export data over OTLP.
You have two choices for exporting data to New Relic via OTLP:
Directly from your app:
The OTLP exporter in your app or service can export directly to the New Relic OTLP receiver.
Export from an OpenTelemetry Collector:
You can set up the collector as a gateway that receives, processes, and exports to the New Relic OTLP receiver. Alternatively, you can set up the collector as an agent that runs with your application or runs on the same host.
Whether you export directly from your app or from a collector, you'll need to:
- Be ready to configure the OTLP exporter to add a header (
api-key
). The value is the license key for the New Relic account you want to send data to. - Based on your integration, be ready to configure the endpoint where the exporter sends data to New Relic. Endpoints are region-specific, so use the one where your New Relic organization is based. For example, if you're using the EU data center region, use an EU endpoint. Use the table below as a guide, and see the additional considerations about ports and endpoints that follow:
Integration | gRPC | HTTP | Endpoint | Supported Ports | API header name | API header value | TLS encryption required |
---|---|---|---|---|---|---|---|
US OTLP | ✅ | ✅ |
|
|
| License key | ✅ |
EU OTLP | ✅ | ✅ |
|
|
| License key | ✅ |
US FedRAMP OTLP | ✅ | ✅ |
|
|
| License key | ✅ |
Infinite Tracing | ✅ | ✅ |
|
|
| License key | ✅ |
Step 4: Complete the export configuration steps
Now that you are familiar with the New Relic-specific configurations for exporting, follow the instructions for the way you want to export data:
Export directly to New Relic from your apps
Click on the link below for your language and complete the configuration steps. When you're done, return here to complete Step 5. View your data in the New Relic UI.
- C++
- Erlang
- Go
- Java
- Javascript/Node.js
- .NET
- PHP
- Python
- Ruby
- Rust
- Swift
- ...Find additional OTLP language support in GitHub
Export to New Relic from a collector
You can set up the collector in different ways and for different purposes. If you need general information about the collector before getting into the setup, see our introduction.
Choose one of the following to see examples for setting up your collector to export.
- Basic collector example with Docker
- Collector setup for infrastructure host monitoring
- Additional collector setup examples
Step 5: View your data in the New Relic UI
Once you've instrumented your app or service and configured it to export its data to New Relic, watch the New Relic UI for your traces, metrics, and logs.
The UI for OpenTelemetry has some similarities to our APM UI, so if you are familiar with that, you can go right to the UI. If you need help understanding your OpenTelemetry UI options or how to make sure your data appears in the UI, see View your OpenTelemetry data in New Relic.
Did this doc help with your installation?
Unsupported specifications
New Relic currently supports opentelemetry-specification v1.8.0
with a few exceptions:
- Successful responses from New Relic have no response body, instead of a Protobuf-encoded response based on the data type. New Relic also responds with success after authenticating, before decoding and validation.
- Failure responses from New Relic do not include
Status.message
orStatus.details
, since OTLP clients don't use theStatus
object.
What's next?
After you're done with your initial setup, check out our End-to-end implementation guide and our other best practice guides. These will help you optimize your use of OpenTelemetry.