OpenTelemetry metric ingestion

OpenTelemetry is a collection of tools, APIs, and SDKs. You can use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) for analysis to get insights into your software's performance and behavior.

Dynatrace OpenTelemetry metrics exporters

To export your application metrics to Dynatrace using a Dynatrace-provided metrics exporter

  1. Add the exporter library as a dependency for your application
  2. Register and configure the exporter through the OpenTelemetry API to export metrics

Dynatrace provides you with OpenTelemetry metrics exporters for the languages listed below. The referenced repositories provide you with detailed instructions on how to set up your OpenTelemetry metric ingestion.

The Dynatrace exporters are open source and available on GitHub. For detailed information on using a particular exporter, see the README file included in the root of each repository.

Using Dynatrace-provided metrics exporters on a host with OneAgent installed is the easiest way to ingest OpenTelemetry-exposed metrics to Dynatrace.

Scenarios for OpenTelemetry metric ingestion

Depending on your setup, you can:

OpenTelemetry Metrics

Send metrics directly to OneAgent

With OneAgent on the same host, the host ID and host name context are automatically added to each metric as dimensions. This way, the metrics are automatically booked to the respective entities in Dynatrace. For more information, see Metric ingestion.

Additionally, the exporters automatically enrich the metrics with process-related metadata using the method described in Enrich metrics with Dynatrace-specific dimensions.

Zero configuration

With the OneAgent on the same host, metrics are automatically sent to the OneAgent metric API. In this case, no endpoint or credentials have to be configured for the exporter.

Topology Awareness

With OneAgent on the same host, the host ID and host name context are automatically added to each metric as dimensions. This way, the metrics are automatically booked to the respective entities in Dynatrace. For more information, see Metric ingestion.

The exporters also support the process-related metadata enrichment documented in Enrich metrics with Dynatrace-specific dimensions.

Send metrics to Dynatrace metric API

If you can't install OneAgent on the same host with the metrics exporter, you can send metrics to the Dynatrace API ingestion endpoint.

In this case, automatic topology awareness and zero configuration aren't available out of the box. However, you can manually enrich your metrics with Dynatrace-specific metadata by adding a topology-related dimension, such as host ID or host name. For more information, see Dimension format in the metrics ingestion protocol reference documentation.

Metrics endpoint

You'll need to configure your exporter with your Dynatrace environment URL as the metrics endpoint and the API token with the Ingest metrics permission. We recommended that you limit the token scope to only this permission.

Example - Install the Dynatrace OpenTelemetry Metrics Exporter using NPM

Note, the url and APIToken fields are only examples.

npm install @dynatrace/opentelemetry-exporter-metrics

// In your application
const { MeterProvider } = require('@opentelemetry/metrics');
const { DynatraceMetricExporter } = require('@dynatrace/opentelemetry-exporter-metrics');

// configure API endpoint and authentication token
const exporter = new DynatraceMetricExporter
({
// This is only required if the OneAgent is not installed on the same host
// url: 'https://myenv123.live.dynatrace.com/api/v2/metrics/ingest',
// APIToken: 'token123'’, // hard-coded for illustration only, should be read from config or env vars
prefix: 'MyPrefix', // optional
});

OpenTelemetry collector

The OpenTelemetry collector exporter provides you with a vendor-agnostic implementation showing how to receive, process, and export telemetry data. It comes with its own protocol (OTLP) and removes the need to run a dedicated exporter inside the application.

OpenTelemetry Metrics Collector

Automatic metadata enrichment and topology awareness are not available when using the collector. However, you can manually enrich your metrics with Dynatrace-specific metadata by adding a topology-related dimension, such as host ID. For more information, see Dimension format in the metrics ingestion protocol reference documentation.

The OpenTelemetry collector comes with the Dynatrace metrics exporter. To enable the Dynatrace metric exporter, follow the instructions in the Dynatrace Exporter README in the OpenTelemetry Collector GitHub repository.

AWS Distro for OpenTelemetry

AWS provides a secure, production-ready, AWS-supported distribution of the OpenTelemetry project.

The Dynatrace metrics exporter is part of the collector component. For more information, see Dynatrace Exporter in the AWS Distro for OpenTelemetry documentation.