{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "#/components/schemas/Span", "title": "Span", "type": "object", "description": "Represents a single operation within a trace. Spans have a name, start and end time, and attributes describing the operation.", "properties": { "traceId": { "type": "string", "description": "The trace identifier, a 32-character hex string shared by all spans in the same trace." }, "spanId": { "type": "string", "description": "The span identifier, a 16-character hex string unique to this span." }, "parentSpanId": { "type": "string", "description": "The span identifier of the parent span. Empty for root spans." }, "name": { "type": "string", "description": "A descriptive name for the operation (e.g., HTTP GET /api/users)." }, "kind": { "type": "integer", "description": "The span kind indicating the relationship between the span and its parent. 0=Unspecified, 1=Internal, 2=Server, 3=Client, 4=Producer, 5=Consumer.", "enum": [ 0, 1, 2, 3, 4, 5 ] }, "startTimeUnixNano": { "type": "string", "description": "The start time of the span in nanoseconds since Unix epoch." }, "endTimeUnixNano": { "type": "string", "description": "The end time of the span in nanoseconds since Unix epoch." }, "attributes": { "type": "array", "description": "Key-value attributes describing the span's operation.", "items": { "$ref": "#/components/schemas/KeyValue" } }, "status": { "type": "object", "description": "The status of the span operation.", "properties": { "code": { "type": "integer", "description": "The status code. 0=Unset, 1=Ok, 2=Error.", "enum": [ 0, 1, 2 ] }, "message": { "type": "string", "description": "An optional status message." } } }, "events": { "type": "array", "description": "Time-stamped events that occurred during the span.", "items": { "type": "object", "properties": { "timeUnixNano": { "type": "string", "description": "The event time in nanoseconds since Unix epoch." }, "name": { "type": "string", "description": "The event name." }, "attributes": { "type": "array", "description": "Key-value attributes for the event.", "items": { "$ref": "#/components/schemas/KeyValue" } } } } } } }