امنیت، هویت، استقرار و تاب‌آوری · فصل ۵ — Telemetry، SLO و Incident Response · 101

OpenTelemetry: Trace, Metric and Log Correlation

Build a bounded OpenTelemetry correlation model that distinguishes traces, metrics and logs, preserves resource/context identity, and proves one cross-signal diagnosis with explicit gaps instead of treating “three signals exist” as observability success. می‌تواند برای «OpenTelemetry: Trace, Metric, Log Correlation» run/release model و signals/recovery checks لازم را برای یک سرویس محدود طراحی کند.

OpenTelemetry: Trace, Metric, Log Correlation — fa-IR

Lesson summary

Build a bounded OpenTelemetry correlation model that distinguishes traces, metrics and logs, preserves resource/context identity, and proves one cross-signal diagnosis with explicit gaps instead of treating “three signals exist” as observability success.

می‌تواند برای «OpenTelemetry: Trace, Metric, Log Correlation» run/release model و signals/recovery checks لازم را برای یک سرویس محدود طراحی کند.

This lesson produces

می‌تواند برای «OpenTelemetry: Trace, Metric, Log Correlation» run/release model و signals/recovery checks لازم را برای یک سرویس محدود طراحی کند.

Who it is for

Foundation

Guided trace tree, context-key legend and one worked log/trace correlation row.

Repair

Target only the diagnosed misconception; rerun its evidence probe rather than replaying the whole lesson.

Experienced

Skip signal definitions; retain broken-propagation diagnosis, exemplar boundary and changed-topology transfer.

Prerequisites

1. The problem: three signals are not the same as diagnosability

A service may emit traces, metrics, and logs while operators still cannot prove which observations belong to the same request or failure path. Three dashboards only prove that data exists. Correlation requires stable identity, context, and a relationship that can be evidenced.

The owned output is Telemetry Correlation Evidence Record v1. It keeps direct evidence, inference, missing context, and unknowns separate. The goal is not “more telemetry”; it is one bounded, traceable diagnosis.

2. What OpenTelemetry is and is not

OpenTelemetry is an open-source, vendor-neutral framework and toolkit for instrumenting, generating, collecting, and exporting telemetry such as traces, metrics, and logs. OTel itself is not the storage or visualization backend, and a healthy pipeline does not prove instrumentation completeness.

In this lesson, a Collector or exporter is only one layer. The diagnostic question is whether the observations preserve enough identity and context to support the claimed relationship.

3. The three signals do different jobs

A trace usually exposes execution structure and parent/child relationships. A log captures an event or message at a point in execution. A metric summarizes behavior as aggregated or time-series measurements. They complement each other but are not interchangeable.

A detailed log may lack distributed topology. An aggregate metric may reveal an anomaly without identifying the exact request. A trace may show the path while an application log contains the error detail.

4. Establish resource identity before correlation

OpenTelemetry associates telemetry with Resource context. Fields such as service.name and, where supplied, service.instance.id can identify the origin of observations. A shared service name alone does not prove that two records came from the same instance or deployment.

Record resource identity independently. When identity is absent or inconsistent, leave that uncertainty explicit instead of filling it with a naming assumption.

5. Trace topology: a Trace ID is not the whole relationship

Distributed tracing also needs parentage. If Service A creates a span and Service B produces a downstream span with the same Trace ID and a Parent Span ID pointing to the upstream span, the relationship can be directly checked.

If the downstream span starts a new Trace ID or loses parentage, nearby timestamps do not repair the relationship. Record a propagation gap rather than inventing an edge.

6. Context propagation connects service boundaries

Context propagation carries execution context across process and service boundaries. For HTTP, trace context is commonly injected into a carrier and extracted by the receiver. Instrumentation often automates this, but propagation can still break.

One lab edge intentionally loses context. The correct response is not to infer the missing causal edge; keep it unproven and name the minimum instrumentation repair.

7. Log correlation uses trace and span context

The OpenTelemetry log data model can carry TraceId and SpanId on a LogRecord. When those identifiers match an observed span, the log can be correlated directly with that execution context.

A log that merely occurred in the same second is not direct correlation. Time is useful for search and triage; it is insufficient causal proof. The lab includes a deliberately nearby but context-free log.

8. Metric correlation and exemplars

Metrics are normally aggregates. OpenTelemetry defines exemplars as recorded measurements that may preserve context, including trace_id and span_id, allowing a concrete bridge from an aggregate metric to a trace.

A metric without an exemplar can still be valuable, but the aggregate alone cannot identify one exact request. The record separates aggregate evidence from trace-linked evidence.

9. Use the full key, not a partial-key shortcut

Do not equate a matching Span ID with a complete correlation key. Synthetic data can contain the same span identifier under a different Trace ID. If a log has the same span ID but a different Trace ID, reject the link.

The lab includes this probe specifically to invalidate the shortcut “span_id matches, therefore it is the same request.”

10. Pipeline health is not telemetry completeness

A Collector can successfully receive, process, and export what it is given while a library is uninstrumented, a route drops propagation, or a signal is missing on a critical path. Pipeline health only describes telemetry that actually entered the pipeline.

Do not convert pipeline healthy into application fully observable. Missing signal coverage remains an explicit instrumentation gap.

11. Bound cardinality and attributes by the evidence question

Adding many highly variable attributes may appear to make correlation easier, but it changes cost, volume, privacy exposure, and cardinality. Each attribute should answer a bounded diagnostic need.

