Skip to content

[PoC][OTEP 4719] Add processcontext enrichement#1914

Draft
florianl wants to merge 1 commit intoopen-telemetry:mainfrom
florianl:otep-4719
Draft

[PoC][OTEP 4719] Add processcontext enrichement#1914
florianl wants to merge 1 commit intoopen-telemetry:mainfrom
florianl:otep-4719

Conversation

@florianl
Copy link
Copy Markdown
Member

Implement OTEP 4719 to enable sharing of process context information with external readers. This allows services to export resource attributes and metadata via the OTEL_CTX environment mapping without direct instrumentation.

The ProcessContextDecorator enriches discovered processes by:

  • Locating the OTEL_CTX mapping in /proc//maps
  • Reading process context information from remote memory
  • Merging resource attributes into service metadata

This is a proof-of-concept with known limitations:

For testing, use the reference implementation at:
https://github.com/open-telemetry/sig-profiling/tree/main/process-context/c-and-cpp

See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/oteps/profiles/4719-process-ctx.md

Summary

Describe the change briefly.

Validation

Implement OTEP 4719 to enable sharing of process context information with
external readers. This allows services to export resource attributes and
metadata via the OTEL_CTX environment mapping without direct instrumentation.

The ProcessContextDecorator enriches discovered processes by:
- Locating the OTEL_CTX mapping in /proc/<pid>/maps
- Reading process context information from remote memory
- Merging resource attributes into service metadata

This is a proof-of-concept with known limitations:
- cilium/ebpf upgraded to v0.21.0 to resolve dependency conflicts
- Process context proto definitions pending merge:
  open-telemetry/opentelemetry-proto#783
- No SDK implementations of OTEP 4719 yet available

For testing, use the reference implementation at:
https://github.com/open-telemetry/sig-profiling/tree/main/process-context/c-and-cpp

See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/oteps/profiles/4719-process-ctx.md

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 40.21739% with 55 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.64%. Comparing base (90dfd44) to head (2951198).

Files with missing lines Patch % Lines
pkg/appolly/discover/processcontext_decorator.go 36.78% 53 Missing and 2 partials ⚠️

❗ There is a different number of reports uploaded between BASE (90dfd44) and HEAD (2951198). Click for more details.

HEAD has 21 uploads less than BASE
Flag BASE (90dfd44) HEAD (2951198)
unittests 4 1
integration-test-arm 4 3
oats-test 7 5
integration-test-vm-x86_64-5.15.152 4 0
integration-test-vm-x86_64-6.10.6 4 0
integration-test 10 3
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1914       +/-   ##
===========================================
- Coverage   69.26%   52.64%   -16.63%     
===========================================
  Files         279      271        -8     
  Lines       34283    33669      -614     
===========================================
- Hits        23747    17725     -6022     
- Misses       9268    14479     +5211     
- Partials     1268     1465      +197     
Flag Coverage Δ
integration-test 42.81% <42.25%> (-13.36%) ⬇️
integration-test-arm 28.47% <40.21%> (-0.05%) ⬇️
integration-test-vm-x86_64-5.15.152 ?
integration-test-vm-x86_64-6.10.6 ?
k8s-integration-test 42.86% <42.25%> (+0.59%) ⬆️
oats-test 31.37% <42.25%> (-6.99%) ⬇️
unittests 22.50% <ø> (-36.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

CI Supervisor

Workflow Job Last state Re-running? Attempt
Pull request checks Generate and checks failure No 2/2
Pull request integration tests ARM shard-1 (1 tests) failure No 2/2
PR OATS test http failure No 2/2
PR OATS test sql failure No 2/2
Pull request integration tests shard-1 (11 tests) failure No 2/2
Pull request integration tests shard-5 (11 tests) failure No 2/2
Pull request integration tests shard-0 (10 tests) failure No 2/2
Pull request integration tests shard-2 (11 tests) failure No 2/2
Pull request integration tests shard-8 (11 tests) failure No 2/2
Pull request integration tests shard-3 (11 tests) failure No 2/2
Pull request integration tests shard-6 (10 tests) failure No 2/2

@NimrodAvni78
Copy link
Copy Markdown
Contributor

This is a great idea!
I you think this can help us (once sdks start implementing this) with detecting if a service is instrumented to avoid double instrumentation (we currently rely on detecting http/grpc exporting telemetry)
can we know from this some information like which instrumentations are registered? or only if a process is instrumented or not and its resource attributes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants