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
43 changes: 19 additions & 24 deletions .github/workflows/publish-alloy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,26 +223,6 @@ jobs:
go-version-file: go.mod
cache: false

- name: Download dist
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: dist
path: dist

# Overwrite the original Windows Alloy executable with the signed version
- name: Download signed Windows executable
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: windows-executables-signed
path: .

# Overwrite the original Windows Alloy installer with the signed version
- name: Download signed Windows installer
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: windows-installer-signed
path: dist

# A GitHub App is used to create the release instead of github-actions so that submit-winget-manifest is triggered when the release is published
- name: Get GitHub app secrets
id: get-secrets
Expand All @@ -269,10 +249,25 @@ jobs:
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Download dist
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: dist
path: dist

# Overwrite the original Windows Alloy executable with the signed version
- name: Download signed Windows executable
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: windows-executables-signed
path: .

# Overwrite the original Windows Alloy installer with the signed version
- name: Download signed Windows installer
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: windows-installer-signed
path: dist

- name: Publish
run: |
Expand Down
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal API changes are not present.
Main (unreleased)
-----------------

v1.12.0-rc.1
v1.12.0-rc.2
-----------------

### Breaking changes
Expand Down Expand Up @@ -94,7 +94,7 @@ v1.12.0-rc.1

- `prometheus.exporter.postgres` dependency has been updated to v0.18.1. This includes new `stat_progress_vacuum` and `buffercache_summary` collectors, as well as other bugfixes and enhancements. (@cristiangreco)

- Update Beyla component to 2.7.4. (@grcevski)
- Update Beyla component to 2.7.8. (@grcevski)

- Support delimiters in `stage.luhn`. (@dehaansa)

Expand All @@ -115,6 +115,8 @@ v1.12.0-rc.1

- `kubernetes.discovery` Add support for attaching namespace metadata. (@kgeckhart)

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

### Bugfixes

- Stop `loki.source.kubernetes` discarding log lines with duplicate timestamps. (@ciaranj)
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
##
## Targets for running tests:
##
## test Run tests
## lint Lint code
## integration-test Run integration tests
## test Run tests
## lint Lint code
## integration-test Run integration tests
## integration-test-k8s Run Kubernetes integration tests
##
## Targets for building binaries:
##
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.139.0
PROM_WIN_EXP_VERSION: v0.31.3
SNMP_VERSION: v0.29.0
BEYLA_VERSION: v2.5.8
BEYLA_VERSION: v2.7.8
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.139.0
PROM_WIN_EXP_VERSION: v0.31.3
SNMP_VERSION: v0.29.0
BEYLA_VERSION: v2.5.8
BEYLA_VERSION: v2.7.8
FULL_PRODUCT_NAME: Grafana Alloy
PRODUCT_NAME: Alloy
hero:
Expand Down
17 changes: 17 additions & 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 Expand Up @@ -534,6 +535,8 @@ The `metrics` block configures which metrics Beyla collects.
| `allow_service_graph_self_references` | `bool` | Allow service graph metrics to reference the same service. | `false` | no |
| `features` | `list(string)` | List of features to enable for the metrics. | `["application"]` | no |
| `instrumentations` | `list(string)` | List of instrumentations to enable for the metrics. | `["*"]` | no |
| `extra_resource_labels` | `list(string)` | List of OTEL resource labels to include on `target_info`. | `[]` | no |
| `extra_span_resource_labels` | `list(string)` | List of OTEL resource labels to include on span metrics. | `["k8s.cluster.name", "k8s.namespace.name", "service.version", "deployment.environment"]` | no |

`features` is a list of features to enable for the metrics. The following features are available:

Expand All @@ -558,6 +561,20 @@ The `metrics` block configures which metrics Beyla collects.
* `redis` enables the collection of Redis client/server database metrics.
* `sql` enables the collection of SQL database client call metrics.

`extra_resource_labels` is a list of OTEL resource labels, supplied through the `OTEL_RESOURCE_ATTRIBUTES` environment variable
on the service, that you want to include on the `target_info` metric.

`extra_span_resource_labels` is a list of OTEL resource labels, supplied through the `OTEL_RESOURCE_ATTRIBUTES` environment variable
on the service, that you want to include on the span metrics. The default list includes:

* `k8s.cluster.name`
* `k8s.namespace.name`
* `service.version`
* `deployment.environment`

The default list of `extra_span_resource_labels` is set to match the defaults chosen by Application Observability plugin in
Grafana Cloud.

#### `network` metrics

