$ show open-telemetry/opentelemetry-ebpf-instrumentation
This repository implements OpenTelemetry eBPF Instrumentation (OBI), a production-grade observability agent that uses eBPF to automatically capture distributed traces, metrics, and logs from user-space applications without any code changes. It supports a wide range of protocols (HTTP/1.1, HTTP/2, gRPC, SQL, Redis, Kafka, MongoDB, AMQP, MQTT, DNS, and more) and multiple language runtimes (Go, Java, Python, Node.js, Ruby, .NET, Rust). The agent can run as a standalone binary, a Docker container, or an OpenTelemetry Collector receiver. Its architecture consists of eBPF programs (kprobes, uprobes, tracepoints, TC) that emit events to ring buffers, which are read by Go userspace tracers and processed through a pipeline of discovery, decoration, filtering, and export stages. Telemetry is exported via OTLP (gRPC/HTTP) or Prometheus, with optional Kubernetes metadata enrichment and network flow monitoring. The codebase is well-structured with clear separation of concerns, extensive integration tests, and several reusable generic components (message queues, pipeline runners, expiry caches, attribute filters). It is actively maintained with frequent commits and comprehensive CI/CD.
The LLM identified 5 files worth highlighting for reuse:
A generic, typed message queue for pipeline stages. Provides bounded buffering, timeout-based blocking, and graceful shutdown. Can be extracted and reused in any Go pipeline or streaming application that needs decoupled stage communication.
A generic pipeline runner that manages the lifecycle of processing stages (RunFunc). Supports cancellation, timeout, and bypass (no-op) nodes. Demonstrates a clean pattern for composing concurrent processing pipelines that can be reused in other data processing or ETL systems.
A generic TTL-based expiry map for metric instances. Uses a background goroutine to evict stale entries. The pattern is reusable for any time-based cache eviction scenario, such as session management, rate limiting, or temporary data storage.
A configurable attribute filter that supports glob patterns and numeric comparisons (e.g., 'http.status_code >= 400'). Used to filter spans and metrics in the pipeline. The pattern is reusable for any system that needs flexible, rule-based filtering of structured data.
A GeoIP lookup service with caching support for MaxMind and IPInfo databases. Provides a clean interface for IP-to-location and ASN resolution. Can be extracted and reused in any Go application that needs IP geolocation with minimal dependencies.