Expand description
This module provides utilities for configuring and building an OpenTelemetry TracerProvider specifically tailored for use in AWS Lambda environments.
It includes:
HttpTracerProviderBuilder: A builder struct for configuring and initializing a TracerProvider.get_lambda_resource: A function to create a Resource with Lambda-specific attributes.
The module supports various configuration options, including:
- Custom HTTP clients for exporting traces
- Enabling/disabling logging layers
- Setting custom tracer names
- Configuring propagators and ID generators
- Choosing between simple and batch exporters
It also respects environment variables for certain configurations, such as the span processor type and the OTLP exporter protocol.
§Examples
use lambda_otel_utils::HttpTracerProviderBuilder;
use opentelemetry_sdk::trace::{TracerProvider, Tracer};
let tracer_provider: TracerProvider = HttpTracerProviderBuilder::default()
.with_stdout_client()
.with_default_text_map_propagator()
.with_default_id_generator()
.enable_global(true)
.build()?;Structs§
- Http
Tracer Provider Builder - A type-safe builder for configuring and initializing a TracerProvider.