Skip to content

Commit 9bd8dd1

Browse files
committed
Note macos/win behavior is not standardized
1 parent f5eccae commit 9bd8dd1

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

libdd-library-config/src/otel_process_ctx.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
//! Implementation of the [OTEL process
5-
//! context specification](https://github.com/open-telemetry/opentelemetry-specification/pull/4719).
5+
//! context specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/oteps/profiles/4719-process-ctx.md).
6+
//!
7+
//! Note: the Linux implementation follows the discovery method described in the OTEL process
8+
//! specification linked above, that is, uses a memfd or a named mapping with the name OTEL_CTX.
9+
//! This is a strategy only viable on Linux, since MacOS and Windows do not have those exact
10+
//! features. Here, the MacOS and Windows implementations, on the other hand, use a global atomic
11+
//! pointer to the mapping header that is published as a symbol named `otel_process_ctx_v2`.
12+
//! SUCH MECHANISM IS NOT PART OF THE SPECIFICATION, which deals only with Linux.
613
//!
714
//! The update/read protocol is seqlock-style: the publisher marks the mapping as unavailable,
815
//! writes the payload metadata, publishes a non-zero version, and readers accept a copy only if

libdd-library-config/src/otel_process_ctx/writer/macos.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Copyright 2026-Present Datadog, Inc. https://www.datadoghq.com/
22
// SPDX-License-Identifier: Apache-2.0
33

4+
//! Implements the publication strategy for MacOS.
5+
//! This is not part of the OTEL process context specification, which deals only with Linux.
6+
47
use core::{
58
ffi::c_void,
69
mem::forget,

libdd-library-config/src/otel_process_ctx/writer/windows.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Copyright 2026-Present Datadog, Inc. https://www.datadoghq.com/
22
// SPDX-License-Identifier: Apache-2.0
33

4+
//! Implements the publication strategy for Windows.
5+
//! This is not part of the OTEL process context specification, which deals only with Linux.
6+
47
use core::{
58
ptr::{self, NonNull},
69
sync::atomic::{fence, AtomicPtr, AtomicU32, AtomicU64, Ordering},

0 commit comments

Comments
 (0)