DEV Community

Cover image for OpenTelemetry traces not showing in Dynatrace: an 8-step OTLP troubleshooting checklist
Span Observer
Span Observer

Posted on Originally published at span.observer

OpenTelemetry traces not showing in Dynatrace: an 8-step OTLP troubleshooting checklist

You have instrumented a service, the Collector is running, and yet with OpenTelemetry traces not showing in Dynatrace the Distributed Tracing screen stays empty. Meanwhile the ongoing incident has no context, MTTR climbs and the team starts doubting the whole telemetry chain.

Goal of this tutorial: follow an 8-step OTLP troubleshooting checklist, from the application to Grail, and isolate the link that drops spans in under 30 minutes. The content applies to Dynatrace SaaS and Dynatrace Managed; URL differences are flagged each time.

If you do not have a Collector yet, start with installing and configuring the OpenTelemetry Collector for Dynatrace, then come back here.

The principle: walk up the chain one link at a time

A trace crosses four links: the SDK in the application, the OTLP export, the Collector (if there is one), then the Dynatrace OTLP endpoint. Each step below tests a single link. Do not skip steps: the most frequent cause is often the most mundane (wrong URL path, token without the right scope).

Prerequisites

  • Read access to the application and Collector logs.
  • A Dynatrace API token with the openTelemetryTrace.ingest scope (Ingest OpenTelemetry traces).
  • curl on a machine in the same network as the application.
  • SaaS: access to Notebooks or the Distributed Tracing app. Managed: access to the environment’s Distributed traces screen.

OpenTelemetry traces not showing: the 8-step checklist

Step 1 — Check that the SDK produces spans

Enable a console exporter next to the OTLP exporter. With auto-instrumentation (Java, Python, Node.js), the standard environment variables are enough:

export OTEL_SERVICE_NAME=checkout
export OTEL_TRACES_EXPORTER=otlp,console
export OTEL_TRACES_SAMPLER=always_on
Enter fullscreen mode Exit fullscreen mode

If no span appears on standard output, the problem is in the application: agent not loaded, library not instrumented or sampler set to always_off. Support for the console value depends on the language: check your SDK documentation.

Step 2 — Check the protocol and port

The Dynatrace OTLP endpoint accepts OTLP over HTTP (protobuf). An SDK set to gRPC (port 4317) sending directly to Dynatrace will not get through. Set the protocol explicitly:

export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
Enter fullscreen mode Exit fullscreen mode

If the application sends to a local Collector, gRPC on 4317 or HTTP on 4318 both work, as long as the matching receiver is enabled in the Collector.

Step 3 — Check the exact URL

This is cause number one. The generic OTEL_EXPORTER_OTLP_ENDPOINT variable takes the base, and the SDK appends /v1/traces. The specific OTEL_EXPORTER_OTLP_TRACES_ENDPOINT variable takes the full URL.

# SaaS
export OTEL_EXPORTER_OTLP_ENDPOINT=https://<env-id>.live.dynatrace.com/api/v2/otlp
# Managed
export OTEL_EXPORTER_OTLP_ENDPOINT=https://<your-domain>/e/<env-id>/api/v2/otlp
# Environment ActiveGate
export OTEL_EXPORTER_OTLP_ENDPOINT=https://<activegate>:9999/e/<env-id>/api/v2/otlp
Enter fullscreen mode Exit fullscreen mode

Classic mistake: putting /api/v2/otlp/v1/traces in the generic variable, which gives /v1/traces/v1/traces and a 404 response. Check the exact format in the Dynatrace OTLP API documentation.

Step 4 — Check the token and its header

export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Api-Token%20dt0c01.XXXX"
Enter fullscreen mode Exit fullscreen mode

The Api-Token prefix followed by a space is mandatory; in this variable, the space is written %20. A 401 means an invalid or malformed token, a 403 a missing scope. Test the endpoint by hand to settle it:

curl -s -o /dev/null -w "%{http_code}\n" -X POST \
  "https://<env-id>.live.dynatrace.com/api/v2/otlp/v1/traces" \
  -H "Authorization: Api-Token $DT_TOKEN" \
  -H "Content-Type: application/x-protobuf" \
  --data-binary @/dev/null
Enter fullscreen mode Exit fullscreen mode

