Traces
Distributed request tracing via Elastic APM Server with OpenTelemetry compatibility.
Traces
The Observability module collects distributed traces via Elastic APM Server, which accepts data from both Elastic APM language agents and any OpenTelemetry-instrumented application via the OTLP endpoint. Traces are stored in Elasticsearch and surfaced in the MCM UI with latency breakdowns, error rates, and full span trees.
Data Flow
Collected Fields
| Field | Description |
|---|---|
| Trace ID | Unique identifier that groups all spans belonging to a single end-to-end request |
| Operation | HTTP method + path, database query, gRPC method, or queue operation name |
| Duration | Total elapsed time from the start of the root span to its completion |
| Status | success — request completed without error · error — an exception or non-2xx response occurred |
| Spans | Number of child operations (DB calls, HTTP sub-requests, cache lookups) within the trace |
Duration Thresholds
| Duration | Severity | Colour |
|---|---|---|
| ≥ 2 000 ms | Critical | Red |
| ≥ 500 ms | Warning | Amber |
| < 500 ms | Normal | — |
OpenTelemetry Compatibility
Elastic APM Server exposes a native OTLP gRPC endpoint (4317) and OTLP HTTP endpoint (4318). Any application instrumented with the OpenTelemetry SDK sends traces without modification — no Elastic-specific agent is required.
Configure the OTel SDK to point at the APM Server:
# OpenTelemetry SDK environment variables
OTEL_EXPORTER_OTLP_ENDPOINT: "http://${APM_SERVER_HOST}:4318"
OTEL_SERVICE_NAME: "my-service"
OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=production"For Elastic APM agents (Java, Node.js, Python, Go, .NET, Ruby, PHP), set:
ELASTIC_APM_SERVER_URL: "http://${APM_SERVER_HOST}:8200"
ELASTIC_APM_SERVICE_NAME: "my-service"
ELASTIC_APM_ENVIRONMENT: "production"Supported Resource Types
All resource types supported by the Observability module can emit traces — the APM agent runs inside the application process, not at the OS level. The MCM UI associates each trace with its parent resource via the resource_id tag that MCM injects into the APM Server configuration.
| Resource Type | Typical Instrumentation |
|---|---|
| AWS EC2 / Ubuntu Host / Azure VM / GCP Compute | Elastic APM agent or OTel SDK inside the application process |
| Docker Container | OTel SDK bundled in the container image; APM Server reachable via Docker network |
| K8s Cluster / Pod | OTel Collector as a sidecar or cluster-wide DaemonSet forwarding to Elastic APM Server |