---
title: "Bringing application context to full-host eBPF profiling"
description: "OpenTelemetry now has two accepted OTEPs letting full-host eBPF profilers recover application context that out-of-process sampling cannot see."
url: "https://swe.quest/articles/bringing-application-context-to-full-host-ebpf-profiling-89b65dca8d00bd44"
canonical: "https://www.datadoghq.com/blog/engineering/ebpf-profiling-application-context/"
source: "Datadog Engineering"
published: "2026-12-01"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 18
tags: ["observability","linux","performance","concurrency"]
---

# Bringing application context to full-host eBPF profiling

A post on [Datadog Engineering](https://swe.quest/sources/datadog.md), published 2026-12-01, 18 min read, Deep dive. Original: [https://www.datadoghq.com/blog/engineering/ebpf-profiling-application-context/](https://www.datadoghq.com/blog/engineering/ebpf-profiling-application-context/)

## Summary

OpenTelemetry now has two accepted OTEPs letting full-host eBPF profilers recover application context that out-of-process sampling cannot see. Process context (OTEP 4719) publishes resource attributes such as service.name and instance ID as a protobuf payload in a named \`OTEL\_CTX\` memory mapping created via memfd\_create/prctl with MADV\_DONTFORK. Profilers find it through /proc/\<pid\>/maps and read it with process\_vm\_readv, using a seqlock-style update marker for consistent reads. Thread context (OTEP 4947) exposes a compact record of 28 required bytes, usually fitting in one 64-byte cache line, through an ELF TLS symbol \`otel\_thread\_ctx\_v1\`, so span attach/detach costs little more than swapping one thread-local pointer; an initial JNI-based Java path costing ~146 ns per update showed why this mattered.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Concurrency](https://swe.quest/tags/concurrency.md) (Compilers & runtimes)

## Prerequisites

- eBPF basics ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- Linux process memory and /proc ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- OpenTelemetry traces and resources ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))
- thread-local storage

## Keywords

OpenTelemetry, eBPF, OTEP 4719, OTEP 4947, ELF TLS, memfd\_create, process\_vm\_readv, Datadog

## Related posts

- [Making Rust observability reliable at scale with OpenTelemetry](https://swe.quest/articles/making-rust-observability-reliable-at-scale-with-opentelemetry-93edfa18e478ae5a.md): Datadog Engineering · 2026-09-01 · Medium · 10 min read · Observability, Rust, Open source
  Datadog built dd-trace-rs, an opinionated Rust tracer on top of the OpenTelemetry Rust SDK, to fix fragmented traces, inconsistent sampling and context loss across Rust services.
- [Hardening eBPF for runtime security: Lessons from Datadog Workload Protection](https://swe.quest/articles/hardening-ebpf-for-runtime-security-lessons-from-datadog-workload-protection-d7f876ff0025b179.md): Datadog Engineering · 2026-01-07 · Hard · 34 min read · Linux, Threat detection, Security, Operating systems, Performance engineering
  Five years of running Datadog Workload Protection, an eBPF-based runtime security agent supporting kernels from 4.15 to 6.18, distilled into six production lessons.
- [Strobelight: A profiling service built on open source technology](https://swe.quest/articles/strobelight-a-profiling-service-built-on-open-source-technology-6a094fead0e4b62a.md): Meta Engineering · 2025-01-21 · Medium · 12 min read · Performance engineering, Observability, Linux, Cost optimization, Compilers
  Strobelight is Meta's fleet-wide profiling orchestrator, running 42 profilers (mostly eBPF-based, plus ad-hoc bpftrace scripts) on every production host with safeguards against PMU counter conflicts, concurrency limits and queuing.
- [Scaling real-time file monitoring with eBPF: How we filtered billions of kernel events per minute](https://swe.quest/articles/scaling-real-time-file-monitoring-with-ebpf-how-we-filtered-billions-of-kernel-2f88f92ad0613fab.md): Datadog Engineering · 2025-11-18 · Medium · 9 min read · Linux, Threat detection, Performance engineering, Scaling
  Datadog built file integrity monitoring on eBPF to capture file changes with process and container context, which periodic scans, inotify and auditd could not provide at scale.
- [Client Tracing: Understanding Mobile and Desktop Application Performance at Scale](https://swe.quest/articles/client-tracing-understanding-mobile-and-desktop-application-performance-at-scale-21a4a4d3c10c520b.md): Slack Engineering · 2021-03-24 · Medium · 17 min read · Observability, Mobile, Performance engineering, SQLite
  Slack extended its backend distributed tracing to iOS, Android and JavaScript clients so engineers could pinpoint why client actions like channel switches are slow.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
