OpenTelemetry AWS

| Status | |
|---|---|
| Stability | beta |
| Owners | Jonathan Lee, Chinmay Chahar |
Additional types for exporting OpenTelemetry data to AWS.
Overview
OpenTelemetry is a collection of tools, APIs, and SDKs used to instrument,
generate, collect, and export telemetry data (metrics, logs, and traces) for
analysis in order to understand your software's performance and behavior. This
crate provides additional propagators and exporters for sending telemetry data
to AWS's telemetry platform.
Components
| Component | Feature | Description |
|---|---|---|
| X-Ray Propagator | trace |
Propagates trace context using the X-Amzn-Trace-Id header |
| X-Ray ID Generator | trace |
Generates X-Ray-compatible trace and span IDs (time-based trace IDs) |
| X-Ray Exporter | xray-exporter |
Exports OpenTelemetry spans as X-Ray segment documents |
| Lambda Resource Detector | detector-aws-lambda |
Detects AWS Lambda resource attributes from the environment |
| EC2 Resource Detector | detector-aws-ec2 |
Detects AWS EC2 resource attributes via IMDSv2 |
| ECS Resource Detector | detector-aws-ecs |
Detects AWS ECS resource attributes via the task and container metadata endpoints |
| EKS Resource Detector | detector-aws-eks |
Detects AWS EKS resource attributes via the Kubernetes service-account mount and IMDSv2 |
Quick Start
Basic setup forwarding Segments to the local X-Ray daemon (requires xray-daemon-client feature):
use ;
use SdkTracerProvider;
use global;
Feature Flags
| Feature | Default | Description |
|---|---|---|
trace |
Yes | X-Ray propagator and ID generator |
internal-logs |
Yes | Internal instrumentation via the tracing crate |
xray-exporter |
No | X-Ray span exporter with SegmentTranslator and SegmentDocumentExporter trait |
xray-daemon-client |
No | XrayDaemonClient — UDP client for the X-Ray daemon |
xray-stdout-client |
No | StdoutClient — writes segment documents to stdout (useful for debugging) |
xray-subsegment-nesting |
No | Enables subsegment nesting within parent segments during translation |
detector-aws-lambda |
No | AWS Lambda resource detector |
detector-aws-ec2 |
No | AWS EC2 resource detector |
detector-aws-ecs |
No | AWS ECS resource detector |
detector-aws-eks |
No | AWS EKS resource detector |