Instrument an application with Beyla
Follow this article to install the latest release of Grafana Beyla and instrument your application running on Linux for Grafana Cloud Application Observability. Beyla is instrumentation software that uses an eBPF kernel module to automatically instrument applications and export OpenTelemetry metrics and traces, and Prometheus metrics.
Before you begin
The is the first step to get telemetry data into Application Observability, you need:
- A Linux environment that supports eBPF kernel modules.
- Administrative
sudo
privileges orCAP_SYS_ADMIN
permissions.
Install Beyla
Install Beyla through one of these methods:
- Helm Chart
- Docker
To learn more about the various Beyla installation and configurations options, consult the Beyla documentation.
Helm Chart
Run the following helm
commands to add the grafana
repository and install and run beyla
:
helm repo add grafana https://grafana.github.io/helm-charts
helm install beyla -n beyla --create-namespace grafana/beyla
Docker
Use the Grafana Beyla Docker image.
The Docker container must have administrative privileges and share the host PIDs namespace:
docker run -e BEYLA_PROMETHEUS_PORT=9090 -e BEYLA_EXECUTABLE_NAME=.\
-p 9090:9090 --privileged --pid host grafana/beyla:latest
Test your instrumentation
If you installed Beyla via Helm, first run kubectl -n beyla port-forward <beyla-pod-name>
.
To test if you successfully instrumented your application and are producing telemetry data, run the application and verify that it sends or receives traffic.
The /metrics
HTTP endpoint in the open Prometheus port 9090 should show some metrics:
curl http://localhost:9090/metrics
Which should return results that look similar to:
# HELP beyla_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which Beyla was built, the goos and goarch for the build, and thelanguage of the reported services
# TYPE beyla_build_info gauge
beyla_build_info{goarch="arm64",goos="linux",goversion="go1.22.4",revision="b672ca01",target_lang="generic",version="b672ca01"} 1
beyla_build_info{goarch="arm64",goos="linux",goversion="go1.22.4",revision="b672ca01",target_lang="go",version="b672ca01"} 1
# HELP http_client_request_body_size_bytes size, in bytes, of the HTTP request body as sent from the client side
# TYPE http_client_request_body_size_bytes histogram
http_client_request_body_size_bytes_bucket{http_request_method="GET",http_response_status_code="200",http_route="/**",service_name="coredns",service_namespace="",target_instance="",le="0"} 2
http_client_request_body_size_bytes_bucket{http_request_method="GET",http_response_status_code="200",http_route="/**",service_name="coredns",service_namespace="",target_instance="",le="32"} 2
Next steps
- Create a free Grafana Cloud account
- Configure your telemetry data destination:
- Grafana Cloud OTLP endpoint: for a quick local development and testing setup
- OpenTelemetry Collector: for a robust and scalable production setup
- Observe your services in Application Observability