|
| 1 | +--- |
| 2 | +layout: page |
| 3 | +title: OpenTelemetry eBPF Instrumentation (Beyla) |
| 4 | +--- |
| 5 | + |
| 6 | +## Instrumentation types |
| 7 | + |
| 8 | +OBI can instrument in one of these ways: |
| 9 | + |
| 10 | +- **eBPF**: instruments network calls using eBPF. |
| 11 | + - This is disabled by default, you need to enable it. |
| 12 | + |
| 13 | +- **Java Agent injector** (`javaagent.Injector` in the logs) |
| 14 | + |
| 15 | +- **Node.js injector** (`nodejs.Injector` in the logs) |
| 16 | + |
| 17 | +## Context propagation |
| 18 | + |
| 19 | +- **Black box context propagation:** where Beyla maintains a map of which services are talking to each other. |
| 20 | + |
| 21 | +- **ebpf.context_propagation:** where Beyla injects context into actual requests, via: |
| 22 | + - HTTP traceparent: a header is set on outgoing requests |
| 23 | + - TCP header options (the receiving end also needs a Beyla instance to decode it) |
| 24 | + |
| 25 | +## Log clues |
| 26 | + |
| 27 | +What to look for in the logs. |
| 28 | + |
| 29 | +Injecting an agent into a Java process: |
| 30 | + |
| 31 | +``` |
| 32 | +time=2026-03-15T22:01:04.184Z level=INFO msg="injecting OpenTelemetry eBPF instrumentation for Java process" component=javaagent.Injector pid=769073 |
| 33 | +time=2026-03-15T22:01:05.551Z level=INFO msg="instrumenting process" component=discover.traceAttacher cmd=/opt/java/openjdk/bin/java pid=769073 ino=11018437 type=java service="" logenricher=false |
| 34 | +``` |
| 35 | + |
| 36 | +Injecting an agent into a Node.js process: |
| 37 | + |
| 38 | +``` |
| 39 | +time=2026-03-15T22:01:03.722Z level=INFO msg="loading NodeJS instrumentation" component=nodejs.Injector pid=769241 |
| 40 | +time=2026-03-15T22:01:03.927Z level=INFO msg="instrumenting process" component=discover.traceAttacher cmd=/usr/local/bin/node pid=769241 ino=11032542 type=nodejs service="" logenricher=false |
| 41 | +``` |
| 42 | + |
| 43 | +Instrumenting an nginx instance: |
| 44 | + |
| 45 | +``` |
| 46 | +time=2026-03-15T22:01:03.541Z level=DEBUG msg="finding library" component=ebpf.Instrumenter probes=uprobes lib=nginx |
| 47 | +time=2026-03-15T22:01:03.542Z level=DEBUG msg="nginx not linked, attempting to instrument executable" component=ebpf.Instrumenter probes=uprobes path=/proc/768505/exe |
| 48 | +time=2026-03-15T22:01:04.154Z level=INFO msg="instrumenting process" component=discover.traceAttacher cmd=/usr/sbin/nginx pid=769319 ino=11093419 type=generic service="" logenricher=false |
| 49 | +``` |
| 50 | + |
| 51 | +Trace from a SQL statement (assuming you have set `BEYLA_TRACE_PRINTER=text`): |
| 52 | + |
| 53 | +``` |
| 54 | +2026-03-15 22:01:08.3151018 (989.161µs[989.161µs]) SQLClient(subType=2) 0 SELECT products [10.89.0.5 as postgres:41566]->[10.89.0.2 as 10.89.0.2:5432] contentLen:94B responseLen:0B svc=[postgres cpp] traceparent=[00-f13584eee55675eb94b9131e91c9a0c7-32889dc5829018f9[0000000000000000]-00] |
| 55 | +``` |
| 56 | + |
| 57 | +Instrumenting a Java process from a port, without the agent: |
| 58 | + |
| 59 | +``` |
| 60 | +time=2026-03-16T11:58:24.633Z level=DEBUG msg="found process" component=discover.CriteriaMatcher pid=862873 comm=/opt/java/openjdk/bin/java metadata=map[] podLabels=map[] criteria=[0xc0005ca090] logEnricherCriteria=[] |
| 61 | +time=2026-03-16T11:58:24.682Z level=DEBUG msg="found an instrumentable process" component=discover.ExecTyper UID="{Name:java-otel-server Namespace: Instance:}" type=java exec=/opt/java/openjdk/bin/java pid=862873 |
| 62 | +
|
| 63 | +time=2026-03-16T11:27:19.125Z level=DEBUG msg="found an instrumentable process" component=discover.ExecTyper UID="{Name:java-otel-server Namespace: Instance:}" type=java exec=/opt/java/openjdk/bin/java pid=844896 |
| 64 | +time=2026-03-16T11:27:20.765Z level=INFO msg="instrumenting process" component=discover.traceAttacher cmd=/opt/java/openjdk/bin/java pid=844896 ino=11018437 type=java service=java-otel-server logenricher=false |
| 65 | +time=2026-03-16T11:27:20.766Z level=DEBUG msg="reusing Generic tracer for" component=discover.traceAttacher pid=844896 child=[] cmd=/opt/java/openjdk/bin/java language=java |
| 66 | +time=2026-03-16T11:27:20.767Z level=DEBUG msg="running tracer for new process" component=beyla.Instrumenter inode=11018437 pid=844896 exec=/opt/java/openjdk/bin/java |
| 67 | +``` |
| 68 | + |
0 commit comments