Skip to content

Commit 5c20f4e

Browse files
committed
OTEP: correlating OBI traces to profiles
Signed-off-by: Mattia Meleleo <mattia.meleleo@coralogix.com>
1 parent 1d34b31 commit 5c20f4e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Correlating Profiles to OBI Traces
2+
3+
This OTEP introduces a standard communication channel and a specification for correlating profiles to [opentelemetry-ebpf-instrumentation (OBI)](https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation) traces.
4+
5+
<!-- toc -->
6+
* [Motivation](#motivation)
7+
* [Design Notes](#design-notes)
8+
* [Communication Channel](#communication-channel)
9+
* [Data Model](#data-model)
10+
<!-- toc -->
11+
12+
## Motivation
13+
14+
Currently, OBI traces and profiles operate independently, making it difficult to attribute profiling data to specific traces or spans. By establishing a standard kernel-resident communication channel, this OTEP enables:
15+
16+
- Correlating profiles with their corresponding traces or spans
17+
- End-to-end observability workflows without requiring application-level instrumentation
18+
19+
## Design Notes
20+
21+
### Communication Channel
22+
23+
The communication channel between OBI and the profiler is implemented via an eBPF map pinned at `/sys/fs/bpf/obi_ctx`.
24+
25+
For both programs to access the map, the `/sys/fs/bpf` filesystem (bpffs) must be mounted and accessible.
26+
27+
### Data Model
28+
29+
As described in the [Profiles Data Model](./0239-profiles-data-model.md), the shared eBPF map uses a minimal structure to store correlation data:
30+
31+
- **Key:** `(u64)pid_tgid`
32+
- **Value:**
33+
34+
```c
35+
struct trace_context {
36+
u8 trace_id[16];
37+
u8 span_id[8];
38+
};

0 commit comments

Comments
 (0)