Traceparent

Generates a W3C Trace Context traceparent header value.

Volvo APIs support the traceparent header for distributed tracing. Include it in RequestOptions.headers to correlate requests across systems.

Format: {version}-{trace-id}-{parent-id}-{trace-flags}

  • version: 00 (current spec version)

  • trace-id: 32 hex characters (128-bit random)

  • parent-id: 16 hex characters (64-bit random)

  • trace-flags: 01 (sampled)

val traceparent = Traceparent.generate()
client.getVehicleList(
requestOptions = RequestOptions(
headers = mapOf("traceparent" to traceparent.value)
)
)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The 64-bit parent span ID as 16 hex characters

Link copied to clipboard

The 128-bit trace ID as 32 hex characters

Link copied to clipboard

The full traceparent header string

Functions

Link copied to clipboard
open override fun toString(): String