OpenTelemetry architecture

  • Locate instrumentation, Context, signal-specific SDK state, the Collector and the telemetry backend.
100%
Service A · order-api processSDKService B · inventory-apiprocessOpenTelemetry architecture: application SDKs and CollectorTelemetry transferContext on business callinjecttraceparentspanmeasurementended spansmetric pointsended spanOTLPOTLPexportInstrumentationTracer / Meter APIContext +propagatorServer instrumentationextract parentTracerProviderspan processorMeterProvidermetric readerOTLP span andmetric exportersService B SDKspan exporterCollectorreceive and routeBackendstore and queryinjecttraceparentspanmeasurementended spansmetric pointsended spanOTLPOTLPexport

Select a component to trace its direct connections. Drag to pan · Ctrl + wheel or pinch to zoom.

  • One order request calls inventory. Each service records its part of the request as a span. The spans share a trace ID.
  • The dashed arrow follows the HTTP request. Its traceparent header identifies the calling span. The solid arrows carry observations through the SDK and out to a Collector using the OpenTelemetry Protocol (OTLP).
  • If the header goes missing, both services can export successfully and still appear as two unrelated traces. Compare their trace IDs before investigating the Collector.
  • The upper path carries an application request and trace context. Each service sends telemetry on a separate OTLP connection.
  • Within the order service, a span processor handles ended spans. A metric reader collects aggregated measurements. Select the propagator to compare the two services’ trace identities.
OpenTelemetry client architecture

OpenTelemetry client architecture

OpenTelemetry API and SDK · W3C Trace Context · OTLP

API, SDK and instrumentation libraries

  • Library instrumentation obtains a Tracer or Meter through the API. Its instrumentation scope identifies the library emitting the data. The application configures the SDK and the export destinations.
  • A Resource describes the emitter, for example service.name=order-api. A span identifies one operation. The same resource can emit spans for many concurrent requests.
  • The SDK TracerProvider supplies tracers and owns its sampler and span processors. A batch processor can enqueue ended sampled spans and invoke its SpanExporter in batches.
  • A MeterProvider supplies meters. Each meter creates instruments that report measurements to the SDK. A periodic MetricReader collects aggregated data for export. A pull reader can collect on a scrape. The diagram shows periodic export.
  • A logging bridge can supply log records to the Logs SDK and include trace/span IDs from the active context. Each signal has its own processing and export settings.

Context propagation across a business call

  • The order service starts a client span. Instrumentation injects the active span context into the outgoing HTTP request. The receiving service extracts it and starts a server span with that remote parent.
  • Inspect traceparent in the example: trace ID and parent span ID travel to inventory. The server creates a fresh span ID and exports with its own service resource. The sampled flag carries a sampling decision; delivery can still fail.
  • Remove the carrier in the example. Both services can still export, but a server span started as a new root belongs to another trace. Trace-ID routing at the Collector cannot recover a parent relationship that was never propagated.
  • Baggage is optional propagated data. Limit its contents at trust boundaries; caller-supplied trace or baggage attributes cannot authenticate a request.
One HTTP carrier and two exported spansjson
{
  "description": "One illustrative business call. The HTTP carrier crosses the service boundary while each SDK exports its own spans.",
  "client": {
    "resource": {"service.name": "order-api"},
    "instrumentationScope": "example.http.client",
    "spanKind": "CLIENT",
    "traceId": "1234567890abcdef1234567890abcdef",
    "spanId": "1111111122222222"
  },
  "httpRequestHeaders": {
    "traceparent": "00-1234567890abcdef1234567890abcdef-1111111122222222-01"
  },
  "server": {
    "resource": {"service.name": "inventory-api"},
    "instrumentationScope": "example.http.server",
    "spanKind": "SERVER",
    "traceId": "1234567890abcdef1234567890abcdef",
    "parentSpanId": "1111111122222222",
    "spanId": "3333333344444444"
  },
  "failedPropagationCase": {
    "condition": "Server receives a request without usable parent context and starts a new root.",
    "traceId": "fedcba0987654321fedcba0987654321",
    "parentSpanId": null
  }
}

Separate instrumentation, transport and storage failures

Symptom Boundary to inspect Evidence to collect
Both services appear as separate roots Propagator, carrier, async Context lifetime Compare trace ID and parent span ID across the business call.
Child span exists but parent is absent SDK recording/export, sampler or export queue Check whether the parent was sampled and successfully sent; a trace ID can propagate without exported data.
Trace data arrives; metric series are missing MeterProvider, reader/exporter, signal routing Check the instrument’s scope and resource, reader configuration and the Collector metrics pipeline.
Backend ingest stalls SDK buffers, Collector refusal and exporter queues Determine which process accepted the data and whether its local state survives restart.
  • The Collector is a separate, optional process. In this topology both services send OTLP to it; the backend owns storage and querying.