Use appropriate semantic identity fields and keep secrets, credentials, and sensitive user data out of telemetry. The lesson fixtures contain no real user data.

12. Telemetry Correlation Evidence Record v1

The record includes: observation, signal type, resource/service identity, Trace ID, Span ID, parent relationship, log-context link, metric/exemplar link, direct correlation, inference, missing context, instrumentation gap, unknowns, and diagnostic decision.

This is a MAKNOW instructional synthesis, not a mandatory OpenTelemetry form. Its purpose is to keep observation and inference adjacent but distinct and to prevent gaps from silently disappearing.

13. Lab: eight fixtures and negative probes

The lab is fully local and synthetic. Eight fixtures cover a healthy path, broken propagation, a nearby context-free log, resource mismatch, a metric without exemplar linkage, a partial-key collision, incomplete signal coverage, and a transfer topology with a different broken edge.

For every fixture, classify eight dimensions independently. The hidden oracle checks relationships, not memorized prose. No external endpoint, live backend, or credential is required.

14. Transfer and acceptance criteria

In transfer, service names, instances, trace topology, and the broken edge change. First-case identifiers cannot be copied. Reconstruct topology and direct links from the second fixture.

PASS requires parentage without invented edges, log linkage only through valid context, correct exemplar-versus-aggregate separation, explicit resource mismatches, and a bounded actionable instrumentation gap.

15. Sources, freshness, and claim limits

Current official OpenTelemetry documentation still describes OTel as a vendor-neutral framework for traces, metrics, and logs. Context-propagation guidance explains how context enables correlation across processes and services. The logs specification defines trace-context fields for correlation, and the metrics specification describes exemplars as context-bearing measurements that can connect metrics with traces.

These sources were rechecked on 2026-09-19 and are due for review on 2026-10-17. Nothing here implies complete observability or mandates a specific backend; any link without adequate context remains OPEN.

Assessment

There is no answer key in this lesson pack; answer it yourself and mark honestly. "Needs review" sends the lesson to your review queue.

OPS-008-S1 retrieval

Draw the supplied trace/span topology and identify any edge whose parentage is not directly supported.

lesson ✗AI ✗notes ✗

OPS-008-S2 application

Classify each log as directly correlated, context-free, or rejected because trace/span identity does not match.

lesson ✗AI ✗notes ✗

OPS-008-S3 diagnosis

Explain when a metric exemplar links an aggregate observation to a trace and when the aggregate remains unlinked.

lesson ✗AI ✗notes ✗

OPS-008-S4 decision

Diagnose one orphaned telemetry path and name the minimum instrumentation repair while leaving unsupported links OPEN.

lesson ✗AI ✗notes ✗

OPS-008-S5 transfer

Rebuild correlation for a changed two-service topology with different resource identities and a different broken propagation edge.

lesson ✗AI ✗notes ✗
Assessment rubric
DimensionCriticalSufficient evidence
Context topologyYesTrace/span parentage and propagation continuity are reconstructed without invented edges.
Cross-signal correlationYesLogs and metric exemplars are linked only through explicit context/evidence.
Instrumentation-gap diagnosisYesMissing propagation, resource identity, signal coverage, or attribution remains explicit rather than inferred away.
Transfer topologyYesChanged service/resource topology is solved independently without copying identifiers or diagnosis.

Failure: timestamp-only causality, span-ID-only matching, treating aggregate metrics as request-specific without a link, or treating pipeline health as proof of complete instrumentation.

References & freshness

OpenTelemetry Documentation / What is OpenTelemetry?
·
OpenTelemetry — Context propagation
·
OpenTelemetry Logging specification
·
OpenTelemetry Metrics specification and data model
·

Case studies

Lesson visuals

OPS008-V1

Lab files

Everything is local and synthetic. No account, network target, credential, customer data, production telemetry system, or live backend is used.

For each case, produce eight states: signal_identity_state, resource_identity_state, trace_topology_state, propagation_state, log_correlation_state, metric_exemplar_state, instrumentation_gap_state, and diagnostic_decision.

Rules:

  1. Use the complete trace/span context; do not correlate by timestamp or Span ID alone.
  2. Preserve parent/child topology. A new Trace ID or missing parent leaves the edge unproven.
  3. Treat resource identity as separate evidence, even when trace context matches.
  4. Link a log directly only when its TraceId/SpanId match an observed span.
  5. Distinguish aggregate metrics from exemplar-linked observations.
  6. A healthy collector does not prove missing application telemetry exists.
  7. Keep every unsupported path as an explicit instrumentation gap.
  8. Rebuild the transfer topology from its own identifiers.

Lesson media & slides

MAKNOW_OPS-008_DECISION_EVIDENCE_TABLE_v1.0.0.svg
DECISION EVIDENCE TABLE v1.0.0.svg
MAKNOW_OPS-008_FAILURE_REPAIR_v1.0.0.svg
FAILURE REPAIR v1.0.0.svg
MAKNOW_OPS-008_PRIMARY_MODEL_v1.0.0.svg
PRIMARY MODEL v1.0.0.svg
MAKNOW_OPS-008_WORKED_EXAMPLE_v1.0.0.svg
WORKED EXAMPLE v1.0.0.svg

Teaching files (download)

XLSXTelemetry Correlation Evidence Record v1 v1.0.0.xlsxTeaching files (download)
DOCXTelemetry Correlation Evidence Record v1 WORKSHEET v1.0.0.docxTeaching files (download)
PDFTelemetry Correlation Evidence Record v1 WORKSHEET v1.0.0.pdfTeaching files (download)