IngestionTracesOpentelemetry

OpenObserve eBPF Tracing Guide

Updated View MarkdownOpen in ChatGPTOpen in Claude

Send distributed traces from applications on Red Hat Enterprise Linux to OpenObserve using eBPF: one OpenTelemetry eBPF Instrumentation (OBI) service per server traces every application from the kernel, through the OpenTelemetry Collector. No changes to the applications are needed.

How to use this guide. Read Before you begin to decide between eBPF and the language agents, and fill in the table of values. Then follow Part A one step at a time on each Linux server. Every value you must replace is shown in angle brackets, like <APP_PORTS>, and the steps that contain one are marked with ✏️. Everything else can be copied as it is. Part A ends with a check that your traces arrived in OpenObserve. eBPF tracing is Linux only; for Windows, use the language guides.

Contents

  1. Before you begin
  2. Part A: Red Hat Enterprise Linux
  3. Using eBPF and SDK agents together
  4. Limitations
  5. Troubleshooting
  6. Tested versions

Before you begin

This guide sends distributed traces from applications on Red Hat Enterprise Linux to OpenObserve using eBPF, with no changes to the applications at all. One background service, OpenTelemetry eBPF Instrumentation (OBI), watches processes from inside the Linux kernel. It creates spans for the HTTP, gRPC, SQL, Redis and Kafka calls they make and receive, and sends them to the OpenTelemetry Collector. The Collector forwards them to OpenObserve.

eBPF trace data path: applications traced by OBI, OpenTelemetry Collector, OpenObserve

OBI works with programs in any language: Java, .NET, Python, Node.js, PHP, Go, Ruby, Rust and C/C++, and with web servers such as Apache httpd and nginx.

eBPF tracing is Linux only. For Windows Server, use the language guides (Java, Python, .NET, PHP, Node.js) and their Part B.

SDK agent or eBPF: which one to use

The language guides add an OpenTelemetry agent or SDK inside each application. This guide watches applications from outside, in the kernel. Both send standard OpenTelemetry traces to the same Collector and OpenObserve.

Language agent / SDK (language guides)eBPF with OBI (this guide)
Change to the applicationAdd an agent, package or settings to each application, then restart itNone. One service per server covers every application on it
Operating systemsRHEL and Windows ServerLinux only: kernel 5.8 or later, or RHEL 8 (kernel 4.18) with the eBPF backports, with BTF enabled
LanguagesOne agent per languageAny process, including Go, Rust, C/C++ and web servers that have no agent
Span detailFramework-level: controllers, routes, SQL statements, exceptions, custom spans and business attributesProtocol-level: each HTTP/gRPC request and response, SQL, Redis and Kafka calls, with timing. No custom spans or business attributes
Linking spans into one traceComplete inside the application, including async codeAcross services over HTTP and gRPC. Inside some runtimes the incoming request is not always linked to the calls it makes (see Limitations)
PrivilegesRuns as the application's own userOBI runs as root on the server
OperationsConfigured and upgraded with each applicationOne service and one configuration file per server

Choose eBPF when:

  • You need tracing quickly across many services, or across applications you can't or don't want to modify (vendor or legacy software).
  • An application has no OpenTelemetry agent, for example Go, Rust or C/C++ programs, or Apache httpd and nginx.
  • Changing application start-up or redeploying is hard, and you want a baseline first.

Choose the language agent / SDK when:

  • You need deep detail: SQL statements, exceptions, framework spans, custom spans or business attributes.
  • The server runs Windows.
  • Complete parent-child linking inside async-heavy .NET or PHP-FPM applications matters to you.
  • Running a root-level service on the server isn't allowed.

Use both: run OBI on every Linux server as a baseline, and add the language agent to your most important services. OBI automatically stops tracing any process that sends its own OpenTelemetry data, so the two don't duplicate each other (see Using eBPF and SDK agents together).

Requirements

Check these on each server before you start:

uname -r                         # 5.8 or later, or 4.18.0-* on RHEL 8
ls -l /sys/kernel/btf/vmlinux    # must exist: the kernel has BTF
uname -m                         # x86_64 or aarch64

RHEL 9 (kernel 5.14) meets the requirements as shipped. On RHEL 8, OBI relies on Red Hat's eBPF backports in the 4.18 kernel; keep the kernel up to date. You need sudo rights, and outbound HTTPS from the server to OpenObserve (port 443, or 5080 for self-hosted).

