Expand description

This crate provides unofficial integration with AWS services.


As for now, the only components provided in this crate is AWS X-Ray propagator.

AWS X-Ray Propagator

This propagator helps propagate tracing information from upstream services to downstream services.

Quick start

use opentelemetry::{global, trace::{Tracer, TracerProvider as _}};
use opentelemetry_aws::trace::XrayPropagator;
use opentelemetry_sdk::trace::TracerProvider;
use opentelemetry_stdout::SpanExporter;
use opentelemetry_http::HeaderInjector;

async fn main() -> std::result::Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
    // Set the global propagator to X-Ray propagator
    let provider = TracerProvider::builder()
    let tracer = provider.tracer("readme_example");

    let mut req = hyper::Request::builder().uri("");
    tracer.in_span("doing_work", |cx| {
        // Send request to downstream services.
        // Build request
        global::get_text_map_propagator(|propagator| {
            // Set X-Ray tracing header in request object `req`
            propagator.inject_context(&cx, &mut HeaderInjector(req.headers_mut().unwrap()));
            println!("Headers: {:?}", req.headers_ref());


A more detailed example can be found in opentelemetry-rust repo