Docs / EventSourcingDB / Errors / tracestate-without-traceparent

tracestate-without-traceparent

An event has a tracestate without a traceparent.

  • Route: write-events
  • Description: tracestate is set without a traceparent
  • Details: event, the place of the event in its list, counting from 0.

Why It Happens#

A tracestate adds vendor-specific data to the trace that a traceparent names, so under W3C Trace Context it cannot stand alone, see Integrating OpenTelemetry. The database reports this error for an event that has a tracestate but leaves out its traceparent, even if the tracestate is empty. It is the last check of an event, so a tracestate that is not valid is reported as tracestate-malformed instead.

A typical cause is a client that always sets both fields from its trace context and sends an empty tracestate where there is no trace.

How to Fix It#

Send a traceparent with every tracestate, or leave out the tracestate where an event has no trace. Sending the same request again fails the same way, since the error depends on the request alone.

Example#

For a write whose first event has the tracestate rojo=00f067aa0ba902b7 but no traceparent, EventSourcingDB answers with this error, as a line of the stream, and then ends the stream with its end item:

{
  "type": "error",
  "data": {
    "code": "https://docs.eventsourcingdb.io/errors/tracestate-without-traceparent",
    "description": "tracestate is set without a traceparent",
    "details": {
      "event": 0
    }
  }
}