Values you need to provide

Throughout this guide, every value in angle brackets, like <SERVICE_NAME>, is a value you must replace with your own. Replace the angle brackets too. Copy everything else exactly as shown.

PlaceholderWhat to enterWhere to find itExample
<OPENOBSERVE_URL>Base URL of your OpenObserve, with no trailing /OpenObserve Cloud: https://api.openobserve.ai. Self-hosted: the URL you use to open OpenObservehttps://o2.example.com
<ORG_ID>Your OpenObserve organization IDOpenObserve → Data sources. It's part of the endpoint shown theredefault
<BASE64_CREDENTIALS>Base64 of email:password-or-token for the ingestion userOpenObserve → Data sources shows a ready-made Authorization: Basic ... value; use the part after Basic . Or run echo -n '<O2_USER_EMAIL>:<O2_PASSWORD_OR_TOKEN>' | base64dXNlcjpwYXNz
<TRACE_STREAM>Traces stream to write toYour choice. It is created on first usedefault
<APP_PORTS>Ports your applications listen on. OBI traces processes that listen on these portssudo ss -ltnp8080,8443,9090-9091
<APP_UNIT>systemd service name of an applicationsystemctl list-units --type=servicecheckout
<SERVICE_NAME>Name that application will have in OpenObserveYour choice. Lowercase, unique per applicationcheckout-api
<APP_URL>A URL of the application for a test requestYour applicationhttp://localhost:8080/health
<O2_USER_EMAIL> / <O2_PASSWORD_OR_TOKEN>An OpenObserve login, used only for the optional API check in A6OpenObserveingest@example.com

Part A: Red Hat Enterprise Linux

Run every command as a user with sudo rights on the application server. Commands without placeholders can be copied as they are.

Step A1. Install and configure the OpenTelemetry Collector

If this server already has the Collector from one of the language guides, skip to Step A2: OBI uses the same Collector.

A1.1 Download the Collector package and verify its checksum. On ARM servers, set ARCH=arm64.

OTEL_VERSION=0.166.0
ARCH=amd64
BASE=https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v${OTEL_VERSION}
cd /tmp
curl -LO ${BASE}/otelcol-contrib_${OTEL_VERSION}_linux_${ARCH}.rpm
curl -LO ${BASE}/otelcol-contrib_${OTEL_VERSION}_linux_${ARCH}.rpm.sha256
echo "$(cat otelcol-contrib_${OTEL_VERSION}_linux_${ARCH}.rpm.sha256)  otelcol-contrib_${OTEL_VERSION}_linux_${ARCH}.rpm" | sha256sum -c -

Expected output: otelcol-contrib_0.166.0_linux_amd64.rpm: OK

A1.2 Install the package. This creates the otelcol-contrib systemd service and the /etc/otelcol-contrib/ folder.

sudo dnf install -y ./otelcol-contrib_${OTEL_VERSION}_linux_${ARCH}.rpm

A1.3 Write the Collector configuration. This file contains no values of yours; they come from the next step. Copy the whole block as it is.

sudo cp /etc/otelcol-contrib/config.yaml /etc/otelcol-contrib/config.yaml.orig
sudo tee /etc/otelcol-contrib/config.yaml >/dev/null <<'EOF'
extensions:
  health_check:
    endpoint: 127.0.0.1:13133

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 127.0.0.1:4317
      http:
        endpoint: 127.0.0.1:4318

processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 80
    spike_limit_percentage: 25
  resource_detection:
    detectors: [env, system]
    system:
      hostname_sources: [os]
  batch:
    send_batch_size: 1024
    timeout: 5s

exporters:
  otlp_http/openobserve:
    endpoint: ${env:O2_OTLP_ENDPOINT}
    headers:
      Authorization: "Basic ${env:O2_AUTH_TOKEN}"
      stream-name: ${env:O2_TRACE_STREAM}
    compression: gzip
    retry_on_failure:
      enabled: true
    sending_queue:
      enabled: true
      queue_size: 5000

service:
  extensions: [health_check]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [memory_limiter, resource_detection, batch]
      exporters: [otlp_http/openobserve]
EOF

A1.4 Enter your OpenObserve values. ✏️ Replace the three placeholders, then run:

