Repository navigation
Conversation
Pull request dashboard statusWaiting on reviewers · refreshed 2026-11-05 00:45 UTC Review the latest changes. Status above doesn't look right?
|
This comment has been minimized.
This comment has been minimized.
|
/dashboard route:reviewers |
|
@herin049, this pull request was routed to reviewers. The handoff remains active across pushes until newer actionable human feedback arrives. Top-level feedback through this request will not return; unresolved review threads remain open. |
|
Nice work on this. I've built a prototype of the OTEP 4947 thread-context side for Python, including the A few things I learned along the way that may be useful here:
You mention thread-local context as the next native piece... Do you see OTEP 4947 landing in this package or a separate one? I'd rather contribute than ship a parallel package, whichever shape works best. |
Yep, I have unpublished changes that will be submitted in a follow-up once this is merged for TLS. It will require C and will be integrated via |
ivoanjo
left a comment
There was a problem hiding this comment.
👋 Hey folks, I worked on the OTEP/spec, amazing to see this moving forward, thought I'd chime in with two small notes :D
ea0759e to
7bb9763
Compare
This comment has been minimized.
This comment has been minimized.
|
/dashboard route:reviewers |
|
@herin049, this pull request was routed to reviewers. The handoff remains active across pushes until newer actionable human feedback arrives. Top-level feedback through this request will not return; unresolved review threads remain open. |
Description
Relocated from main OpenTelemetry Python repo.
External profilers and observability tools (such as the OpenTelemetry eBPF Profiler) operate outside the instrumented process and have no access to resource attributes configured inside OpenTelemetry SDKs. OTEP-4719 (Process Context Sharing) introduces a standard mechanism for OpenTelemetry SDKs to publish resource attributes for access by out-of-process readers
This PR introduces the
opentelemetry-process-contextpackage as a Rust backed Python extension (built with maturin/pyo3) that implements the process outlined in OTEP-4719. It publishes the SDK's resource attributes toa memory region that any external reader with access to
/proc/<pid>/mapsand/proc/<pid>/memcan discover.Native Code
While a large portion of this logic in this package could be implemented without native code, practically it makes more sense to keep it as native code for the following reasons:
madvise), (although,ctypescould be used)prostRust crate, we eliminate the runtime dependency onprotobufPython API
The introduced Python API has a very light surface area, consisting of two methods to publish and unpublish the process context.
Compatibility
The original OTEP explicitly mentions that this functionality is Linux only. However, I have tried to implement this package in such a way that limited testing/development can be performed natively on any Posix compatible system (e.g. MacOS). However, the full functionality of OTEP-4719 is only available on Linux and Windows is explicitly not supported.
memfd_create("OTEL_CTX")->mmap(MAP_PRIVATE)mmap/proc/<pid>/mapsshowsmemfd:OTEL_CTX/proc)madvise(MADV_DONTFORK)prctl(PR_SET_VMA_ANON_NAME, "OTEL_CTX")CLOCK_BOOTTIMECLOCK_MONOTONICFixes opentelemetry-python#5291
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Does This PR Require a Contrib Repo Change?
Checklist: