1. The principle #
RED metrics for any service.
What Beyla does #
Available in: ✓ OSS ✓ Enterprise ✓ Cloud Beyla open source; built into Alloy and Grafana Cloud Application Observability
Beyla attaches to the targeted processes and observes their HTTP, HTTP/2, gRPC, SQL, Redis or Kafka requests (server and client side). From them it derives RED metrics (Rate, Errors, Duration) and spans in OpenTelemetry format.
Good to know: In 2025, Grafana Labs donated Beyla's core to the OpenTelemetry project under the name OpenTelemetry eBPF Instrumentation (OBI). Beyla remains Grafana's distribution, with the same configuration; Alloy embeds it in the beyla.ebpf component.2. Configuring Beyla #
Targeting, exporting.
Environment variables #
docker run --rm --privileged --pid=host \
-e BEYLA_OPEN_PORT=8080 \
-e BEYLA_PROMETHEUS_PORT=9400 \
-e OTEL_EXPORTER_OTLP_ENDPOINT=http://alloy:4318 \
-e BEYLA_TRACE_PRINTER=text \
grafana/beyla:latest| Variable | Role |
|---|---|
BEYLA_OPEN_PORT | Instrument the process listening on this port |
BEYLA_EXECUTABLE_NAME | Or target by executable name |
BEYLA_PROMETHEUS_PORT | Expose metrics on /metrics |
OTEL_EXPORTER_OTLP_ENDPOINT | Send metrics and traces over OTLP |
BEYLA_TRACE_PRINTER | Print spans to the console (diagnostics) |
OTEL_SERVICE_NAME | Force the service name |
Configuration file #
# beyla.yml
discovery:
instrument:
- open_ports: 8080-8089
- exe_path: "*/java"
routes:
patterns: [/api/orders/{id}, /api/users/{id}] # éviter la cardinalité des URL
unmatched: heuristic
prometheus_export:
port: 9400
otel_traces_export:
endpoint: http://tempo:4318Common mistake: Withoutroutes, every distinct URL (/orders/123,/orders/124...) can become a label value. Declare route templates or let the heuristic group them.
3. Metrics and traces produced #
OpenTelemetry conventions.
Metrics #
| Prometheus metric | Content |
|---|---|
http_server_request_duration_seconds | Duration of received HTTP requests (histogram) |
http_client_request_duration_seconds | Duration of outgoing HTTP requests |
rpc_server_duration_seconds | Duration of gRPC calls |
db_client_operation_duration_seconds | Duration of SQL queries |
# Taux d'erreurs 5xx par route
sum by (http_route) (rate(http_server_request_duration_seconds_count{http_response_status_code=~"5.."}[5m]))
/ sum by (http_route) (rate(http_server_request_duration_seconds_count[5m]))On the trace side, Beyla propagates the W3C context (traceparent) for several languages, enabling distributed traces between services instrumented with eBPF.
Good practice: Start with Beyla to cover all services in a day, then add an OpenTelemetry SDK where you need detailed business spans.
4. On Kubernetes #
DaemonSet and discovery.
Helm #
helm install beyla grafana/beyla -n beyla --create-namespace -f values.yaml# values.yaml (extrait)
config:
data:
discovery:
instrument:
- k8s_namespace: boutique
attributes:
kubernetes: { enable: true }
prometheus_export: { port: 9090, path: /metrics }Beyla adds Kubernetes metadata (namespace, pod, deployment) to metrics and traces: they serve as the default service_name.
My progress
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
Beyla and Alloy: zero-code RED metrics and traces with beyla.ebpf
Enable Beyla eBPF instrumentation in Alloy: service discovery, RED metrics to Mimir, traces to Te...
eBPF explained: programs in the Linux kernel to observe without instrumenting
What eBPF is, how a program is verified and then run in the kernel, hook points (kprobes, uprobes...
eBPF best practices for observability
Checklist for adopting eBPF in observability: choosing tools, gradual rollout, agent security, co...
Sending traces to Tempo: OpenTelemetry instrumentation and Alloy
Produce and route traces to Tempo: Python/Java/Node auto-instrumentation, the manual SDK, OTEL en...
OpenTelemetry on Kubernetes: Operator, auto-instrumentation and Collector
Deploy OpenTelemetry on Kubernetes: Collector deployment modes (DaemonSet, Deployment, sidecar, S...
OpenTelemetry: automatic vs manual instrumentation
Understand the differences between automatic and manual instrumentation with OpenTelemetry, their...
Observing the Kubernetes network with Cilium Hubble
Make a Kubernetes cluster's network flows visible with Cilium Hubble: architecture, the hubble ob...
Continuous profiling with eBPF: Parca, Pyroscope and the OpenTelemetry profiler
Continuously profile every process on a host with eBPF: principle, Parca and parca-agent, Pyrosco...
eBPF in production: security, prerequisites and limits
What to know before deploying eBPF agents: privileges and capabilities, kernel versions, managed ...