Skip to main content

AWS SDK extension for OpenTelemetry

Project description

pypi

This library provides components necessary to configure the OpenTelemetry SDK for tracing with AWS X-Ray.

Installation

pip install opentelemetry-sdk-extension-aws

Usage (AWS X-Ray IDs Generator)

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())
)

Usage (AWS Resource Detectors)

Use the provided Resource Detectors to automatically populate attributes under the resource namespace of each generated span.

For example, if tracing with OpenTelemetry on an AWS EC2 instance, you can automatically populate resource attributes by creating a TraceProvider using the AwsEc2ResourceDetector:

import opentelemetry.trace as trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.extension.aws.resource.ec2 import (
    AwsEc2ResourceDetector,
)
from opentelemetry.sdk.resources import get_aggregated_resources

trace.set_tracer_provider(
    TracerProvider(
        resource=get_aggregated_resources(
            [
                AwsEc2ResourceDetector(),
            ]
        ),
    )
)

Refer to each detectors’ docstring to determine any possible requirements for that detector.

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opentelemetry-sdk-extension-aws-2.0.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file opentelemetry-sdk-extension-aws-2.0.0.tar.gz.

File metadata

  • Download URL: opentelemetry-sdk-extension-aws-2.0.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for opentelemetry-sdk-extension-aws-2.0.0.tar.gz
Algorithm Hash digest
SHA256 c46431857b0b785d9be33c39f43d4cdb93407d17cbaa367320441229e0310a91
MD5 937a3daa10f5699f631fd465092971f0
BLAKE2b-256 f87c9d62afddd54a8d260202af822005b66b3732045f8a40db838a587bbada52

See more details on using hashes here.

File details

Details for the file opentelemetry_sdk_extension_aws-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: opentelemetry_sdk_extension_aws-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for opentelemetry_sdk_extension_aws-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22c42903326f5a8be045763dcc4de191924247783a2413b35e81ab9d30204cdc
MD5 180b36f83dc55a13b0fbf7bc90a01a38
BLAKE2b-256 c01504cde6f3ce94e1f4adb4e412828aa83710cc20df602e8dd5a9f7d5aeb909

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page