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
2 changes: 1 addition & 1 deletion libdd-library-config-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bench = false
[dependencies]
libdd-common = { path = "../libdd-common" }
libdd-common-ffi = { path = "../libdd-common-ffi", default-features = false }
libdd-library-config = { path = "../libdd-library-config" }
libdd-library-config = { path = "../libdd-library-config", default-features = false, features = ["process-context-writer"] }
anyhow = "1.0"
constcat = "0.4.1"

Expand Down
5 changes: 4 additions & 1 deletion libdd-library-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ crate-type = ["lib"]
bench = false

[features]
otel-thread-ctx = []
default = ["process-context-reader", "process-context-writer"]
otel-thread-ctx = ["process-context-writer"]
process-context-reader = []
process-context-writer = []

[dependencies]
serde = { version = "1.0", features = ["derive"] }
Expand Down
4 changes: 4 additions & 0 deletions libdd-library-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// SPDX-License-Identifier: Apache-2.0
extern crate alloc;

#[cfg(all(
target_os = "linux",
any(feature = "process-context-reader", feature = "process-context-writer")
))]
pub mod otel_process_ctx;
pub mod tracer_metadata;

Expand Down
834 changes: 192 additions & 642 deletions libdd-library-config/src/otel_process_ctx.rs

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions libdd-library-config/src/otel_process_ctx/linux.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2026-Present Datadog, Inc. https://www.datadoghq.com/
// SPDX-License-Identifier: Apache-2.0

use core::ffi::CStr;

#[cfg(feature = "process-context-reader")]
pub mod self_reader {
pub use crate::otel_process_ctx::ProcessContextSelfReader;
}

// Re-exported for backwards compatibility.
#[cfg(feature = "process-context-writer")]
#[deprecated(note = "use libdd_library_config::otel_process_ctx directly")]
pub use super::{publish, unpublish};
#[deprecated(note = "use libdd_library_config::otel_process_ctx directly")]
pub use super::{PROCESS_CTX_VERSION, SIGNATURE};
#[cfg(feature = "process-context-reader")]
#[deprecated(note = "use libdd_library_config::otel_process_ctx::ProcessContextSelfReader")]
pub use self_reader::ProcessContextSelfReader;

/// The discoverable name of the memory mapping.
pub const MAPPING_NAME: &CStr = c"OTEL_CTX";
Loading
Loading