Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -19,6 +19,8 @@ Main (unreleased)

- update promtail converter to use `file_match` block for `loki.source.file` instead of going through `local.file_match`. (@kalleep)

- Add `meta_cache_address` to `beyla.ebpf` component. (@skl)

### Bugfixes

- `loki.source.api` no longer drops request when relabel rules drops a specific stream. (@kalleep)
Expand Down
1 change: 1 addition & 0 deletions docs/sources/reference/components/beyla/beyla.ebpf.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ This `kubernetes` block configures the decorating of the metrics and traces with
| `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_cache_address` | `string` | Address of the Kubernetes metadata cache service. | `""` | no |
| `meta_restrict_local_node` | `bool` | Restrict Kubernetes metadata collection to local node. | `false` | no |

If `cluster_name` isn't set, Beyla tries to detect the cluster name from the Kubernetes API.
Expand Down
1 change: 1 addition & 0 deletions internal/component/beyla/ebpf/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type KubernetesDecorator struct {
InformersResyncPeriod time.Duration `alloy:"informers_resync_period,attr,optional"`
DisableInformers []string `alloy:"disable_informers,attr,optional"`
MetaRestrictLocalNode bool `alloy:"meta_restrict_local_node,attr,optional"`
MetaCacheAddress string `alloy:"meta_cache_address,attr,optional"`
}

type InstanceIDConfig struct {
Expand Down
3 changes: 3 additions & 0 deletions internal/component/beyla/ebpf/beyla_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ func (args Attributes) Convert() beyla.Attributes {
attrs.Kubernetes.DisableInformers = args.Kubernetes.DisableInformers
attrs.Kubernetes.MetaRestrictLocalNode = args.Kubernetes.MetaRestrictLocalNode
attrs.Kubernetes.ClusterName = args.Kubernetes.ClusterName
if args.Kubernetes.MetaCacheAddress != "" {
attrs.Kubernetes.MetaCacheAddress = args.Kubernetes.MetaCacheAddress
}
// InstanceID
if args.InstanceID.HostnameDNSResolution {
attrs.InstanceID.HostnameDNSResolution = args.InstanceID.HostnameDNSResolution
Expand Down
4 changes: 4 additions & 0 deletions internal/component/beyla/ebpf/beyla_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func TestArguments_UnmarshalSyntax(t *testing.T) {
cluster_name = "test"
disable_informers = ["node"]
meta_restrict_local_node = true
meta_cache_address = "localhost:9090"
}
select {
attr = "sql_client_duration"
Expand Down Expand Up @@ -159,6 +160,7 @@ func TestArguments_UnmarshalSyntax(t *testing.T) {
require.Equal(t, "test", cfg.Attributes.Kubernetes.ClusterName)
require.Equal(t, []string{"node"}, cfg.Attributes.Kubernetes.DisableInformers)
require.True(t, cfg.Attributes.Kubernetes.MetaRestrictLocalNode)
require.Equal(t, "localhost:9090", cfg.Attributes.Kubernetes.MetaCacheAddress)
require.Len(t, cfg.Attributes.Select, 1)
sel, ok := cfg.Attributes.Select["sql_client_duration"]
require.True(t, ok)
Expand Down Expand Up @@ -701,6 +703,7 @@ func TestConvert_Attributes(t *testing.T) {
Kubernetes: KubernetesDecorator{
Enable: "true",
InformersSyncTimeout: 15 * time.Second,
MetaCacheAddress: "localhost:9090",
},
Select: Selections{
{
Expand All @@ -720,6 +723,7 @@ func TestConvert_Attributes(t *testing.T) {
InformersSyncTimeout: 15 * time.Second,
InformersResyncPeriod: 30 * time.Minute,
ResourceLabels: beyla.DefaultConfig.Attributes.Kubernetes.ResourceLabels,
MetaCacheAddress: "localhost:9090",
},
HostID: beyla.HostIDConfig{
FetchTimeout: 500 * time.Millisecond,
Expand Down
Loading