sudo tee -a /etc/otelcol-contrib/otelcol-contrib.conf >/dev/null <<'EOF'
O2_OTLP_ENDPOINT=<OPENOBSERVE_URL>/api/<ORG_ID>
O2_AUTH_TOKEN=<BASE64_CREDENTIALS>
O2_TRACE_STREAM=<TRACE_STREAM>
EOF
sudo chown root:otelcol-contrib /etc/otelcol-contrib/otelcol-contrib.conf
sudo chmod 640 /etc/otelcol-contrib/otelcol-contrib.conf

Don't add /v1/traces to the endpoint, and don't add Basic to the token.

A1.5 Check the configuration, then start the Collector:

sudo bash -c 'set -a; . /etc/otelcol-contrib/otelcol-contrib.conf; otelcol-contrib validate --config=/etc/otelcol-contrib/config.yaml' && echo CONFIG OK
sudo systemctl enable otelcol-contrib
sudo systemctl restart otelcol-contrib
curl -s http://127.0.0.1:13133

Expected: CONFIG OK and {"status":"Server available",...}. To confirm the connection to OpenObserve before continuing, send the test trace from step A1.7 of any language guide.

Step A2. Install OBI

A2.1 Download OBI and verify its checksum. On ARM servers, set ARCH=arm64.

OBI_VERSION=1.0.0
ARCH=amd64
BASE=https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/releases/download/v${OBI_VERSION}
mkdir -p /tmp/obi && cd /tmp/obi
curl -sSLO ${BASE}/obi-v${OBI_VERSION}-linux-${ARCH}.tar.gz
curl -sSLO ${BASE}/SHA256SUMS
sha256sum -c SHA256SUMS --ignore-missing

Expected output: obi-v1.0.0-linux-amd64.tar.gz: OK

A2.2 Install the binary:

tar -xzf obi-v${OBI_VERSION}-linux-${ARCH}.tar.gz
sudo install -m 0755 obi /usr/local/bin/obi
sudo mkdir -p /etc/obi /var/cache/obi

Step A3. Configure OBI

A3.1 Write the OBI configuration. ✏️ Replace <APP_PORTS>, then run:

sudo tee /etc/obi/obi.yaml >/dev/null <<'EOF'
file_format: "1.0"
log_level: info
tracer_provider:
  processors:
    - batch:
        exporter:
          otlp_http:
            endpoint: http://127.0.0.1:4318/v1/traces
            encoding: protobuf
extensions:
  obi:
    version: "2.0"
    capture:
      policy:
        default_action: exclude
        match_order: first_match_wins
      rules:
        - action: exclude
          name: exclude-obi-and-collectors
          match:
            process:
              exe_path_glob: ["{*/obi,obi,*otelcol,*otelcol-contrib,*otelcol-contrib[!/]*}"]
        - action: exclude
          name: exclude-apps-with-otel-sdk-http
          match:
            process:
              exports_otlp:
                port: 4318
                protocol: protobuf
        - action: exclude
          name: exclude-apps-with-otel-sdk-grpc
          match:
            process:
              exports_otlp:
                port: 4317
                protocol: protobuf
        - action: include
          name: web-apps
          match:
            process:
              open_ports: "<APP_PORTS>"
      engine:
        propagation:
          context_propagation: all
EOF

What this does:

  • Sends traces to the Collector on the same server (127.0.0.1:4318). The OpenObserve credentials stay in the Collector.
  • Traces only processes that listen on <APP_PORTS>, for example 8080 or 8080,8443,9090-9091. Everything else on the server is left alone.
  • Never traces OBI itself, the Collector, or any application that already sends its own OpenTelemetry data (an application set up with a language guide).
  • Links calls between services (context_propagation: all). OBI adds the standard traceparent header to outgoing HTTP and gRPC calls, so a request that crosses several services appears as one trace.

A3.2 (Only for PHP on php-fpm) Trace the php-fpm workers too. php-fpm workers don't listen on a TCP port, so add this rule before the web-apps rule, at the same indentation:

        - action: include
          name: php-fpm-workers
          match:
            process:
              exe_path_glob: ["*/php-fpm"]

A3.3 Check the configuration:

sudo obi config validate /etc/obi/obi.yaml

Expected: configuration is valid

Step A4. Give each application a service name

