# OpenTelemetry W3C traceparent / tracestate / baggage + OTLP Header Propagation Validator

Validate W3C Trace Context propagation headers end to end: traceparent (version / 16-byte trace-id / 8-byte parent-id / trace-flags), tracestate (≤32 list members, tenant keys), baggage (percent-encoded values + opaque properties), OTLP export Content-Type, the gRPC grpc-trace-context-bin 25-byte binary context — plus a two-header correlation round-trip with a random child span-id collision check.

> Canonical page: https://elysiatools.com/en/tools/opentelemetry-w3c-traceparent-tracestate-baggage-and-otlp-protobuf-headers-propagation-validator

- **Category:** Development

- **Keywords:** w3c trace context, traceparent, tracestate, baggage, opentelemetry, otlp headers, grpc-trace-context-bin, trace correlation, distributed tracing, span id

## Overview

traceparent grammar: version(2 HEX)-trace-id(32 lowercase HEX)-parent-id(16 lowercase HEX)-trace-flags(2 HEX); no internal whitespace; trace-id and parent-id MUST NOT be all zero; version ff is reserved-invalid; bit 0 of trace-flags is sampled and version-00 receivers ignore the rest. tracestate is an OWS-","-OWS separated key=value list (≤32 members) with simple (lcalpha-leading) or system-id@tenant keys and opaque values without =/, or whitespace (≤256 printable chars). baggage's first segment is key=value limited to baggage-octets (mandatory percent-encoding outside, stray % sequences are errors); later ;prop segments are opaque properties. OTLP binary Protobuf exports MUST use Content-Type: application/x-protobuf (JSON: application/json); over gRPC grpc-trace-context-bin = base64(trace-id 16B ‖ span-id 8B ‖ flags 1B) — exactly 25 bytes — checked against the traceparent. The correlation round-trip keeps one trace-id across two hops while rotating fresh random 8-byte span-ids (non-zero, never colliding with the parent): a stable trace-id means both contexts join the same distributed trace.

## Inputs

- **traceparent header** (text): 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
- **tracestate header** (text): congo=t61rcWkgMzE,rojo=00f067aa0ba902b7
- **baggage header** (text): userId=alice;serverNode=DF%2028
- **OTLP transport** (select)
- **Export Content-Type** (text): application/x-protobuf
- **grpc-trace-context-bin (base64)** (text): S/kvNXezTaajzpKdDg5HNgDw…
- **Second traceparent (correlation)** (text): 00-4bf92f35…-aabbccddeeff0011-01

## When to use

- Troubleshooting broken distributed traces where downstream child spans fail to correlate with parent requests.
- Verifying custom OpenTelemetry instrumentation, SDK exporters, or HTTP/gRPC middleware headers against W3C specifications.
- Auditing baggage percent-encoding, tracestate list limits, and gRPC 25-byte binary context mappings before deploying telemetry collectors.

## How it works

- Paste your W3C traceparent header alongside optional tracestate and baggage strings.
- Select your OTLP transport protocol (HTTP or gRPC) and enter your export Content-Type or base64 grpc-trace-context-bin value.
- Optionally provide a secondary traceparent header to run a multi-hop correlation check for trace-id stability and child span-id collisions.
- Inspect instant validation output identifying hex format violations, prohibited zero identifiers, encoding defects, and transport mismatches.

## Use cases

- Validating gateway header injection before routing incoming HTTP traffic to downstream microservices.
- Testing custom gRPC interceptors for compliant base64 binary trace context serialization.
- Sanitizing percent-encoded baggage key-value pairs and multi-vendor tracestate strings in collector pipelines.

## Frequently asked questions

### What makes a traceparent header invalid under W3C Trace Context specifications?

A traceparent is invalid if it contains non-hex characters, uppercase letters, incorrect segment lengths, version ff, or all-zero trace and parent IDs.

### How many members are permitted in a W3C tracestate header?

A tracestate header can hold a maximum of 32 comma-separated key=value entries, each with opaque values up to 256 printable characters.

