How to Use the OpenTelemetry Collector Debug Exporter

Use the OpenTelemetry Collector debug exporter to check a test traces pipeline with one synthetic span, then confirm the backend separately. YAML included.

Ephraim Duncan

To use the OpenTelemetry Collector debug exporter, add debug to the exporters section, list it in a test traces pipeline, set verbosity, send one synthetic span, and read the Collector's console output. That output proves one thing: a span made it through your receiver and processors to the debug branch. It does not prove your backend received anything.

That gap is where most wasted afternoons come from. A developer sees a clean span dump in the Collector logs, concludes the pipeline is fine, and then spends an hour staring at an empty trace view. The debug exporter is a checkpoint, not a finish line. This post shows how to wire it up, pick a verbosity, send a throwaway span, verify the backend as a separate step, and rip the debug output back out when you are done.

What a debug export proves

A debug export proves that telemetry reached the debug exporter in the pipeline you configured, after any processors that sit upstream of it. Nothing more. The exporter prints to the Collector's own output, so it never touches the network or your backend.

That makes it a good answer to three questions: did the receiver accept the data, did my processors change it the way I expected, and what attributes does the span actually carry. It is a bad answer to these: did the OTLP exporter authenticate, did the backend accept the batch, and will the span show up in a trace view.

Treat a debug export as one checkpoint in a chain: app, receiver, processors, exporter, backend. Sending a small amount of test data to a Collector configured with a local exporter is a practical way to verify configuration and debug networking. Local output tells you the Collector side is healthy. Whether data left the Collector successfully is a different question, and the one the sending-side counters answer. If spans vanish after the debug line prints, start with OpenTelemetry Collector Dropped Spans: Find the Drop.

Debug exporter vs logging exporter

The debug exporter replaced the logging exporter. The Collector configuration docs carry the note directly: prior to v0.86.0, use logging instead of debug. If you are on a modern Collector, use debug. If you copy an old tutorial that says logging, rename it and keep the same verbosity setting. The behavior you want, printing telemetry to the console, is the same.

What is the difference between the debug exporter and the logging exporter?

The debug exporter is the current replacement for the older logging exporter, which is deprecated and was removed in later Collector releases. Both write telemetry to the Collector's own output, and the debug exporter uses the same verbosity levels (basic, normal, detailed). If an old config still lists logging, rename it to debug and check your Collector version's docs for the exact settings. Neither exporter sends data anywhere, so output from either one confirms only that the pipeline received the span, not that your backend did.

Add debug to a test traces pipeline

Add the exporter under exporters, then reference it in a traces pipeline under service. Declaring an exporter does nothing on its own. The Collector only runs components that a pipeline lists.

Keep this a separate, isolated config from production. Here is a minimal test pipeline for traces:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 127.0.0.1:4317
      http:
        endpoint: 127.0.0.1:4318

processors:
  batch:
    timeout: 1s

exporters:
  debug:
    verbosity: detailed

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug]

Two choices matter here. Bind the receiver to 127.0.0.1 so a test config never listens on a public interface. And keep the batch timeout short so you are not waiting on the default flush interval to see output. If you tune batching later, OpenTelemetry Collector Batch Processor: Tune Trace Batches covers what those settings do.

Traces, metrics and logs in one config

The same exporter works for all three signals. Add a pipeline per signal and point each at debug:

service:
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [debug]
    metrics:
      receivers: [otlp]
      exporters: [debug]
    logs:
      receivers: [otlp]
      exporters: [debug]

For this post, stay on traces. One signal makes the output easy to read.

Run the Collector locally or in a container. The Docker install page has the pull-and-run commands and a Docker Compose snippet. Mount your test config over the default and watch the container's stderr.

Choose verbosity and send a synthetic span

Pick detailed while you are debugging one span, and basic when you only want proof that data is flowing. The README defines three levels: basic prints a single-line summary with a count of records per batch, normal prints about one line per telemetry record, and detailed prints every detail of every record across multiple lines.

Verbosity What you get Use it when
basic One summary line per batch Confirming data arrives at all
normal About one line per record Skimming span names and counts
detailed Full attributes, events, links Checking what a processor changed

Sampling the debug output

The exporter also has sampling_initial and sampling_thereafter settings. The first sets how many records print each second before sampling starts, and the second sets how often records print after that. A walkthrough of the exporter shows them as controls for keeping a busy pipeline from flooding the console, for example 10 initial then every 100th:

exporters:
  debug:
    verbosity: detailed
    sampling_initial: 10
    sampling_thereafter: 100