The `network` block configures network metrics options for Beyla. You must append `network` to the `features` list in the `metrics` block to enable network metrics.
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ require (
github.com/gorilla/mux v1.8.1
github.com/grafana/alloy-remote-config v0.0.12
github.com/grafana/alloy/syntax v0.1.0
github.com/grafana/beyla/v2 v2.7.6
github.com/grafana/beyla/v2 v2.7.8
github.com/grafana/catchpoint-prometheus-exporter v0.0.0-20250218151502-6e97feaee761
github.com/grafana/ckit v0.0.0-20251024151910-87043f5a3cf7
github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2
Expand Down Expand Up @@ -1082,8 +1082,8 @@ exclude (
k8s.io/client-go v12.0.0+incompatible
)

// replace go.opentelemetry.io/obi => github.com/grafana/opentelemetry-ebpf-instrumentation v1.3.7
replace go.opentelemetry.io/obi => github.com/grafana/opentelemetry-ebpf-instrumentation v1.3.7
// replace go.opentelemetry.io/obi => github.com/grafana/opentelemetry-ebpf-instrumentation v1.3.9
replace go.opentelemetry.io/obi => github.com/grafana/opentelemetry-ebpf-instrumentation v1.3.10

replace go.opentelemetry.io/ebpf-profiler => github.com/grafana/opentelemetry-ebpf-profiler v0.0.202546-0.20251106085643-a00a0ef2a84c

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1129,8 +1129,8 @@ github.com/gosnmp/gosnmp v1.41.0 h1:6RI78g2ZsbLvpvJegcV98LapszRQnbvYNKSa5WbCll4=
github.com/gosnmp/gosnmp v1.41.0/go.mod h1:CxVS6bXqmWZlafUj9pZUnQX5e4fAltqPcijxWpCitDo=
github.com/grafana/alloy-remote-config v0.0.12 h1:zyuDgWaXBITD3OFY/LDh0iShDb3ye4Av39u2xY1JY1s=
github.com/grafana/alloy-remote-config v0.0.12/go.mod h1:kHE1usYo2WAVCikQkIXuoG1Clz8BSdiz3kF+DZSCQ4k=
github.com/grafana/beyla/v2 v2.7.6 h1:fqkFSzBpuo81Udn9n2viphAM52LGXl3vXq8eUEqvhAA=
github.com/grafana/beyla/v2 v2.7.6/go.mod h1:isxApXkKInJ+itgn4lDqEfCb0a97TjxWzp1tf+fpWOE=
github.com/grafana/beyla/v2 v2.7.8 h1:GSfv09nOhhbIBP9uR5rEEAwPEpCn9Gq83HR9x2woDfU=
github.com/grafana/beyla/v2 v2.7.8/go.mod h1:isxApXkKInJ+itgn4lDqEfCb0a97TjxWzp1tf+fpWOE=
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 Expand Up @@ -1173,8 +1173,8 @@ github.com/grafana/opentelemetry-collector-contrib/processor/k8sattributesproces
github.com/grafana/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.0.0-20251021125353-73458b01ab23/go.mod h1:7+xyIHr2PJNE9kic/D91c9SMxACdGIGCJykzTcqsYv0=
github.com/grafana/opentelemetry-collector/featuregate v0.0.0-20240325174506-2fd1623b2ca0 h1:i/Ne0XwoRokYj52ZcSmnvuyID3h/uA91n0Ycg/grHU8=
github.com/grafana/opentelemetry-collector/featuregate v0.0.0-20240325174506-2fd1623b2ca0/go.mod h1:mm8+xyQfgDmqhyegZRNIQmoKsNnDTwWKFLsdMoXAb7A=
github.com/grafana/opentelemetry-ebpf-instrumentation v1.3.7 h1:1BIaJoHYtFNCCxW/JCOCAnWR+HyR5ISGkYwtzRb1d8I=
github.com/grafana/opentelemetry-ebpf-instrumentation v1.3.7/go.mod h1:/O9nceaQ+yhwDdosHsQrs1AilAJWAZf2Laa2DssrjJk=
github.com/grafana/opentelemetry-ebpf-instrumentation v1.3.10 h1:35vEGwoeJ379F7J1QejAeqVvD/8KHD5Jhw6/8+wSFJ0=
github.com/grafana/opentelemetry-ebpf-instrumentation v1.3.10/go.mod h1:/O9nceaQ+yhwDdosHsQrs1AilAJWAZf2Laa2DssrjJk=
github.com/grafana/opentelemetry-ebpf-profiler v0.0.202546-0.20251106085643-a00a0ef2a84c h1:I9KB024eev8z9NRJZTcmTw0V0+txKLC6RqPUX3ADO2s=
github.com/grafana/opentelemetry-ebpf-profiler v0.0.202546-0.20251106085643-a00a0ef2a84c/go.mod h1:eXOwk9x2rmJZ9+Ov5ot7NitRWNmF0jynNEeuIDRnK/Q=
github.com/grafana/otel-profiling-go v0.5.1 h1:stVPKAFZSa7eGiqbYuG25VcqYksR6iWvF3YH66t4qL8=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ alertmanager_config: |
smtp_require_tls: true
route:
receiver: "null"
continue: false
routes:
- receiver: testing/alertmgr-config1/null
matchers:
Expand All @@ -29,22 +28,16 @@ alertmanager_config: |
- receiver: testing/alertmgr-config2/database-pager
matchers:
- service="webapp"
continue: false
group_wait: 10s
receivers:
- name: "null"
- name: alloy-namespace/global-config/myreceiver
- name: testing/alertmgr-config1/null
- name: testing/alertmgr-config1/myamc
webhook_configs:
- send_resolved: false
- url: http://test.url
http_config:
follow_redirects: true
enable_http2: true
url: http://test.url
url_file: ""
max_alerts: 0
timeout: 0s
- name: testing/alertmgr-config2/null
- name: testing/alertmgr-config2/database-pager
templates:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ alertmanager_config: |
smtp_require_tls: true
route:
receiver: "null"
continue: false
routes:
- receiver: testing/alertmgr-config1/null
matchers:
Expand All @@ -27,13 +26,8 @@ alertmanager_config: |
- name: testing/alertmgr-config1/null
- name: testing/alertmgr-config1/myamc
webhook_configs:
- send_resolved: false
- url: http://test.url
http_config:
follow_redirects: true
enable_http2: true
url: http://test.url
url_file: ""
max_alerts: 0
timeout: 0s
templates:
- default_template
3 changes: 3 additions & 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 Expand Up @@ -117,6 +118,8 @@ type Metrics struct {
Instrumentations []string `alloy:"instrumentations,attr,optional"`
AllowServiceGraphSelfReferences bool `alloy:"allow_service_graph_self_references,attr,optional"`
Network Network `alloy:"network,block,optional"`
ExtraResourceLabels []string `alloy:"extra_resource_labels,attr,optional"`
ExtraSpanResourceLabels []string `alloy:"extra_span_resource_labels,attr,optional"`
}

type Traces struct {
Expand Down
9 changes: 9 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 Expand Up @@ -444,6 +447,12 @@ func (args Metrics) Convert() prom.PrometheusConfig {
p.Instrumentations = args.Instrumentations
}
p.AllowServiceGraphSelfReferences = args.AllowServiceGraphSelfReferences
if args.ExtraResourceLabels != nil {
p.ExtraResourceLabels = args.ExtraResourceLabels
}
if args.ExtraSpanResourceLabels != nil {
p.ExtraSpanResourceLabels = args.ExtraSpanResourceLabels
}
return p
}

Expand Down
25 changes: 25 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 Expand Up @@ -821,16 +825,37 @@ func TestConvert_Prometheus(t *testing.T) {
Features: []string{"application", "network"},
Instrumentations: []string{"redis", "sql"},
AllowServiceGraphSelfReferences: true,
ExtraResourceLabels: nil,
ExtraSpanResourceLabels: []string{"service.version"},
}

expectedConfig := beyla.DefaultConfig.Prometheus
expectedConfig.Features = args.Features
expectedConfig.Instrumentations = args.Instrumentations
expectedConfig.AllowServiceGraphSelfReferences = true
expectedConfig.ExtraSpanResourceLabels = args.ExtraSpanResourceLabels

config := args.Convert()

require.Equal(t, expectedConfig, config)

args = Metrics{
Features: []string{"application", "network"},
Instrumentations: []string{"redis", "sql"},
AllowServiceGraphSelfReferences: true,
ExtraResourceLabels: []string{"service.version"},
}

expectedConfig = beyla.DefaultConfig.Prometheus
expectedConfig.Features = args.Features
expectedConfig.Instrumentations = args.Instrumentations
expectedConfig.AllowServiceGraphSelfReferences = true
expectedConfig.ExtraResourceLabels = args.ExtraResourceLabels
expectedConfig.ExtraSpanResourceLabels = []string{"k8s.cluster.name", "k8s.namespace.name", "service.version", "deployment.environment"}

config = args.Convert()

require.Equal(t, expectedConfig, config)
}