### What format is required for the grpc-trace-context-bin header?

It must decode from base64 to exactly 25 bytes consisting of a 16-byte trace-id, an 8-byte span-id, and a 1-byte trace-flags field.

### Which Content-Type header must be used for OTLP Protobuf over HTTP?

Binary Protobuf exports over HTTP must specify Content-Type: application/x-protobuf, whereas JSON exports require application/json.

### How does the correlation check verify multi-hop trace propagation?

It checks that the 16-byte trace-id remains constant between hops while verifying that the child span-id is non-zero and does not collide with the parent.

## Related tools

- [Hash Algorithm Comparator](https://elysiatools.com/en/tools/hash-algorithm-comparator): Hash the same input with MD5, SHA-1, SHA-256, SHA-512, BLAKE2b, and BLAKE3 at the same time and compare them side by side: output length, hex/Base64 digest, security status (broken / modern), and a relative speed benchmark. Great for teaching, choosing a hashing algorithm, or sanity-checking checksums.
- [PKCE Code Verifier & Challenge Generator](https://elysiatools.com/en/tools/pkce-code-verifier-generator): Generate, validate and verify OAuth2 / OIDC PKCE (RFC 7636) code_verifier and S256 code_challenge pairs. Three modes: (1) generate a fresh verifier + challenge from cryptographically secure random bytes at 256/384/512/768-bit entropy, (2) audit a verifier you already have against the RFC — length (43–128), charset \[A-Za-z0-9-._~\] and ≥256-bit entropy, and (3) verify a verifier/challenge pair by recomputing BASE64URL(SHA256(verifier)). Optionally build the full authorization-request URL and token-exchange body. Complements the generic nonce-generator (which only emits a verifier+challenge pair) with RFC-compliance auditing and pair verification.
- [RSA Encrypt / Decrypt](https://elysiatools.com/en/tools/rsa-encrypt-decrypt): Encrypt text with an RSA public key or decrypt ciphertext with the matching private key, using OAEP padding (SHA-1 or SHA-256). Handles long messages by chunking. Keys and data stay local. PKCS#1 v1.5 is intentionally not offered (Node disables it for decryption due to Bleichenbacher attacks).
- [Data URI Generator](https://elysiatools.com/en/tools/data-uri-generator): Convert files into Data URIs (Base64 or percent-encoded) for inlining images, fonts, and assets directly into HTML, CSS, or Markdown
- [Base64 Converter](https://elysiatools.com/en/tools/base64-converter): Encode and decode data to/from Base64 format with URL-safe options
- [Extended Text Base Codecs (Base65536 + netstring)](https://elysiatools.com/en/tools/extended-text-base-codecs): Encode and decode with less-common text codecs: Base65536 (binary → dense Unicode) and netstring (self-delimiting framing). Base85 is intentionally not rebuilt (already covered).
- [OCR PDF to Structured JSON Bridge](https://elysiatools.com/en/tools/ocr-pdf-to-structured-json-bridge): Extract the PDF text layer with geometry (lines by y-position, tables by column gaps, headings by font size, colon key-value pairs), then fill a user-supplied JSON Schema field by field — labels matched by normalized keys, values coerced to declared types and validated with ajv.
- [Leet Speak Converter](https://elysiatools.com/en/tools/leet-speak-converter): Convert text to and from leet speak (1337). Encode with Basic, Full, or Caps styles, or decode leet back to plain text.

## Samples

- [OpenTelemetry Samples](https://elysiatools.com/en/samples/opentelemetry): OpenTelemetry observability standards examples including instrumentation, tracing, metrics, and logging across multiple languages and frameworks
- [Distributed Tracing Samples](https://elysiatools.com/en/samples/distributed-tracing-samples): Comprehensive distributed tracing examples using Jaeger, OpenTelemetry, and other modern observability tools for microservices architecture
- [Copyright-Free MP3 Audio Samples](https://elysiatools.com/en/samples/mp3-samples): Collection of royalty-free audio samples for testing and development purposes including nature sounds, meditation music, and ambient audio
- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
