Skip to content

Commit fe97995

Browse files
committed
wip
1 parent 29b9e53 commit fe97995

3 files changed

Lines changed: 108 additions & 0 deletions

File tree

_articles/loki.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,14 @@ logcli query '{service_name="website"}' | logcli query 'rate({service_name="webs
577577
logcli query 'rate({service_name="website"}[5m])'
578578
```
579579

580+
#### Query a provided log file
581+
582+
You can also use logcli to query and parse a log file. These logs don't have labels, so this command uses a trick: it looks for all logs with any value for `app` (whether set or unset):
583+
584+
```shell
585+
cat beyla.log | logcli query '{app=~".+"}' --stdin
586+
```
587+
580588
### The API
581589

582590
#### Store a single entry with curl

_articles/obi.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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+

_articles/terraform.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,38 @@ TF_REATTACH_PROVIDERS=...
9191
terraform apply
9292
```
9393

94+
### Debugging a provider with JetBrains GoLand
95+
96+
```shell
97+
git clone https://github.com/grafana/terraform-provider-grafana
98+
cd terraform-provider-grafana
99+
go build -o terraform-provider-grafana .
100+
```
101+
102+
Create the file `~/.tofurc`:
103+
104+
```terraform
105+
provider_installation {
106+
dev_overrides {
107+
"grafana/grafana" = "/path/to/your/terraform-provider-grafana"
108+
}
109+
110+
direct {}
111+
}
112+
```
113+
114+
Start the provider in debug mode:
115+
116+
```shell
117+
go run . -debug
118+
```
119+
120+
Attach GoLand to the process:
121+
122+
1. Run -> Attach to Process
123+
2. Find the debug provider by its process ID (PID)
124+
3. GoLand attaches to the provider and it is paused, waiting for the first Terraform connect
125+
4. Set breakpoints now
94126

95127
## Cookbook
96128

0 commit comments

Comments
 (0)