An empty body is not a valid trace: focus on the difference between 401/403 (authentication), 404 (path) and a 2xx or 400 response (the endpoint is reachable and the token accepted). The exact code for an empty body may vary.

Step 5 — Check the network and TLS

From the application pod or host (not from your laptop):

curl -v https://<env-id>.live.dynatrace.com/api/v2/otlp/v1/traces 2>&1 | grep -E "Connected|SSL|HTTP/"
Enter fullscreen mode Exit fullscreen mode

A timeout points to a firewall, an unconfigured outbound proxy or a Kubernetes NetworkPolicy. A certificate error on Managed often means an internal authority that the application runtime does not know; add it to the runtime trust store.

Step 6 — Read the Collector logs and metrics

If a Collector is in the chain, temporarily add the debug exporter to the traces pipeline:

exporters:
  debug:
    verbosity: detailed
  otlphttp:
    endpoint: https://<env-id>.live.dynatrace.com/api/v2/otlp
    headers:
      Authorization: "Api-Token ${env:DT_API_TOKEN}"
service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp, debug]
Enter fullscreen mode Exit fullscreen mode

If the spans show up in the debug log but not in Dynatrace, the problem is on the way out (steps 3 to 5). If they do not show up, the receiver gets nothing (steps 1 and 2). The Collector’s internal metrics, exposed by default on port 8888, confirm the diagnosis: compare otelcol_receiver_accepted_spans, otelcol_exporter_sent_spans and otelcol_exporter_send_failed_spans (a _total suffix may be added depending on the version).

Step 7 — Check sampling and filters

A filter or tail_sampling processor that is too strict can drop every trace of a low-traffic service. A parentbased_traceidratio sampler at 0.01 on a test service with 10 requests per hour produces almost nothing. Switch back to always_on temporarily and remove the filters to confirm.

Step 8 — Look for the spans in the right place in Dynatrace

Sometimes the spans do arrive, but under another service name, in another timeframe or outside your management zone. On SaaS, query Grail directly:

fetch spans, from: now() - 30m
| filter contains(service.name, "checkout")
| summarize spans = count(), by: { service.name, k8s.namespace.name }
Enter fullscreen mode Exit fullscreen mode

On Managed, open Distributed traces, filter on the recent timeframe and remove the management zone. A wrong timestamp (drifting container clock) also places spans outside the displayed window: compare the server time with an NTP server.

How to check that it works

  1. The Collector logs no longer show export errors, and otelcol_exporter_send_failed_spans stays flat.
  2. The step 8 DQL query returns a non-zero span count for your service.
  3. An end-to-end trace opens and shows the spans of each service, with a common parent.

To go further on propagation between services, read end-to-end OpenTelemetry with Dynatrace.

Best practices

  • Keep a minimal test pipeline (OTLP receiver, batch, export) and document it in the on-call runbook.
  • Monitor the Collector itself: an alert on export failures avoids discovering the outage during an incident.
  • Store the token in a secret, never in clear text in a manifest or repository.
  • Avoid double instrumentation: if OneAgent already instruments the process, check in the documentation how it coexists with an OpenTelemetry SDK.
  • Once traces are back, turn them into indicators: see creating an SLO on OpenTelemetry data.

Frequently asked questions

Does Dynatrace accept OTLP over gRPC?

The Dynatrace API OTLP endpoint is documented for OTLP over HTTP. To send gRPC, place a Collector that receives gRPC and exports HTTP to Dynatrace.

Metrics arrive but traces do not: why?

Each signal has its own path (/v1/traces, /v1/metrics, /v1/logs) and token scope. Check that the token also carries openTelemetryTrace.ingest and that the traces pipeline exists in the Collector.

How long should I wait before seeing spans?

Usually a few seconds to a minute, depending on the batch processor and ingestion. Beyond a few minutes, go back through the checklist rather than waiting.

Conclusion

Eight checks almost always suffice: production, protocol, URL, token, network, Collector, sampling, search. Keep this checklist in your runbook: the next telemetry incident will be solved in minutes, not hours.

span.observer is an independent community blog, not affiliated with Dynatrace LLC. Dynatrace is a trademark of Dynatrace LLC. SaaS features evolve quickly: check their availability in your environment and in the official documentation.


Originally published on span.observer. French version: https://span.observer/fr/traces-opentelemetry-absentes-dynatrace/.

Top comments (0)