pip install opentelemetry-sdk-extension-awsAWS X-Ray IDs Generator
The AWS X-Ray IDs Generator provides a custom IDs Generator to make traces generated using the OpenTelemetry SDKs TracerProvider
compatible with the AWS X-Ray backend service trace ID format.
Configure the OTel SDK TracerProvider with the provided custom IDs Generator to make spans compatible with the AWS X-Ray backend tracing service.
Install the OpenTelemetry SDK package.
pip install opentelemetry-sdk
Next, use the provided AwsXRayIdGenerator
to initialize the TracerProvider
.
import opentelemetry.trace as trace from opentelemetry.sdk.extension.aws.trace import AwsXRayIdGenerator from opentelemetry.sdk.trace import TracerProvider trace.set_tracer_provider( TracerProvider(id_generator=AwsXRayIdGenerator()) )API
Bases: IdGenerator
Generates tracing IDs compatible with the AWS X-Ray tracing service. In the X-Ray system, the first 32 bits of the TraceId
are the Unix epoch time in seconds. Since spans (AWS calls them segments) with an embedded timestamp more than 30 days ago are rejected, a purely random TraceId
risks being rejected by the service.
See: https://docs.aws.amazon.com/xray/latest/devguide/xray-api-sendingdata.html#xray-api-traceids
Get a new span ID.
A 64-bit int for use as a span ID
Get a new trace ID.
Implementations should at least make the 64 least significant bits uniformly random. Samplers like the TraceIdRatioBased sampler rely on this randomness to make sampling decisions.
See the specification on TraceIdRatioBased.
A 128-bit int for use as a trace ID
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4