OBI reads the name from the OTEL_SERVICE_NAME environment variable of each application's process. Without it, the service is named after the program, for example java, python3.11, node, dotnet or httpd. Set only the name: don't add any other OTEL_* settings, because the application itself sends nothing.

✏️ For each application, replace <APP_UNIT> (in both places) and <SERVICE_NAME>, then run:

sudo mkdir -p /etc/systemd/system/<APP_UNIT>.service.d
sudo tee /etc/systemd/system/<APP_UNIT>.service.d/obi-name.conf >/dev/null <<'EOF'
[Service]
Environment=OTEL_SERVICE_NAME=<SERVICE_NAME>
EOF
sudo systemctl daemon-reload
sudo systemctl restart <APP_UNIT>

This is the only step that restarts your applications, and it's optional: OBI traces running applications without a restart, just under the program name.

Step A5. Run OBI as a service

A5.1 Create the systemd service:

sudo tee /etc/systemd/system/obi.service >/dev/null <<'EOF'
[Unit]
Description=OpenTelemetry eBPF Instrumentation (OBI)
After=network-online.target otelcol-contrib.service

[Service]
Type=simple
User=root
Environment=XDG_CACHE_HOME=/var/cache/obi
ExecStart=/usr/local/bin/obi --config=/etc/obi/obi.yaml
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now obi

A5.2 Confirm that OBI found your applications:

sudo systemctl status obi --no-pager
sudo journalctl -u obi --no-pager | grep 'instrumenting process'

Expected: one line per application, with its program, detected language and service name, for example:

msg="instrumenting process" cmd=/usr/lib/jvm/java-17-openjdk/bin/java pid=4292 type=java service=checkout-api

No line for an application means it doesn't listen on any of <APP_PORTS>, or it already sends its own OpenTelemetry data. OBI also logs a few warnings at startup about cloud metadata and bpffs. Those are harmless on standalone servers.

Step A6. Verify traces in OpenObserve

  1. ✏️ Send a few requests to the application: curl -s <APP_URL> > /dev/null, or wait for normal traffic.
  2. In OpenObserve, open Traces, select the <TRACE_STREAM> stream and the Last 15 minutes time range.
  3. Filter on service_name = '<SERVICE_NAME>'. Your requests appear within about 20 seconds.
  4. Open a trace. It shows the incoming request (for example GET /orders), OBI's in queue and processing timing spans, and a client span for each outgoing HTTP, gRPC or database call. Calls to other traced services on any server appear in the same trace.

Optional check from the command line. ✏️ Replace the placeholders:

END=$(($(date +%s)*1000000)); START=$((END-3600*1000000))
cat > /tmp/q.json <<EOF
{"query":{"sql":"SELECT service_name, count(*) AS spans FROM \"<TRACE_STREAM>\" GROUP BY service_name","start_time":$START,"end_time":$END}}
EOF
curl -s -u '<O2_USER_EMAIL>:<O2_PASSWORD_OR_TOKEN>' -H 'Content-Type: application/json' \
  "<OPENOBSERVE_URL>/api/<ORG_ID>/_search?type=traces" -d @/tmp/q.json

Repeat Part A on every Linux server. Use the same <SERVICE_NAME> for every server that runs the same application.

Using eBPF and SDK agents together

You can run OBI on a server where some applications also use a language agent or SDK:

  • No duplicate traces. The two exclude-apps-with-otel-sdk rules in A3.1 make OBI stop tracing any process that sends its own OpenTelemetry data to the Collector on port 4318 or 4317. In testing, OBI traced an SDK-instrumented Java service only during its first seconds after start-up, before the SDK had exported anything; after that, only the SDK's spans arrived.
  • Shared traces. OBI reads and writes the same W3C traceparent header as the SDKs. A request that passes through an eBPF-traced service and an SDK-traced service appears as one trace in OpenObserve.
  • Web servers in front of SDK applications (Apache httpd, nginx) are still traced by OBI when they listen on <APP_PORTS>. They add their own server span to the same trace, which shows time spent in the web server.

A practical rollout: start with OBI on every Linux server for broad coverage, then add the language agent from the matching guide to the services where you need more detail. Those services move from eBPF to SDK tracing automatically.

Limitations

These results come from the same sample application in each language: an incoming GET / that makes an outgoing HTTP call to GET /downstream.