func TestConvert_Network(t *testing.T) {
Expand Down
8 changes: 3 additions & 5 deletions internal/component/mimir/alerts/kubernetes/alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import (
"time"

"github.com/go-kit/log"
alertmgr_cfg "github.com/grafana/alloy/internal/mimir/alertmanager"
"github.com/grafana/dskit/backoff"
alertmgr_cfg "github.com/prometheus/alertmanager/config"
coreListers "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/util/workqueue"
_ "k8s.io/component-base/metrics/prometheus/workqueue"
controller "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/yaml"

"github.com/grafana/alloy/internal/component"
"github.com/grafana/alloy/internal/component/mimir/util"
Expand Down Expand Up @@ -230,13 +229,12 @@ func (c *Component) Startup(ctx context.Context) error {
return err
}

var baseCfg alertmgr_cfg.Config
err = yaml.Unmarshal([]byte(c.args.GlobalConfig), &baseCfg)
baseCfg, err := alertmgr_cfg.Unmarshal([]byte(c.args.GlobalConfig))
if err != nil {
return fmt.Errorf("failed to unmarshal global config: %w", err)
}

c.eventProcessor = c.newEventProcessor(queue, informerStopChan, namespaceLister, cfgLister, baseCfg)
c.eventProcessor = c.newEventProcessor(queue, informerStopChan, namespaceLister, cfgLister, *baseCfg)

go c.eventProcessor.run(ctx)
return nil
Expand Down
Loading
Loading