A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://opentelemetry-python-contrib.readthedocs.io/en/latest/sdk-extension/aws/aws.html below:

Website Navigation


OpenTelemetry Python - AWS SDK Extension — OpenTelemetry Python Contrib documentation

OpenTelemetry Python - AWS SDK Extension Installation
pip install opentelemetry-sdk-extension-aws
AWS 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.

Usage

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
class opentelemetry.sdk.extension.aws.trace.aws_xray_id_generator.AwsXRayIdGenerator[source]

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

random_id_generator = <opentelemetry.sdk.trace.id_generator.RandomIdGenerator object>
generate_span_id()[source]

Get a new span ID.

Return type:

int

Returns:

A 64-bit int for use as a span ID

generate_trace_id()[source]

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.

Return type:

int

Returns:

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