Menu
Grafana Cloud

Set up production instrumentation for Beyla

Follow these steps set up production Application Observability with a telemetry collector:

  1. Install the instrumentation library
  2. Configure an application
  3. Set up a telemetry data collector
  4. Run the application
  5. Observe the service in Application Observability

Note

For a quick and easy local development setup, consult the quickstart documentation.

Application Observability - Architecture

Install the instrumentation library

Download the latest binary release of Grafana Beyla and uncompress it.

Alternatively, use the Grafana Beyla Docker image.

Configure an application

Next, customize the following shell script to configure an application:

shell

export OTEL_SERVICE_NAME=<Service Name> export OTEL_RESOURCE_ATTRIBUTES=deployment.environment=<Environment>,service.namespace=<Namespace>,service.version=<Version>,service.instance.id=<Instance>

# Don’t need BEYLA_EXECUTABLE_NAME if BEYLA_OPEN_PORT is already set export BEYLA_EXECUTABLE_NAME= # Don’t need BEYLA_OPEN_PORT if BEYLA_EXECUTABLE_NAME is already set export BEYLA_OPEN_PORT= export BEYLA_SERVICE_NAMESPACE= sudo ./beyla

  1. Choose a Service Name to identify the service, for example cart
  2. Add attributes to filter data:
    • deployment.environment: Name of the deployment environment (staging or production)
    • service.namespace: A namespace to group similar services (e.g. shop would create shop/cart in Application Observability)
    • service.version: The application version, to see if a new version has introduced a bug
    • service.instance.id: The unique instance, for example the Pod name (a UUID is generated by default)
  1. An executable to instrument by specifying either:
    1. The executable file name, for example nginx.
    2. The server port, for example 443.
  2. Optional service attributes:
    1. A Service name to identify the service, for example Frontend.
      By default Beyla will use the executable name.
    2. A Service namespace to group the service under in the plugin.

Note

Beyla requires administrative (sudo) privileges, or at least it needs to be granted the CAP_SYS_ADMIN capability.

Set up a telemetry data collector

In production environments, a robust and flexible observability setup needs to process telemetry data before ingestion into databases. Follow the collector setup documentation to set up a collector to process and send telemetry data to Application Observability.

Finally, set the following environment variables from the exporter configuration:

ConfigurationOptionsResult
export OTEL_EXPORTER_OTLP_ENDPOINT=<host>http://localhost:4317, remote host addressThe default local host address, or a remote host address.
export OTEL_EXPORTER_OTLP_PROTOCOL=<protocol>grpc, http/protobufThe default grpc protocol or http/protobuf

For example, for a local Grafana Alloy:

shell
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
export OTEL_EXPORTER_OTLP_PROTOCOL=grpc

Run the application

Finally, run the application with the shell script and make some requests to the service to send data to Grafana Cloud.

Observe the service in Application Observability

Open Application observability:

  1. Navigate to a stack https://<your-stack-name.>grafana.net
  2. Expand the top left menu below the Grafana logo
  3. Click on Application

Activate metrics generation

Application Observability relies on metrics generated from traces already sent to Grafana Cloud Traces.

Metrics generation is self-serve, and can be enabled during onboarding and disabled from Application Observability configuration.

To complete the setup, click Activate Application Observability to enable metrics generation.

Enable metrics generation

Note

After activating Application Observability and enabling metrics generation, it might take up to five minutes to generate metrics and show graphs.

Visualize and discover

Discover more about Application Observability in the documentation:

  • Service Inventory: filter, and search services and view RED metrics.
  • Service Overview: traces, logs, RED metrics, operations, and runtime information.
  • Service Map: graph of connected services, service dependencies, and data flow.

More info

For detailed setup instructions and troubleshooting, refer to the full Grafana Beyla documentation.

For details about how to setup Grafana Beyla in Kubernetes, refer to the Deploy in Kubernetes section of the documentation.