1001Ferramentas
📊Dev

OpenTelemetry Span JSON Generator

Produce an OpenTelemetry span as JSON with a 32-hex traceId and a 16-hex spanId from the crypto random source, or keep a valid traceId you paste in.

YAML

An OpenTelemetry span with valid identifiers

A span records one operation inside a distributed trace: it carries a name, an identifier of its own, the identifier of the trace it belongs to, a kind and an outcome. Chained by the same trace identifier, spans reconstruct a request's path across several services — which is the whole reason distributed instrumentation exists.

Fill in the name and, if you already have one, the trace identifier, and the page assembles the span as JSON. The sizes are not negotiable: the trace identifier is 16 bytes, or 32 hexadecimal digits, and the span identifier is 8 bytes, or 16 digits. An identifier of the wrong length is dropped by the collector, and an all-zero identifier is explicitly invalid in the specification.

The natural use is assembling an example to test a collector or an exporter configuration without instrumenting a whole application. Worth noting what a minimal span leaves out: the start and end timestamps, the attributes, the events and the parent span identifier — the last of which forms the tree. A span with no parent is the root of the trace.

Frequently asked questions

Can I reuse the same trace identifier?
You should, and that is the point: every span of the same request shares the trace identifier and differs by its own. That link is what builds the timeline. What must not repeat is the span identifier within the same trace.
How does the identifier travel between services?
Through the trace context header standardised by the W3C, carrying the version, the trace identifier, the parent span identifier and the flags, all hyphen-separated. That header is what carries the trace across service boundaries without either side knowing the other.
What does the span kind mean?
It states the operation's role: server, for whoever handled the request; client, for whoever made it; producer and consumer, for messaging; and internal, for work that crosses no boundary. Visualisation tools use it to draw the relationship between services.

Related Tools