Skip to content

Commit c619c4e

Browse files
rafaelroquettotowolf
authored andcommitted
Fix attribute name in Beyla configuration. (grafana#2966)
1 parent c3da0bc commit c619c4e

4 files changed

Lines changed: 21 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ Main (unreleased)
3939
- `query_sample`: better handling of truncated queries (@cristiangreco)
4040
- `query_sample`: add option to use TiDB sql parser (@cristiangreco)
4141

42+
### Breaking changes
43+
44+
- Fixed the parsing of selections, application and network filter blocks for Beyla
45+
4246
### Other changes
4347

4448
- Upgrading to Prometheus v2.55.1. (@ptodev)

docs/sources/reference/components/beyla/beyla.ebpf.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ The `instance_id` block configures instance ID settings.
155155
#### `select`
156156

157157
The `select` block configures which attributes to include or exclude for specific metric/trace sections.
158-
Each selected attribute is defined as a labeled block with the attribute name as the label.
159158

160159
| Name | Type | Description | Default | Required |
161160
| --------- | -------------- | ------------------------------------------------------ | ------- | -------- |
161+
| `attr` | `string` | The attribute name to select. | `[]` | yes |
162162
| `exclude` | `list(string)` | List of attributes to exclude. | `[]` | no |
163163
| `include` | `list(string)` | List of attributes to include. Use `*` to include all. | `[]` | no |
164164

@@ -245,10 +245,11 @@ It contains the following blocks:
245245

246246
#### `application`
247247

248-
The `application` block configures filtering of application attributes. Each attribute filter is defined as a labeled block with the attribute name as the label.
248+
The `application` block configures filtering of application attributes.
249249

250-
| Name | Type | Description | Required |
251-
| ----------- | -------- | ---------------------------------------------------- | -------- |
250+
| Name | Type | Description | Required |
251+
| ----------- | -------- | -----------------------------------------| -------- |
252+
| `attr` | `string` | The name of the attribute to match. | yes |
252253
| `match` | `string` | String to match attribute values. | no |
253254
| `not_match` | `string` | String to exclude matching values. | no |
254255

@@ -258,10 +259,11 @@ wildcards).
258259

259260
#### `network` filters
260261

261-
The `network` block configures filtering of network attributes. Each attribute filter is defined as a labeled block with the attribute name as the label.
262+
The `network` block configures filtering of network attributes.
262263

263-
| Name | Type | Description | Required |
264-
| ----------- | -------- | ---------------------------------------------------- | -------- |
264+
| Name | Type | Description | Required |
265+
| ----------- | -------- | ---------------------------------------- | -------- |
266+
| `attr` | `string` | The name of the attribute to match. | yes |
265267
| `match` | `string` | String to match attribute values. | no |
266268
| `not_match` | `string` | String to exclude matching values. | no |
267269

internal/component/beyla/ebpf/args.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type InstanceIDConfig struct {
5757
type Selections []Selection
5858

5959
type Selection struct {
60-
Section string `alloy:",label"`
60+
Section string `alloy:"attr,attr"`
6161
Include []string `alloy:"include,attr"`
6262
Exclude []string `alloy:"exclude,attr"`
6363
}
@@ -132,7 +132,7 @@ type Filters struct {
132132
type AttributeFamilies []AttributeFamily
133133

134134
type AttributeFamily struct {
135-
Attr string `alloy:",label"`
135+
Attr string `alloy:"attr,attr"`
136136
Match string `alloy:"match,attr,optional"`
137137
NotMatch string `alloy:"not_match,attr,optional"`
138138
}

internal/component/beyla/ebpf/beyla_linux_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ func TestArguments_UnmarshalSyntax(t *testing.T) {
3939
disable_informers = ["node"]
4040
meta_restrict_local_node = true
4141
}
42-
select "sql_client_duration" {
42+
select {
43+
attr = "sql_client_duration"
4344
include = ["*"]
4445
exclude = ["db_statement"]
4546
}
@@ -97,10 +98,12 @@ func TestArguments_UnmarshalSyntax(t *testing.T) {
9798
heuristic_sql_detect = true
9899
}
99100
filters {
100-
application "transport" {
101+
application {
102+
attr = "transport"
101103
not_match = "UDP"
102104
}
103-
network "dst_port" {
105+
network {
106+
attr = "dst_port"
104107
match = "53"
105108
}
106109
}

0 commit comments

Comments
 (0)