View Source opentelemetry_xray_id_generator (opentelemetry_xray v0.1.1)

Generate trace_id and span_id compatible with AWS X-Ray.

An X-Ray trace_id consists of three values separated by hyphens. For example, the trace_id {1-5759e988-bd862e3fe1be46a994272793} includes three values: the version number 1, the time of the original request in Unix epoch time, and finally a 96-bit identifier for the trace which is globally unique. OpenTelemetry trace_ids are integers, so we combine the time and the unique id into a single 128-bit value.

X-Ray (sub)segment ID is a 64-bit identifier which is unique within a single trace, and consists of 16 hexadecimal digits.

https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html https://aws-otel.github.io/docs/getting-started/x-ray#configuring-the-aws-x-ray-exporter

Link to this section Summary

Functions

Generates a 64 bit random integer to use as a span id.
Generates a 128 bit random integer to use as a trace id.

Link to this section Functions

-spec generate_span_id() -> opentelemetry:span_id().
Generates a 64 bit random integer to use as a span id.
-spec generate_trace_id() -> opentelemetry:trace_id().
Generates a 128 bit random integer to use as a trace id.