Skip to content

beyla.ebpf: wire in survey fields #3876

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

Merged
merged 18 commits into from
Jun 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

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 @@ -33,6 +33,8 @@ Main (unreleased)

- Update secret-filter gitleaks.toml from v8.19.0 to v8.26.0 (@andrejshapal)

- Wire in survey block for beyla.ebpf component. (@grcevski, @tpaschalis)

### Bugfixes

- Fix the `validate` command not understanding the `livedebugging` block. (@dehaansa)
Expand Down
8 changes: 7 additions & 1 deletion docs/sources/reference/components/beyla/beyla.ebpf.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ 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` > [`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 |
| [`filters`][filters] | Configures filtering of attributes. | no |
| `filters` > [`application`][application filters] | Configures filtering of application attributes. | no |
Expand Down Expand Up @@ -237,9 +239,10 @@ In some scenarios, Beyla instruments a wide variety of services, such as a Kuber
The `services` block allows you to filter the services to instrument based on their metadata. If you specify other selectors in the same services entry,
the instrumented processes need to match all the selector properties.

The same properties are available for both `services` and `exclude_services` blocks.
The same properties are available for both `services`, `exclude_services`, and `survey` blocks.
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 |
| ----------------- | -------- | ------------------------------------------------------------------------------- | ------- | -------- |
Expand All @@ -257,6 +260,9 @@ 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.

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.

#### `default_exclude_services`

The `default_exclude_services` is special services block that disables instrumentation of Grafana Alloy. The default value for `exe_path` is `"(?:^|\/)(beyla$|alloy$|otelcol[^\/]*$)"`.
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,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.2.5-alloy
github.com/grafana/beyla/v2 v2.4.3-alloy
github.com/grafana/catchpoint-prometheus-exporter v0.0.0-20250218151502-6e97feaee761
github.com/grafana/ckit v0.0.0-20250226083311-4f9f4aacabb5
github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2
Expand Down Expand Up @@ -120,7 +120,6 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/loadbalancingexporter v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.128.0
Expand Down Expand Up @@ -158,7 +157,6 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/solacereceiver v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/splunkhecreceiver v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/tcplogreceiver v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver v0.128.0
Expand Down Expand Up @@ -276,7 +274,7 @@ require (
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b
golang.org/x/net v0.40.0
golang.org/x/oauth2 v0.30.0
golang.org/x/sync v0.14.0 // indirect
golang.org/x/sync v0.14.0
golang.org/x/sys v0.33.0
golang.org/x/text v0.25.0
golang.org/x/time v0.11.0
Expand Down Expand Up @@ -768,7 +766,6 @@ require (
github.com/oapi-codegen/runtime v1.1.1 // indirect
github.com/ohler55/ojg v1.20.1 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/extension/ackextension v0.128.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.128.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.128.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.128.0 // indirect
Expand All @@ -780,7 +777,6 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.128.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.128.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.128.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.128.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.128.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.128.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/core/xidutils v0.128.0 // indirect
Expand Down Expand Up @@ -986,6 +982,8 @@ require (

require (
github.com/buger/jsonparser v1.1.1
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter v0.128.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/splunkhecreceiver v0.128.0
github.com/oracle/oracle-db-appdev-monitoring v0.0.0-20250516154730-1d8025fde3b0
go.opentelemetry.io/collector/config/configoptional v0.128.0
)
Expand All @@ -1008,6 +1006,8 @@ require (
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/moby/go-archive v0.1.0 // indirect
github.com/moby/sys/atomicwriter v0.1.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/extension/ackextension v0.128.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.128.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/faro v0.128.0 // indirect
github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 // indirect
github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 // indirect
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,6 @@ github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004 h1:lkAMpLVBDaj17e85keuznYcH5rqI438v41pKcBl4ZxQ=
github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA=
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0=
github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs=
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 h1:F1EaeKL/ta07PY/k9Os/UFtwERei2/XzGemhpGnBKNg=
Expand Down Expand Up @@ -1388,8 +1386,8 @@ github.com/gosnmp/gosnmp v1.39.0/go.mod h1:CxVS6bXqmWZlafUj9pZUnQX5e4fAltqPcijxW
github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
github.com/grafana/alloy-remote-config v0.0.10 h1:1Ge7lz2mjXI1rd6SmiZpFHyXeLehBuCi43+XTkdqgV4=
github.com/grafana/alloy-remote-config v0.0.10/go.mod h1:kHE1usYo2WAVCikQkIXuoG1Clz8BSdiz3kF+DZSCQ4k=
github.com/grafana/beyla/v2 v2.2.5-alloy h1:X9cocvwEgVmH/Ggcv8DliVEZCel3YcI+jaB58D98L1Q=
github.com/grafana/beyla/v2 v2.2.5-alloy/go.mod h1:f9voufRxhDpwIi+MwB/hB6II+RKolln8V+KK5w4YOF4=
github.com/grafana/beyla/v2 v2.4.3-alloy h1:21OzDBCsTbbsLzbTgsEyBqZdH0AOC/0PNfcNt0oHT5Y=
github.com/grafana/beyla/v2 v2.4.3-alloy/go.mod h1:CYYhU1lLPfVQsNB+edeX9+fT8bWF6ofPHe6W6yklvMU=
github.com/grafana/cadvisor v0.0.0-20240729082359-1f04a91701e2 h1:ju6EcY2aEobeBg185ETtFCKj5WzaQ48qfkbsSRRQrF4=
github.com/grafana/cadvisor v0.0.0-20240729082359-1f04a91701e2/go.mod h1:8sLW/G7rcFe1CKMaA4pYT4mX3P1xQVGqM6luzEzx/2g=
github.com/grafana/catchpoint-prometheus-exporter v0.0.0-20250218151502-6e97feaee761 h1:dPJOIEwtQ8uR3Qa79pb/lsSFJQ6j4P9vpCUQ4fKimG4=
Expand Down
3 changes: 2 additions & 1 deletion internal/component/beyla/ebpf/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ type KubernetesService struct {
}

type Discovery struct {
Services Services `alloy:"services,block"`
Services Services `alloy:"services,block,optional"`
ExcludeServices Services `alloy:"exclude_services,block,optional"`
DefaultExcludeServices Services `alloy:"default_exclude_services,block,optional"`
Survey Services `alloy:"survey,block,optional"`
SkipGoSpecificTracers bool `alloy:"skip_go_specific_tracers,attr,optional"`
ExcludeOTelInstrumentedServices bool `alloy:"exclude_otel_instrumented_services,attr,optional"`
}
Expand Down
Loading