From b3dc302bbfb740b3006eb2ce83188a84bcc88c5f Mon Sep 17 00:00:00 2001 From: Andre Ziviani Date: Thu, 6 Nov 2025 16:06:30 -0300 Subject: [PATCH 1/2] feat: pyroscope.enrich component --- CHANGELOG.md | 4 + .../sources/reference/compatibility/_index.md | 3 + .../components/pyroscope/pyroscope.enrich.md | 178 +++++++++++++++ internal/component/all/all.go | 1 + internal/component/pyroscope/enrich/enrich.go | 202 +++++++++++++++++ .../component/pyroscope/enrich/enrich_test.go | 208 ++++++++++++++++++ 6 files changed, 596 insertions(+) create mode 100644 docs/sources/reference/components/pyroscope/pyroscope.enrich.md create mode 100644 internal/component/pyroscope/enrich/enrich.go create mode 100644 internal/component/pyroscope/enrich/enrich_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 8af2963346b..98af6e5a68e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,11 @@ Main (unreleased) ### Features - A new `mimir.alerts.kubernetes` component which discovers `AlertmanagerConfig` Kubernetes resources and loads them into a Mimir instance. (@ptodev) + - Mark `stage.windowsevent` block in the `loki.process` component as GA. (@kgeckhart) +- (_Experimental_) Add `pyroscope.enrich` component to enrich profiles using labels from `discovery.*` components. (@AndreZiviani) + ### Enhancements - update promtail converter to use `file_match` block for `loki.source.file` instead of going through `local.file_match`. (@kalleep) @@ -93,6 +96,7 @@ v1.12.0-rc.0 - The `otelcol.processor.servicegraph` component now supports defining the maximum number of buckets for generated exponential histograms. - See the upstream [core][https://github.com/open-telemetry/opentelemetry-collector/blob/v0.139.0/CHANGELOG.md] and [contrib][https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.139.0/CHANGELOG.md] changelogs for more details. + ### Enhancements - Add per-application rate limiting with the `strategy` attribute in the `faro.receiver` component, to prevent one application from consuming the rate limit quota of others. (@hhertout) diff --git a/docs/sources/reference/compatibility/_index.md b/docs/sources/reference/compatibility/_index.md index a60e33099a6..5d09be2cc5a 100644 --- a/docs/sources/reference/compatibility/_index.md +++ b/docs/sources/reference/compatibility/_index.md @@ -159,6 +159,7 @@ The following components, grouped by namespace, _consume_ Targets. {{< collapse title="pyroscope" >}} - [pyroscope.ebpf](../components/pyroscope/pyroscope.ebpf) +- [pyroscope.enrich](../components/pyroscope/pyroscope.enrich) - [pyroscope.java](../components/pyroscope/pyroscope.java) - [pyroscope.scrape](../components/pyroscope/pyroscope.scrape) {{< /collapse >}} @@ -422,6 +423,7 @@ The following components, grouped by namespace, _export_ Pyroscope `ProfilesRece {{< collapse title="pyroscope" >}} +- [pyroscope.enrich](../components/pyroscope/pyroscope.enrich) - [pyroscope.relabel](../components/pyroscope/pyroscope.relabel) - [pyroscope.write](../components/pyroscope/pyroscope.write) {{< /collapse >}} @@ -437,6 +439,7 @@ The following components, grouped by namespace, _consume_ Pyroscope `ProfilesRec {{< collapse title="pyroscope" >}} - [pyroscope.ebpf](../components/pyroscope/pyroscope.ebpf) +- [pyroscope.enrich](../components/pyroscope/pyroscope.enrich) - [pyroscope.java](../components/pyroscope/pyroscope.java) - [pyroscope.receive_http](../components/pyroscope/pyroscope.receive_http) - [pyroscope.relabel](../components/pyroscope/pyroscope.relabel) diff --git a/docs/sources/reference/components/pyroscope/pyroscope.enrich.md b/docs/sources/reference/components/pyroscope/pyroscope.enrich.md new file mode 100644 index 00000000000..6ea115b35ce --- /dev/null +++ b/docs/sources/reference/components/pyroscope/pyroscope.enrich.md @@ -0,0 +1,178 @@ +--- +canonical: https://grafana.com/docs/alloy/latest/reference/components/pyroscope/pyroscope.enrich/ +description: Learn about pyroscope.enrich +labels: + stage: experimental + products: + - oss +title: pyroscope.enrich +--- + +# `pyroscope.enrich` + +{{< docs/shared lookup="stability/experimental.md" source="alloy" version="" >}} + +`pyroscope.enrich` enriches profiles with additional labels from service discovery targets. +It matches a label from incoming profiles against a label from discovered targets, and copies specified labels from the matched target to the profile. + +## Usage + +```alloy +pyroscope.enrich "