Troubleshoot the OpenTelemetry exporter

OpenTelemetry is an emerging standard for service-level instrumentation. Because it has not yet reached 1.0 for any language, the OpenTelemetry SDK, APIs, and instrumentation are subject to change.

If you're using a New Relic OpenTelemetry exporter, but you're not seeing the data you expect, this guide should help.

OpenTelemetry currently supports two telemetry types: distributed traces and metrics. Through the New Relic UI, you can see your traces and metrics, as well as a view that focuses on errors. Learn more about how to find your data.

Install

If you haven’t already, install the New Relic exporter and OpenTelemetry SDK for your language. Instructions vary by language. With that, you can make calls to the OpenTelemetry API to record traces and metrics.

If OpenTelemetry supports auto-instrumentation for your language, you can include that artifact so that you don’t have to call the OpenTelemetry API. The auto-instrumentation artifact will automatically instrument a number of popular frameworks and libraries. In the near future, New Relic will provide a single bundle to download with auto-instrumentation. For now, see the OpenTelemetry site for details for your language.

Entity not found

If your OpenTelemetry SDK logs an error, or you can’t find your service in the New Relic entity explorer, check that you have configured your Insert API key and service name in your New Relic exporter. See the language-specific exporter documentation for how to do this. If you're still having trouble, turn on logging in the New Relic Telemetry SDK.

While it introduces more complexity, you can send your data through the OpenTelemetry collector. To do so, configure your OpenTelemetry SDK service.name as a resource and configure the SDK to send data to the collector. Then configure the collector with the New Relic exporter for Go with your Insert API key. Consult the collector documentation if you're having trouble sending data through the collector.

Once OpenTelemetry is configured with the API key and service name, you should be able to find your service in the entity explorer. Select your service to view its summary page.

Traces

When viewing your OpenTelemetry data, on the left side of the UI you can select Distributed tracing to visualize distributed traces.

If you don’t see any traces, ensure that:

  • Your service was reporting during the time window
  • You have added OpenTelemetry API calls to create trace spans
  • If you are using OpenTelemetry auto-instrumentation, the instrumentation supports the libraries and frameworks that you are using

Traces are the most mature telemetry type in OpenTelemetry, so you'll find the richest performance information from traces.

By default OpenTelemetry SDKs sample 100% of the traces and spans. For high throughput services, that may generate more telemetry data than is desirable. See the SDK documentation for how to choose a sampling strategy and threshold that meets your needs.

Metrics

When viewing your OpenTelemetry data, on the left side of the UI you can select Metrics explorer to visualize metrics and create dashboards. If you don’t see metrics, you may need to add OpenTelemetry API calls to add the metrics that you care about.

The OpenTelemetry standard for metric naming is still being defined and to date most instrumentation includes trace spans but not metrics. We expect that more instrumentation will include metrics in the coming months.

Errors

When viewing your OpenTelemetry data, on the left side of the UI you can select Errors to understand what errors your service is generating. The count of errors is based on how many traces have a span with the attribute error.stack. If you don’t see the errors listed that you expect to see, check that your instrumentation sets the following three attributes:

  • error.stack
  • error.msg
  • error.type

All three attributes must be present in order for the error to be listed.

The OpenTelemetry standard for representing errors in traces and metrics is still being defined so these attribute names are subject to change. We expect those standards to solidify in the coming months.

For more help

If you need more help, check out these support and learning resources: