Skip to content

Upgrade Beyla component to 2.5.4 #4100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ef174b0
Update Beyla component to Beyla 2.5.3 / OBI 1.1.4
rafaelroquetto Aug 1, 2025
5d2359f
Add export mode selector
rafaelroquetto Aug 1, 2025
d2f03a5
refactor go.mod
marctc Aug 1, 2025
2604c85
add docs for export_mode
marctc Aug 1, 2025
3f12046
add per service sampler tracer config
marctc Aug 1, 2025
b0d7a21
add granular tracing config
marctc Aug 1, 2025
a61c12b
add last metric features
marctc Aug 1, 2025
0c58321
Upgrade CHANGELOG and Beyla version
marctc Aug 1, 2025
45a6835
run make generate-versioned-files
marctc Aug 1, 2025
8c03726
bump beyla to 2.5.4
marctc Aug 1, 2025
3c7fb23
update docs
marctc Aug 1, 2025
f0ae1c8
PR feedback
marctc Aug 1, 2025
9fa8980
remove comments
marctc Aug 1, 2025
9f3e818
Update docs/sources/reference/components/beyla/beyla.ebpf.md
marctc Aug 4, 2025
28a27f1
change default value for kubernetes enable
marctc Aug 4, 2025
f0f9ee3
add note about hostPID
marctc Aug 4, 2025
e693524
Update docs/sources/reference/components/beyla/beyla.ebpf.md
marctc Aug 6, 2025
c4ecccc
Update docs/sources/reference/components/beyla/beyla.ebpf.md
marctc Aug 6, 2025
44ce71f
Update docs/sources/reference/components/beyla/beyla.ebpf.md
marctc Aug 6, 2025
fcaef1c
Update docs/sources/reference/components/beyla/beyla.ebpf.md
marctc Aug 6, 2025
f4f3620
Update docs/sources/reference/components/beyla/beyla.ebpf.md
marctc Aug 6, 2025
00d6da9
Update docs/sources/reference/components/beyla/beyla.ebpf.md
marctc Aug 6, 2025
d4304b0
Update docs/sources/reference/components/beyla/beyla.ebpf.md
marctc Aug 6, 2025
d723f6a
Update docs/sources/reference/components/beyla/beyla.ebpf.md
marctc Aug 6, 2025
063e40d
Update docs/sources/reference/components/beyla/beyla.ebpf.md
marctc Aug 6, 2025
25ff2bb
Update docs/sources/reference/components/beyla/beyla.ebpf.md
marctc Aug 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Main (unreleased)

- Add `application_host` and `network_inter_zone` features to `beyla.ebpf` component. (@marctc)

- Upgrade `beyla.ebpf` to version Beyla v2.5.4 The full list of changes can be found in the [Beyla release notes](https://github.com/grafana/beyla/releases/tag/v2.5.4) (@marctc)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be good to mention which version we're upgrading from. After all users would need to check the changelogs of all the intermediate versions too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be especially good to mention any breaking changes. Normally breaking changes should be described in the release notes in more detail.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also want to put there breaking changes from things that are not config? We introduced some breaking changes that are more from behaviour but I dont think honestly affects much to the component.


### Bugfixes

- Fix issues with propagating cluster peers change notifications to components configured with remotecfg. (@dehaansa)
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cascade:
OTEL_VERSION: v0.128.0
PROM_WIN_EXP_VERSION: v0.30.8
SNMP_VERSION: v0.29.0
BEYLA_VERSION: v2.2.5
BEYLA_VERSION: v2.5.4
FULL_PRODUCT_NAME: Grafana Alloy
PRODUCT_NAME: Alloy
hero:
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/_index.md.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cascade:
OTEL_VERSION: v0.128.0
PROM_WIN_EXP_VERSION: v0.30.8
SNMP_VERSION: v0.29.0
BEYLA_VERSION: v2.2.5
BEYLA_VERSION: v2.5.4
FULL_PRODUCT_NAME: Grafana Alloy
PRODUCT_NAME: Alloy
hero:
Expand Down
140 changes: 126 additions & 14 deletions docs/sources/reference/components/beyla/beyla.ebpf.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To run this component, {{< param "PRODUCT_NAME" >}} requires administrative priv
The number of required capabilities depends on the specific use case.
Refer to the [Beyla capabilities](https://grafana.com/docs/beyla/latest/security/#list-of-capabilities-required-by-beyla) for more information.

In Kubernetes environments, the [AppArmor profile must be `Unconfined`](https://kubernetes.io/docs/tutorials/security/apparmor/#securing-a-pod) for the Deployment or DaemonSet running {{< param "PRODUCT_NAME" >}}.
In Kubernetes environments, the [AppArmor profile must be `Unconfined`](https://kubernetes.io/docs/tutorials/security/apparmor/#securing-a-pod) for the Deployment or DaemonSet running {{< param "PRODUCT_NAME" >}}. You will also need to set the `hostPID` flag to `true` in the Pod spec so that in can access all the processes running on the host.
{{< /admonition >}}

## Usage
Expand Down Expand Up @@ -76,6 +76,7 @@ You can use the following blocks with `beyla.ebpf`:
| `discovery` > `exclude_services` > [`kubernetes`][kubernetes services] | Configures the Kubernetes services to exclude for the component. | no |
| `discovery` > [`services`][services] | Configures the services to discover for the component. | no |
| `discovery` > `services` > [`kubernetes`][kubernetes services] | Configures the Kubernetes services to discover for the component. | no |
| `discovery` > `services` > [`sampler`][sampler] | Configures trace sampling for the service. | no |
| `discovery` > [`survey`][services] | Configures the surveying mechanism for the component. | no |
| `discovery` > `survey` > [`kubernetes`][kubernetes services] | Configures the Kubernetes surveying mechanism for the component. | no |
| [`ebpf`][ebpf] | Configures eBPF-specific settings. | no |
Expand All @@ -84,17 +85,20 @@ You can use the following blocks with `beyla.ebpf`:
| `filters` > [`network`][network filters] | Configures filtering of network attributes. | no |
| [`metrics`][metrics] | Configures which metrics Beyla exposes. | no |
| `metrics` > [`network`][network metrics] | Configures network metrics options for Beyla. | no |
| `traces` | Configures trace collection and sampling options for all services instrumented by the component. | no |
| [`routes`][routes] | Configures the routes to match HTTP paths into user-provided HTTP routes. | no |

The > symbol indicates deeper levels of nesting.
For example, `attributes` > `kubernetes` refers to a `kubernetes` block defined inside an `attributes` block.

[routes]: #routes
[traces]: #traces
[attributes]: #attributes
[kubernetes attributes]: #kubernetes-attributes
[kubernetes services]: #kubernetes-services
[discovery]: #discovery
[services]: #services
[sampler]: #sampler
[instance_id]: #instance_id
[select]: #select
[ebpf]: #ebpf
Expand Down Expand Up @@ -135,7 +139,7 @@ This `kubernetes` block configures the decorating of the metrics and traces with
|----------------------------|----------------|--------------------------------------------------------|---------|----------|
| `cluster_name` | `string` | The name of the Kubernetes cluster. | `""` | no |
| `disable_informers` | `list(string)` | List of Kubernetes informers to disable. | `[]` | no |
| `enable` | `string` | Enable the Kubernetes metadata decoration. | `false` | no |
| `enable` | `string` | Enable the Kubernetes metadata decoration. | `autodetect` | no |
| `informers_resync_period` | `duration` | Period for Kubernetes informers resynchronization. | `"30m"` | no |
| `informers_sync_timeout` | `duration` | Timeout for Kubernetes informers synchronization. | `"30s"` | no |
| `meta_restrict_local_node` | `bool` | Restrict Kubernetes metadata collection to local node. | `false` | no |
Expand Down Expand Up @@ -244,13 +248,14 @@ The `services` block configures the services to discover for the component.
The `exclude_services` block configures the services to exclude for the component.
The `survey` block configures the services that the component will emit information for.

| Name | Type | Description | Default | Required |
|-------------------|----------|---------------------------------------------------------------------------------|---------|----------|
| `name` | `string` | The name of the service to match. | `""` | no |
| `namespace` | `string` | The namespace of the service to match. | `""` | no |
| `open_ports` | `string` | The port of the running service for Beyla automatically instrumented with eBPF. | `""` | no |
| `exe_path` | `string` | The path of the running service for Beyla automatically instrumented with eBPF. | `""` | no |
| `containers_only` | `bool` | Restrict the discovery to processes which are running inside a container. | `false` | no |
| Name | Type | Description | Default | Required |
|-------------------|----------------|---------------------------------------------------------------------------------|---------|----------|
| `name` | `string` | The name of the service to match. | `""` | no |
| `namespace` | `string` | The namespace of the service to match. | `""` | no |
| `open_ports` | `string` | The port of the running service for Beyla automatically instrumented with eBPF. | `""` | no |
| `exe_path` | `string` | The path of the running service for Beyla automatically instrumented with eBPF. | `""` | no |
| `containers_only` | `bool` | Restrict the discovery to processes which are running inside a container. | `false` | no |
| `exports` | `list(string)` | Export modes for the service. Valid values: `"metrics"`, `"traces"`. | `[]` | no |

`exe_path` accepts a regular expression to be matched against the full executable command line, including the directory where the executable resides on the file system.

Expand All @@ -260,6 +265,8 @@ It's used to populate the `service.name` OTel property or the `service_name` Pro
`open_port` accepts a comma-separated list of ports (for example, `80,443`), and port ranges (for example, `8000-8999`).
If the executable matches only one of the ports in the list, it's considered to match the selection criteria.

`exports` specifies what types of telemetry data to export for the matching service. You can specify `"metrics"`, `"traces"`, or both. If empty, the service will export both metrics and traces by default.

If the block is defined as `survey` then the component will discover services but instead of instrumenting them via metrics and traces, it will only emit a `survey_info` metric for each.
This can be helpful in informing external applications of the services available for instrumentation before building out the `service` and `exclude_services` block and telemetry flows through.

Expand Down Expand Up @@ -310,6 +317,112 @@ beyla.ebpf "default" {
}
```



### `traces`

The `traces` block configures trace collection and sampling options for the beyla.ebpf component.

{{< admonition type="note" >}}
To export traces, you must also configure the [`output`][output] block with a `traces` destination. Without an output configuration, traces will be collected but not exported.
{{< /admonition >}}

| Name | Type | Description | Default | Required |
|-------------------|----------------|------------------------------------------------------------------|---------|----------|
| `instrumentations` | `list(string)` | List of instrumentations to enable for trace collection. | `["*"]` | no |

The `traces` block contains the following sub-blocks:

- [`sampler`][sampler] - configures global trace sampling settings. See the [`sampler`][sampler] section for detailed configuration options.
Comment on lines +335 to +337
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For child blocks, this is usually documented in the blocks table (lines 67-89). I'd expect that a child block of traces be added between lines 88 and 89

I've added this as a comment to that section of the table. If this is correct, then lines 334-336 should be deleted.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @clayton-cornell, the thing is the sampler section has the same config block for the block traces and for each invidual discovery service section, so I wanted to avoid repeat the block

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't have to repeat the block. It's defined once (below on lines 369-390). If it's noted as a child block in the block table, then it's all consistent with other component topics that have child blocks in multiple places. We don't note child block hierarchy in the block descriptions... only in the block tables.


#### `instrumentations`

`instrumentations` is a list of instrumentations to enable for trace collection. The following instrumentations are available:

* `*` enables all `instrumentations`. If `*` is present in the list, the other values are ignored.
* `grpc` enables the collection of gRPC traces.
* `gpu` enables the collection of GPU performance traces.
* `http` enables the collection of HTTP/HTTPS/HTTP2 traces.
* `kafka` enables the collection of Kafka client/server traces.
* `mongo` enables the collection of MongoDB database traces.
* `redis` enables the collection of Redis client/server database traces.
* `sql` enables the collection of SQL database client call traces.

Example:

```alloy
beyla.ebpf "default" {
traces {
instrumentations = ["http", "grpc", "sql"]
sampler {
name = "traceidratio"
arg = "0.1" // Global 10% sampling rate for all traces
}
}
output {
traces = [otelcol.processor.batch.default.input]
}
}
```

For per-service sampling configuration, use the `sampler` block within the `discovery` > `services` section instead.

### `sampler`

The `sampler` block configures trace sampling settings. This block can be used in two contexts:

1. **Per-service sampling** - as a sub-block of `discovery` > `services` to configure sampling for individual discovered services
2. **Global sampling** - as a sub-block of `traces` to configure sampling for all traces collected by the component

| Name | Type | Description | Default | Required |
|--------|----------|-------------------------------------------------------------------------|---------|----------|
| `name` | `string` | The name of the sampling strategy to use. | `""` | no |
| `arg` | `string` | The argument for the sampling strategy. | `""` | no |

The following sampling strategies are supported:

* `traceidratio`: Samples traces based on a ratio of trace IDs. The `arg` should be a decimal value between 0 and 1 (e.g., "0.1" for 10% sampling).
* `always_on`: Always samples traces. No `arg` required.
* `always_off`: Never samples traces. No `arg` required.
* `parentbased_always_on`: Uses parent-based sampling that always samples when there's no parent span. This is the default behavior.
* `parentbased_always_off`: Uses parent-based sampling that never samples when there's no parent span.
* `parentbased_traceidratio`: Uses parent-based sampling with trace ID ratio-based sampling for root spans. The `arg` should be a decimal value between 0 and 1.

#### Examples

Per-service sampling (configured within `discovery` > `services`):

```alloy
beyla.ebpf "default" {
discovery {
services {
open_ports = "8080"
sampler {
name = "traceidratio"
arg = "0.1" // 10% sampling rate for this specific service
}
}
}
}
```

Global sampling (configured within `traces`):

```alloy
beyla.ebpf "default" {
traces {
instrumentations = ["http", "grpc", "sql"]
sampler {
name = "traceidratio"
arg = "0.1" // Global 10% sampling rate for all traces
}
}
output {
traces = [otelcol.processor.batch.default.input]
}
}
```

### `ebpf`

The `ebpf` block configures eBPF-specific settings.
Expand Down Expand Up @@ -417,6 +530,8 @@ The `metrics` block configures which metrics Beyla collects.
* `application_process` exports metrics about the processes that run the instrumented application.
* `application_service_graph` exports application-level service graph metrics.
* `application_span` exports application-level metrics in traces span metrics format.
* `application_span_otel` exports OpenTelemetry-compatible span metrics.
* `application_span_sizes` exports span size metrics for trace analysis.
* `application_host` exports application-level host metrics for host-based pricing.
* `network` exports network-level metrics.
* `network_inter_zone` exports network-level inter-zone metrics.
Expand All @@ -425,8 +540,10 @@ The `metrics` block configures which metrics Beyla collects.

* `*` enables all `instrumentations`. If `*` is present in the list, the other values are ignored.
* `grpc` enables the collection of gRPC application metrics.
* `gpu` enables the collection of GPU performance metrics.
* `http` enables the collection of HTTP/HTTPS/HTTP2 application metrics.
* `kafka` enables the collection of Kafka client/server message queue metrics.
* `mongo` enables the collection of MongoDB database metrics.
* `redis` enables the collection of Redis client/server database metrics.
* `sql` enables the collection of SQL database client call metrics.

Expand Down Expand Up @@ -599,11 +716,6 @@ This example gets metrics from `beyla.ebpf` for the specified namespace and Pods

```alloy
beyla.ebpf "default" {
attributes {
kubernetes {
enable = "true"
}
}
discovery {
services {
kubernetes {
Expand Down
16 changes: 11 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ require (
github.com/gorilla/mux v1.8.1
github.com/grafana/alloy-remote-config v0.0.10
github.com/grafana/alloy/syntax v0.1.0
github.com/grafana/beyla/v2 v2.4.3-alloy
github.com/grafana/beyla/v2 v2.5.4
github.com/grafana/catchpoint-prometheus-exporter v0.0.0-20250218151502-6e97feaee761
github.com/grafana/ckit v0.0.0-20250514165824-dd4adf36ad34
github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2
Expand Down Expand Up @@ -168,6 +168,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/tcplogreceiver v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.128.0
github.com/open-telemetry/opentelemetry-ebpf-instrumentation v0.0.0-20250731152014-17260e76c7b8
github.com/oracle/oracle-db-appdev-monitoring v0.0.0-20250516154730-1d8025fde3b0
github.com/ory/dockertest/v3 v3.8.1
github.com/oschwald/geoip2-golang v1.11.0
Expand All @@ -193,7 +194,7 @@ require (
github.com/prometheus/memcached_exporter v0.13.0
github.com/prometheus/mysqld_exporter v0.17.2
github.com/prometheus/node_exporter v1.6.0
github.com/prometheus/procfs v0.16.1
github.com/prometheus/procfs v0.17.0
github.com/prometheus/prometheus v0.304.2 // replaced by a fork of v3.4.2 further down this file
github.com/prometheus/sigv4 v0.2.0
github.com/prometheus/snmp_exporter v0.29.0 // if you update the snmp_exporter version, make sure to update the SNMP_VERSION in _index
Expand Down Expand Up @@ -525,7 +526,7 @@ require (
github.com/channelmeter/iso8601duration v0.0.0-20150204201828-8da3af7a2a61 // indirect
github.com/checkpoint-restore/go-criu/v6 v6.3.0 // indirect
github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect
github.com/cilium/ebpf v0.18.0 // indirect
github.com/cilium/ebpf v0.19.0 // indirect
github.com/cloudflare/circl v1.6.1 // indirect
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 // indirect
github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f // indirect
Expand Down Expand Up @@ -685,7 +686,7 @@ require (
github.com/hodgesds/perf-utils v0.7.0 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/ianlancetaylor/demangle v0.0.0-20250417193237-f615e6bd150b // indirect
github.com/ianlancetaylor/demangle v0.0.0-20250628045327-2d64ad6b7ec5 // indirect
github.com/illumos/go-kstat v0.0.0-20210513183136-173c9b0a9973 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/in-toto/in-toto-golang v0.9.0 // indirect; Update from v0.5.0 to v0.9.0
Expand Down Expand Up @@ -743,7 +744,6 @@ require (
github.com/magefile/mage v1.15.0 // indirect
github.com/magiconair/properties v1.8.10 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/mariomac/guara v0.0.0-20250408105519-1e4dbdfb7136 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
Expand Down Expand Up @@ -950,6 +950,7 @@ require (
go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect
go.etcd.io/etcd/client/v3 v3.5.16 // indirect
go.mongodb.org/mongo-driver v1.17.4 // indirect
go.mongodb.org/mongo-driver/v2 v2.2.2 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/collector v0.128.0 // indirect
Expand Down Expand Up @@ -1113,3 +1114,8 @@ replace go.opentelemetry.io/ebpf-profiler => github.com/grafana/opentelemetry-eb

// TODO - remove this once otel updates to go 1.24 & k8s client 0.33.x
replace k8s.io/client-go => k8s.io/client-go v0.32.6

// Required for Beyla and OBI to work with Grafana's fork of the OpenTelemetry eBPF instrumentation (OBI)
replace go.opentelemetry.io/obi => github.com/grafana/opentelemetry-ebpf-instrumentation v1.1.4

replace github.com/open-telemetry/opentelemetry-ebpf-instrumentation => github.com/grafana/opentelemetry-ebpf-instrumentation v1.1.4
Loading
Loading