1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Lambda support: Tower layer, per-invocation spans, and the
//! `make_lambda_runtime!` macro (`env-lambda` feature).
//!
//! This module re-exports the most commonly used Lambda types and provides
//! the [`make_lambda_runtime!`] macro for zero-boilerplate Lambda setup.
//!
//! ## Sub-modules
//!
//! - [`layer`] — [`layer::TracingLayer`] and [`layer::TracingService`]: Tower
//! middleware that wraps the Lambda runtime service, creates a span per
//! invocation, propagates the X-Ray trace context, tracks cold-starts, and
//! flushes the exporter when the invocation future drops.
//! - [`macros`] — [`make_lambda_runtime!`] and its helper
//! [`macros::default_flush_tracer`].
//!
//! ## Re-exports
//!
//! - [`lambda_runtime`] — the underlying Lambda runtime crate, available so
//! that users do not need to add it as a direct dependency.
//! - [`LambdaError`] / [`LambdaEvent`] — convenience aliases for
//! `lambda_runtime::Error` and `lambda_runtime::LambdaEvent`.
//! - [`OTelFaasTrigger`] — re-exported from [`layer`] for convenience.
//!
//! Note: `tokio` is *not* re-exported. The `#[tokio::main]` attribute used
//! inside [`make_lambda_runtime!`] resolves the `tokio` crate by its absolute
//! path, so users must declare `tokio` as a direct dependency. Rust Lambda
//! functions need `tokio` anyway.
//!
//! ## Quick example
//!
//! ```no_run
//! use awssdk_instrumentation::lambda::{LambdaError, LambdaEvent};
//! use serde_json::Value;
//!
//! async fn handler(event: LambdaEvent<Value>) -> Result<Value, LambdaError> {
//! Ok(event.payload)
//! }
//!
//! // Generates main(), telemetry init, and the Tower layer.
//! awssdk_instrumentation::make_lambda_runtime!(handler);
//! ```
//!
//! [`make_lambda_runtime!`]: crate::make_lambda_runtime
// Lambda support module — Tower layer and make_lambda_runtime! macro.
pub use OTelFaasTrigger;
pub use lambda_runtime;
pub use ;