For a single synthetic span you do not need sampling. Add it only if the same Collector also receives real traffic.

Send one synthetic span

Use an obviously fake span with a name you can grep for. The Python OTLP exporter points at the Collector's endpoint:

from opentelemetry import trace
from opentelemetry.sdk.resources import Resource, SERVICE_NAME
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter

resource = Resource.create({SERVICE_NAME: "debug-checkpoint-test"})
provider = TracerProvider(resource=resource)
provider.add_span_processor(
    BatchSpanProcessor(OTLPSpanExporter(endpoint="http://127.0.0.1:4318/v1/traces"))
)
trace.set_tracer_provider(provider)

tracer = trace.get_tracer("checkpoint")
with tracer.start_as_current_span("synthetic-checkpoint-span") as span:
    span.set_attribute("test.purpose", "collector-debug-checkpoint")

provider.shutdown()

The shutdown() call flushes the batch processor so the span leaves the script before it exits. Then look at the Collector's output for synthetic-checkpoint-span.

Keep the payload synthetic. At detailed verbosity the exporter writes every attribute to the console, so never point it at real prompts, user messages, or customer data. Fake span, fake attributes, localhost only.

What does a detailed verbosity config look like?

Set verbosity: detailed under the debug exporter, then add that exporter to the traces pipeline. The exporters block is debug: verbosity: detailed, and the service block is pipelines: traces: receivers: [otlp] with exporters: [debug]. Detailed prints every span with its attributes, events and links to the Collector's own log, so a single synthetic span shows up in full. The other levels are basic, which prints one summary line per batch, and normal. Use detailed only while testing, because it is noisy under real traffic.

Check the backend separately

Verify the backend as its own step, with its own evidence, because the debug branch and the backend branch are different exporters. A span printed by debug says nothing about whether otlphttp or otlp delivered it.

The cleanest way to do this is to add your real exporter alongside debug in the same pipeline, so one span fans out to both:

exporters:
  debug:
    verbosity: detailed
  otlphttp:
    endpoint: https://your-backend.example.com
    headers:
      authorization: "Bearer ${env:BACKEND_TOKEN}"

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug, otlphttp]

Send the same synthetic span, then run two checks.

First, watch the Collector's own logs and internal metrics for the sending side. The Collector exposes its own telemetry for exactly this. A debug line followed by export errors, auth failures, or a full queue means the Collector side worked and the delivery side did not. Our guides on the sending queue filling up and the memory limiter refusing spans cover the usual causes.

Second, look in the backend itself for synthetic-checkpoint-span under the service name debug-checkpoint-test. Only a span you can find there counts as received.

If your backend is telemetry.dev, an LLM observability service built on OpenTelemetry that traces model calls, tool steps and retrievals, any OTLP/HTTP exporter or Collector works, so the otlphttp exporter above is the whole integration. Send the synthetic span, then search for it in your workspace. The free plan makes it a cheap place to run this check. For the follow-up question of what to read once spans are flowing, see OpenTelemetry LLM Observability: Verify Exported Spans.

Remove temporary debug output

Take debug out of every production pipeline once the checkpoint passes. Three reasons: volume, exposure, and stability.

Volume: printing every record from a busy pipeline floods the Collector's logs and costs CPU and storage you did not plan for. Exposure: detailed verbosity writes full attributes, so any prompt text or identifiers an instrumented app attaches to spans end up in your logs. Stability: the README warns that output formats at every verbosity level are not guaranteed and may change at any time without a breaking change. Do not build log parsers or alerts on it.

A short cleanup checklist:

  • Delete debug from the exporters list of each pipeline, then from the top-level exporters block if nothing else uses it.

  • Revert the batch timeout and any receiver bindings you changed for the test.

  • Search your config repo for verbosity: detailed before merging.

  • If you want a standing safety net, keep a debug exporter at basic verbosity with sampling, so you get a count line without per-span detail.

Delete the test config and the throwaway service name from your backend project too, so synthetic data does not linger in dashboards.

Send one synthetic span to both branches today

The debug exporter answers a narrow question well: did this span survive my receiver and processors. Treat that answer as one checkpoint and never as proof of delivery. Add debug and your real exporter to a throwaway traces pipeline, send one fake span named something you can search for, and confirm it appears in the backend. If you do not have a backend yet, point the otlphttp exporter at telemetry.dev's free plan and run that check there.

Share this article

Related posts

OpenTelemetry Collector Persistent Queue Setup

Set up an OpenTelemetry Collector persistent queue with file_storage and sending_queue, mount durable disk, run a kill test, and see where spans still get lost.