
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
opentelemetry-sdk-extension-aws
Advanced tools
|pypi|
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-sdk-extension-aws.svg :target: https://pypi.org/project/opentelemetry-sdk-extension-aws/
This library provides components necessary to configure the OpenTelemetry SDK for tracing with AWS X-Ray.
::
pip install opentelemetry-sdk-extension-aws
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
.
.. code-block:: python
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())
)
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
:
.. code-block:: python
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.
OpenTelemetry Project <https://opentelemetry.io/>
_AWS X-Ray Trace IDs Format <https://docs.aws.amazon.com/xray/latest/devguide/xray-api-sendingdata.html#xray-api-traceids>
_OpenTelemetry Specification for Resource Attributes <https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/resource/semantic_conventions>
_FAQs
AWS SDK extension for OpenTelemetry
We found that opentelemetry-sdk-extension-aws demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.