Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions instrumentation/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions instrumentation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ publish = false

[workspace.dependencies]
datadog-aws-core = { path = "datadog-aws-core" }
libdd-trace-inferrer = { git = "https://github.com/DataDog/libdatadog", branch = "david.ogbureke/libdd-trace-inferrer" }
serde = "1.0.194"
serde_json = "1.0.140"
opentelemetry = { version = "0.31.0", features = ["trace", "metrics", "logs"], default-features = false }
Expand Down
7 changes: 3 additions & 4 deletions instrumentation/datadog-aws-core/src/interceptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
//! [`Intercept`] trait. For each request it:
//! 1. Creates a Datadog client span with base + service-specific tags
//! (`modify_before_serialization`).
//! 2. Injects propagation headers into the outbound request payload via the
//! [`ServiceHandler`] implementation (`modify_before_serialization`).
//! 2. Injects propagation headers into the outbound request payload via the [`ServiceHandler`]
//! implementation (`modify_before_serialization`).
//! 3. Adds HTTP-level tags once the final request is known (`read_before_transmit`).
//! 4. Records the response status and any error, then ends the span
//! (`read_after_execution`).
//! 4. Records the response status and any error, then ends the span (`read_after_execution`).
//!
//! The [`SpanContext`] type ferries the active OTel [`Context`] through the
//! SDK's [`ConfigBag`] between hooks.
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/datadog-aws-lambda/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[package]
name = "datadog-aws-lambda"
description = "Datadog distributed tracing for AWS Lambda."
description = "Datadog distributed tracing for AWS Lambda. Provides inferred spans and trace context extraction for SQS, SNS, EventBridge, API Gateway (REST and HTTP APIs), and Lambda Function URLs."
version.workspace = true
edition.workspace = true
rust-version = "1.85.0"
Expand All @@ -13,11 +13,13 @@ authors.workspace = true
publish.workspace = true

[dependencies]
libdd-trace-inferrer = { workspace = true }
datadog-opentelemetry = { version = "0.3", path = "../../datadog-opentelemetry", features = ["test-utils"] }
lambda_runtime = "0.13"
serde = { workspace = true }
serde_json = { workspace = true, features = ["raw_value"] }
opentelemetry = { workspace = true }
opentelemetry-semantic-conventions = { workspace = true }
opentelemetry_sdk = { workspace = true, features = ["trace", "metrics", "logs"] }
tracing = { workspace = true }

Expand Down
8 changes: 8 additions & 0 deletions instrumentation/datadog-aws-lambda/src/attribute_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// SPDX-License-Identifier: Apache-2.0

pub(crate) const OPERATION_NAME: &str = "operation.name";
// `operation_name` duplicates `operation.name` as a custom attribute
pub(crate) const OPERATION_NAME_CUSTOM: &str = "operation_name";
pub(crate) const RESOURCE_NAME: &str = "resource.name";
pub(crate) const SPAN_TYPE: &str = "span.type";
pub(crate) const ERROR: &str = "error";
Expand All @@ -11,8 +13,14 @@ pub(crate) const ERROR_MESSAGE: &str = "error.message";
pub(crate) const LANGUAGE: &str = "language";
pub(crate) const REQUEST_ID: &str = "request_id";
pub(crate) const COLD_START: &str = "cold_start";
pub(crate) const ASYNC_INVOCATION: &str = "async_invocation";
pub(crate) const FUNCTION_ARN: &str = "function_arn";
pub(crate) const FUNCTION_VERSION: &str = "function_version";
pub(crate) const FUNCTION_NAME: &str = "functionname";
pub(crate) const RESOURCE_NAMES: &str = "resource_names";
pub(crate) const DD_ORIGIN: &str = "_dd.origin";
pub(crate) const FUNCTION_TRIGGER_EVENT_SOURCE: &str = "function_trigger.event_source";
pub(crate) const FUNCTION_TRIGGER_EVENT_SOURCE_ARN: &str = "function_trigger.event_source_arn";

// OpenTelemetry semantic convention keys
pub(crate) use opentelemetry_semantic_conventions::attribute::{PEER_SERVICE, SERVICE_NAME};
Loading
Loading