Help build the future of open source observability software Open positions

Check out the open source projects we support Downloads

The actually useful free plan

Grafana Cloud Free Tier
check

10k series Prometheus metrics

check

50GB logs, 50GB traces, 50GB profiles

check

500VUk k6 testing

check

20+ Enterprise data source plugins

check

100+ pre-built solutions

Featured webinar

Getting started with grafana LGTM stack

Getting started with managing your metrics, logs, and traces using Grafana

Learn how to unify, correlate, and visualize data with dashboards using Grafana.

Observability for containerized workloads: How to run Grafana Beyla as a sidecar in Amazon ECS

Observability for containerized workloads: How to run Grafana Beyla as a sidecar in Amazon ECS

2025-07-09 4 min

Note: Grafana Beyla has been donated to OpenTelemetry under the new project name OpenTelemetry eBPF Instrumentation. Beyla will continue to exist as Grafana Labs’ distribution of the upstream project. 

Grafana Beyla is an open source eBPF-based auto-instrumentation tool that helps you easily get started with application observability, allowing you to monitor and visualize traces without modifying the application code. Amazon Elastic Container Service (ECS), meanwhile, is a fully managed container orchestration service in AWS.

In this blog post, we’ll explore how to integrate Grafana Beyla with Amazon ECS to enhance application observability within Amazon’s managed, containerized environment. With Beyla’s eBPF-based auto-instrumentation, you can achieve deep visibility into containerized workloads without code changes, accelerating time-to-market and reducing engineering overhead.  

Specifically, we’ll cover the configuration requirements to run Beyla as a sidecar in an ECS task, which is the smallest unit of execution in an ECS cluster (think of an ECS task like a Kubernetes pod).

In the following example, we’ll use ECS running on Amazon Elastic Compute Cloud (EC2), which is an important distinction given that Beyla is not supported with ECS in AWS Fargate. This is because ECS in Fargate doesn’t support eBPF, which is the technology Beyla uses to instrument your applications. We’ll also also use Grafana Alloy — an open source OpenTelemetry collector with built-in Prometheus pipelines and support for metrics, logs, traces, and profiles — to send all telemetry data to Grafana Cloud.

You can find more information on this topic, and some of the code examples included here, in this GitHub repo

Running Alloy in ECS

Grafana Beyla is available in Alloy as the default eBPF-based application auto-instrumentation solution. The following steps will set up an OpenTelemetry listener in ECS via Alloy. You could also send traces directly to an OpenTelemetry protocol (OTLP) endpoint within the application, but for this example, we’re using Alloy with an OpenTelemetry listener on either port 4317 for GRPC or 4318 for HTTP.  

Create a configuration file in an AWS Systems Manager Parameter Store and reference it from the ECS task definition. If you’re sending telemetry data to Grafana Cloud, it’s crucial that the service lives on a subnet that has internet access.

 "secrets": [
                {
                    "name": "ALLOY_CONFIG_CONTENT",
                    "valueFrom": "collector-config"
                }
            ],

The IAM role that runs the task must have permission to read from the parameter store, as well. Port 4318 (HTTP) must be open in order for Beyla to send telemetry data to Alloy. Alternatively, if you’d like to send your telemetry data in GRPC format, you can expose port 4317 and then change the Beyla export settings accordingly.

{
                    "name": "http",
                    "containerPort": 4318,
                    "hostPort": 4318,
                    "protocol": "tcp",
                    "appProtocol": "http"
                }

Finally, Alloy will use service discovery with a DNS name so that Beyla can send telemetry data to it.

A screenshot of the service discovery page for Amazon ECS.

Running a sample application with Beyla

For our example, we’ll leverage an existing sample application written in Go. In the task definition, the parameter “pidMode”:”task” must be specified. This allows Beyla to read process IDS (PIDs) from other containers in the same service. In Docker or Kubernetes, this option is equivalent to setting the PID mode of the Beyla sidecar container to match the one of the service being instrumented.

 "pidMode": "task",

The appropriate Beyla parameters must be sent, as well as the receiver for Alloy. 

"environment": [
                {
                    "name": "BEYLA_EXECUTABLE_NAME",
                    "value": "goblog"
                },
                {
                    "name": "BEYLA_OPEN_PORT",
                    "value": "8443"
                },
                {
                    "name": "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT",
                    "value": "http://alloy-receiver.alloy:4318"
                }
            ],

For my service, I elected to use a load balancer to port 8443 since my sample web application runs on port 8443. In addition, it’s crucial that the service is in the same namespace as Alloy so that it can communicate with the receiver.

Once the data is received in Grafana Cloud Traces — the fully managed distributed tracing system powered by Grafana Tempo — you can query it alongside all other traces, regardless of source, to monitor and optimize application performance. The example below shows the TraceQL result, but metrics are also generated from Cloud Traces automatically, which enables Grafana Cloud Application Observability.

A screenshot of Grafana Cloud Traces.

Wrapping up 

Integrating Grafana Beyla with Amazon ECS delivers immediate and long-term business value by dramatically simplifying the path to robust application observability. Ultimately, adopting this approach enhances service reliability, increases developer productivity, and supports business agility by providing a scalable, open source observability solution purpose-built for modern cloud environments.

To learn more, please check out our documentation for both Grafana Beyla and Grafana Alloy, as well as this GitHub repo

Grafana Cloud is the easiest way to get started with metrics, logs, traces, dashboards, and more. We have a generous forever-free tier and plans for every use case. Sign up for free now!