Commit 4e77aa6
feat(datadog-aws-lambda): add root invocation span with OTel tracing (#213)
> **PR Stack:** #194 (workspace setup) -> **#213 (lambda root span)** ->
~~#190~~#219 (lambda inferred spans)
# What does this PR do?
Implements the core Lambda handler wrapper for `datadog-aws-lambda`.
Each invocation is automatically instrumented with an `aws.lambda` root
span carrying cold_start, request_id, function metadata, and error
recording.
This PR intentionally does **not** include trigger extraction or
inferred spans. Those are layered on in ~~#190~~#219 with minimal API
surface changes.
## Usage
```rust
lambda_runtime::run(TracedService::new(my_handler, Config::default())).await
```
## What's included
- **`TracedService`** - `tower::Service` that wraps lambda handler with
OTel tracing
- **`LambdaSpan`** - `aws.lambda` root span with `cold_start`,
`request_id`, `function_arn`, `function_version`, `functionname`,
`_dd.origin=lambda`
- **`Invocation`** - start/handler_context/finish lifecycle with error
recording
- **`Config`** - `service`/`env`/`version` or full
`DatadogTracingBuilder` control
- Lambda-appropriate OTel defaults: synchronous writes, no client-side
stats
# Motivation
This PR establishes the root invocation tracing that ~~#190~~#219 builds
inferred spans on top of.
Ref: #221
---------
Co-authored-by: Yury Gribkov <yury.gribkov@gmail.com>1 parent 3562b41 commit 4e77aa6
5 files changed
Lines changed: 1475 additions & 39 deletions
File tree
- instrumentation
- datadog-aws-lambda
- src
0 commit comments