Skip to main content

OpenTelemetry Span Builder

Configure an OpenTelemetry span using the form and instantly generate a valid OTLP JSON payload or Python SDK instrumentation code. Set span kind, status, trace IDs, custom attributes, and timed events — all in the browser.

✓ Valid OTLP JSON output ✓ Python SDK code generation ✓ Attributes & span events ✓ Runs 100% in your browser

Frequently Asked Questions

What is an OpenTelemetry span?▼

A span is the fundamental unit of work in OpenTelemetry distributed tracing. It represents a single operation — an HTTP request, a database query, a function call — with a start time, duration, status, and a set of key-value attributes. Spans are grouped into traces by sharing the same Trace ID. A trace forms a directed acyclic graph (DAG) of spans that shows the full path of a request through your system.

What is the difference between a Trace ID and a Span ID?▼

A Trace ID (128-bit / 32 hex chars) uniquely identifies an entire distributed trace — all the spans that belong to the same request journey across services share one Trace ID. A Span ID (64-bit / 16 hex chars) uniquely identifies a single span within that trace. The Parent Span ID links a child span back to its parent, forming the trace hierarchy. Root spans have no Parent Span ID.

What do the different Span Kinds mean?▼

INTERNAL: An internal operation within the same service (e.g., a helper function). SERVER: The span covers a request received by a server (e.g., an HTTP handler). CLIENT: The span covers an outgoing request to a remote service (e.g., an HTTP client call or DB query). PRODUCER: The span covers a message being sent to a queue or messaging system. CONSUMER: The span covers a message being received and processed from a queue. Span Kind affects how tracing UIs display call graphs and calculate latency attribution.

What is OTLP and why is it the standard format?▼

OTLP (OpenTelemetry Protocol) is the native wire format for OpenTelemetry data. It uses Protocol Buffers over gRPC or JSON over HTTP. OTLP is vendor-neutral and supported by all major observability backends: Jaeger, Zipkin, Datadog, Grafana Tempo, Honeycomb, New Relic, AWS X-Ray, and more. Using OTLP means you can switch backends without changing your instrumentation code — just point the exporter at a different endpoint.

What are span attributes and span events?▼

Attributes are key-value pairs attached to a span that describe the context of the operation — e.g., http.method='GET', db.system='postgresql', http.status_code=200. They use semantic conventions defined by the OpenTelemetry specification for consistency across tools. Events are timestamped log-like records attached to a span, useful for marking a specific point in time within the span's duration — e.g., 'cache.hit' or 'payment.validated'. Unlike attributes, events capture something that happened at a specific moment.

What do the span status codes mean?▼

UNSET (0): The default status. The span completed without an explicit status being set — this does not necessarily mean success. OK (1): The operation completed successfully and the developer explicitly marked it as OK. ERROR (2): The operation failed. When set to ERROR, you should also provide an error message. Most backends highlight ERROR spans in red for easy identification. Do not set OK unless you explicitly want to override the default; leave as UNSET for spans where status is not meaningful.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Related Articles

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →