Expand description
AWS Lambda Extension for OpenTelemetry signal collection and export.
This extension integrates with the AWS Lambda Extensions API (via the
lambda_extension crate) to collect OpenTelemetry traces, metrics, and
logs from Lambda functions and export them to configured backends.
§Example
use opentelemetry_lambda_extension::{Config, RuntimeBuilder};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = Config::load()?;
let runtime = RuntimeBuilder::new().config(config).build();
runtime.run().await?;
Ok(())
}Re-exports§
pub use aggregator::BatchedSignal;pub use aggregator::SignalAggregator;pub use config::Compression;pub use config::Config;pub use config::CorrelationConfig;pub use config::ExporterConfig;pub use config::FlushConfig;pub use config::FlushStrategy;pub use config::Protocol;pub use config::ReceiverConfig;pub use config::TelemetryApiConfig;pub use context::InvocationContextManager;pub use context::PlatformEvent;pub use context::PlatformEventType;pub use context::RequestId;pub use context::SpanContext;pub use conversion::MetricsConverter;pub use conversion::SpanConverter;pub use conversion::TelemetryProcessor;pub use error::ExtensionError;pub use error::Result;pub use exporter::ExportError;pub use exporter::ExportResult;pub use exporter::OtlpExporter;pub use flush::FlushManager;pub use flush::FlushReason;pub use receiver::FlushError;pub use receiver::HealthResponse;pub use receiver::OtlpReceiver;pub use receiver::ReceiverHandle;pub use receiver::Signal;pub use resource::ResourceBuilder;pub use resource::detect_resource;pub use runtime::ExtensionRuntime;pub use runtime::RuntimeBuilder;pub use runtime::RuntimeError;pub use service::EventsService;pub use service::ExtensionState;pub use service::TelemetryService;pub use telemetry::ReportMetrics;pub use telemetry::ReportRecord;pub use telemetry::RuntimeDoneRecord;pub use telemetry::StartRecord;pub use telemetry::TelemetryError;pub use telemetry::TelemetryEvent;pub use telemetry::TelemetryListener;pub use telemetry::TelemetrySubscription;pub use telemetry::TelemetryType;pub use tracing::W3CTraceContext;pub use tracing::XRayTraceHeader;
Modules§
- aggregator
- Signal aggregation and batching.
- config
- Configuration loading and management.
- context
- Invocation context management for span correlation.
- conversion
- Platform event to OTLP signal conversion.
- error
- Error types for the Lambda OTel extension.
- exporter
- OTLP signal exporter with retry and fallback.
- flush
- Adaptive flush management.
- receiver
- OTLP receiver for collecting signals from Lambda functions.
- resource
- Lambda resource attribute detection.
- runtime
- Extension runtime orchestrator.
- service
- Tower services for Lambda extension lifecycle and telemetry processing.
- telemetry
- Telemetry API client and listener.
- tracing
- X-Ray trace header parsing and W3C trace context conversion.
Structs§
- Otel
Guard - Guard that manages OpenTelemetry provider lifecycle.
- Otel
SdkBuilder - Builder for configuring and initialising the OpenTelemetry SDK.
- Otel
SdkConfig - Complete OpenTelemetry SDK configuration.
Enums§
- Otel
Protocol - OTLP export protocol.
- SdkError
- Errors from SDK initialisation and lifecycle.