Menu
Grafana Cloud

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:

  1. A Linux environment that supports eBPF kernel modules.
  2. Administrative sudo privileges or CAP_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:

sh
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:

sh
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:

sh
curl http://localhost:9090/metrics

Which should return results that look similar to:

log
# 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

  1. Create a free Grafana Cloud account
  2. Configure your telemetry data destination:
    1. Grafana Cloud OTLP endpoint: for a quick local development and testing setup
    2. OpenTelemetry Collector: for a robust and scalable production setup
  3. Observe your services in Application Observability

Resources

  1. Grafana Beyla docs
  2. Grafana Beyla on GitHub
  3. Grafana Beyla on Docker Hub