Application runtimeWhat OBI tracedLinking
Java 17 (Spring Boot)Incoming request, outgoing call, downstream requestComplete: one trace per request
Python 3.11 (Flask, gunicorn)Incoming request, outgoing call, downstream requestComplete: one trace per request
Node.js 22 (Express)Incoming request, outgoing call, downstream requestComplete: one trace per request
.NET 10 (ASP.NET Core)Incoming request, outgoing call, downstream requestPartial: the outgoing call and the downstream request are linked, but the incoming request is a separate trace
PHP 8.2 (Apache httpd + php-fpm)Incoming request (httpd), outgoing call (php-fpm), downstream requestPartial: as for .NET. php-fpm spans are named php-fpm because php-fpm workers don't keep OTEL_SERVICE_NAME

Where the linking is partial, the SDK guide for that language gives complete traces.

Other limitations:

  • Linux only. OBI doesn't run on Windows Server.
  • No custom detail. OBI can't add custom spans, business attributes, exception details or framework-level spans such as controllers or template rendering.
  • HTTPS between services. For TLS-encrypted calls, OBI can't add the traceparent header. It marks the TCP packets instead, which links calls only between OBI-traced services, and only when no proxy or L7 load balancer sits between them.
  • Root service. OBI runs as root and loads eBPF programs into the kernel. For Java, it also injects a small helper agent into the JVM at runtime (logged as injecting OpenTelemetry eBPF instrumentation for Java process). For Node.js, it briefly enables the Node.js inspector, which can show up as GET /json/list spans. Review this with your security team before rollout.
  • Other eBPF tools. Context propagation uses Linux Traffic Control. Tools that also attach to Traffic Control, such as the Cilium CNI, need the compatibility settings in the OBI documentation.

Troubleshooting

Where to look:

  • OBI log: sudo journalctl -u obi -n 100 --no-pager
  • Collector log: sudo journalctl -u otelcol-contrib -n 100 --no-pager
SymptomCauseFix
OBI doesn't start; the log mentions BTF, bpf, or operation not permittedKernel too old, BTF missing, or OBI not running as rootCheck the Requirements commands. The service file runs OBI as root; keep it that way
obi config validate reports field ... not foundIndentation or a key name was changedCopy the A3.1 block again, and only replace <APP_PORTS>
No instrumenting process line for an applicationIt doesn't listen on any of <APP_PORTS>, or it already sends OpenTelemetry dataCheck its port with sudo ss -ltnp, then add the port to <APP_PORTS> and restart OBI
Traces appear under names like java or python3.11OTEL_SERVICE_NAME isn't set on the application's serviceDo step A4 and restart the application
A service appears twice, from OBI and from an SDKThe application was started before the SDK exported anythingThis stops on its own once the SDK sends data. Make sure both exclude-apps-with-otel-sdk rules are in the configuration
Calls to another server show as separate tracescontext_propagation: all is missing, or a proxy, load balancer or HTTPS hop is in betweenCheck A3.1. See Limitations for HTTPS
Collector log shows 401, 403 or 404Wrong credentials or endpoint pathO2_OTLP_ENDPOINT must be <OPENOBSERVE_URL>/api/<ORG_ID>, and the token the Base64 of email:password-or-token
Too much trace volumeEvery request is tracedAdd a sampler under tracer_provider in /etc/obi/obi.yaml, for example sampler: { parent_based: { root: { trace_id_ratio_based: { ratio: 0.1 } } } } (10%), then restart OBI

To remove eBPF tracing, run sudo systemctl disable --now obi. Your applications keep running unchanged. Optionally, delete the obi-name.conf files from step A4.

Tested versions

Every step in Part A was run as written on Red Hat Enterprise Linux 9.9 with systemd, with OBI tracing Java, Python, Node.js, .NET and PHP applications into OpenObserve. The test server used a Linux 7.0 kernel with BTF. Results on RHEL 8 kernels depend on Red Hat's eBPF backports.

ComponentVersion
OpenTelemetry eBPF Instrumentation (OBI)1.0.0, configuration format v2
OpenTelemetry Collector Contrib0.166.0
ApplicationsOpenJDK 17, Python 3.11 (gunicorn), Node.js 22, .NET 10, PHP 8.2 (httpd + php-fpm)
OpenObservev1.2.0

For all OBI options, see the OBI documentation.

Was this page helpful?