chore(instrumentation): set up instrumentation workspace#194
Conversation
17f2c7a to
78a6876
Compare
|
Suggestion: Use Reason: Datadog isn’t perfectly consistent across dd-trace-*, but the stronger tracer precedent leans instrumentation (dd-trace-go, dd-trace-java, dd-trace-dotnet). There are repos that use integration/Integrations too (dd-trace-rb, dd-trace-php), so this isn’t a hard rule. Still, for tracer code like this, instrumentation reads clearer, and it also matches OpenTelemetry contrib. |
| [workspace] | ||
|
|
||
| [package] | ||
| name = "datadog-aws-sdk" |
There was a problem hiding this comment.
Suggestion: rename datadog-aws-sdk to datadog-aws-instrumentation.
78a6876 to
bf4ea81
Compare
| aws-sdk-eventbridge = "1.102" | ||
| aws-sdk-sns = "1.96" | ||
| aws-sdk-sqs = "1.93" | ||
| aws-smithy-runtime-api = { version = "1.11", features = ["client"] } | ||
| aws-smithy-types = "1.4" |
There was a problem hiding this comment.
These have been upgraded in the meantime that this PR has been open. I think we should bump them to the latest if it doesn't cause any issues before merging
|
The CI is not passing, but this is because the nightly version we are using as it is more than 1 year old... |
paullegranddc
left a comment
There was a problem hiding this comment.
The CI nigthly version has been updated to
| @@ -0,0 +1,1949 @@ | |||
| # This file is automatically @generated by Cargo. | |||
There was a problem hiding this comment.
Same comment for this also I think
d4b18bd to
642bdfd
Compare
…rkspace - Rename integrations/ -> instrumentation/ to align with dd-trace-go/java/dotnet and OpenTelemetry contrib naming conventions - Rename aws-sdk-rust/ -> datadog-aws/ (crate name: datadog-aws) - Rename datadog-lambda-rs/ -> datadog-aws-lambda/ (crate name: datadog-aws-lambda) - Remove per-crate [workspace] stubs; add instrumentation/aws/Cargo.toml as shared workspace (resolver 2, MSRV 1.91.1) - Document scope in datadog-aws: currently supports SQS, SNS, EventBridge
…age metadata
- Replace /integrations/**/target with /instrumentation/**/target in .gitignore
- Add [workspace.dependencies] for shared deps (serde, serde_json, opentelemetry,
opentelemetry_sdk, opentelemetry-semantic-conventions, tracing, tokio)
- Both crates inherit version, edition, license, repository, authors, publish from
[workspace.package]; datadog-aws-lambda keeps its own rust-version (1.85.0)
- Shared deps in both crates use { workspace = true }
- Add comment in lint.yaml explaining instrumentation/ crates are in separate sub-workspaces and not covered by cargo fmt --all above - Update nightly toolchain from nightly-2024-12-16 to nightly-2026-04-07 in instrumentation-rustfmt and instrumentation-clippy CI jobs - Bump AWS SDK deps: aws-sdk-sqs 1.93->1.97.0, aws-sdk-sns 1.96->1.98.0, aws-sdk-eventbridge 1.102->1.104.0 - Remove per-crate Cargo.lock files (datadog-aws, datadog-aws-lambda); workspace Cargo.lock at instrumentation/aws/Cargo.lock is canonical
…o instrumentation/ Move datadog-aws and datadog-aws-lambda crates directly under instrumentation/, removing the intermediate aws/ subdirectory per ygree's suggestion. Update the path dependency in datadog-aws-lambda and adjust CI find depth from mindepth 2 to mindepth 1 to match the new layout.
Replace all instrumentation/aws/ references with instrumentation/ in test-aws-integrations.yaml trigger paths, working-directory, and cache configuration. Update lint.yaml comment and find depth to match the new single-workspace layout.
642bdfd to
61cdac8
Compare
There is now only one workspace under instrumentation/, so the find loop is unnecessary. Use direct cd + cargo calls instead.
…e from test-utils This setter is needed by production consumers like datadog-aws-lambda for serverless flush semantics. Remove the test-utils feature gate so it can be called without pulling in test-only dependencies.
…ous_write from test-utils" This reverts commit 68130fa.
The datadog-aws crate and its per-service crates are introduced in a later PR. Each PR should be responsible for adding its own crates to the workspace members list.
…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>
What does this PR do?
Establishes the
instrumentation/Cargo workspace that houses Datadog AWS instrumentation crates. This is the foundation PR -- #213, #189, and #190 add the implementations on top.Workspace structure