Correlating PEAC records with OpenTelemetry traces
Informative guide, introduced in v0.16.2. Telemetry is operational signal; a PEAC record is signed, portable evidence. PEAC composes with OpenTelemetry and W3C Trace Context; it does not replace, own, or standardize them.
peac.record.refis a PEAC custom span attribute, not an OpenTelemetry semantic convention. W3Ctraceparent/tracestateare correlation carriers, not PEAC proof.
Two correlation directions
1. W3C Trace Context header to PEAC record
W3C Trace Context propagates a trace across services via the traceparent and tracestate HTTP headers. @peac/telemetry-otel reads those headers and returns a vendor-neutral extension object you can carry inside a record's org.peacprotocol/correlation extension.
import { createTraceContextExtensions } from '@peac/telemetry-otel';
// headers from the inbound HTTP request
const correlation = createTraceContextExtensions(headers);
// -> { "w3c/traceparent": "...", "w3c/tracestate": "..." } when a valid traceparent is present,
// otherwise undefined
The keys are w3c/traceparent and w3c/tracestate (a vendor-neutral w3c/ namespace, not io.opentelemetry). They are correlation references only; the record's own binding and signature are unchanged.
2. PEAC record to OpenTelemetry span
When an active OpenTelemetry span exists, @peac/telemetry-otel adds a span event whose attributes include the record reference. New emitters use peac.record.ref; the legacy peac.receipt.ref is dual-emitted for one minor-release compatibility window (read peac.record.ref).
peac.record.ref = sha256:<hex> # preferred
peac.receipt.ref = sha256:<hex> # deprecated, compatibility only
These are PEAC custom attributes, and they are span event attributes, never metric labels (a record reference is high-cardinality).
Boundary (what this is not)
peac.record.refis a PEAC custom span attribute, not an OpenTelemetry semantic convention. It is not an OpenTelemetry semantic convention unless and until OpenTelemetry adopts it.- PEAC ships no OpenTelemetry SDK, exporter, collector, or semantic-convention package.
@peac/telemetrydefines PEAC attribute names;@peac/telemetry-otelmaps PEAC telemetry onto OpenTelemetry span events. - W3C
traceparent/tracestateare carried as correlation references; they do not establish payment, authorization, or any PEAC finality.
Reference
@peac/telemetry: PEAC attribute names (PEAC_ATTRS,TRACE_CONTEXT_EXTENSIONS).@peac/telemetry-otel:createTraceContextExtensions; OpenTelemetry span-event mapping.- Integration Patterns (trace-context and span-attribute patterns)
- Observability profile
- Gateway Decision Evidence (correlation and telemetry section)