diff --git a/charts/k8s-monitoring/destinations/prometheus-values.yaml b/charts/k8s-monitoring/destinations/prometheus-values.yaml index 58fd30e71..4142dfc36 100644 --- a/charts/k8s-monitoring/destinations/prometheus-values.yaml +++ b/charts/k8s-monitoring/destinations/prometheus-values.yaml @@ -42,6 +42,7 @@ extraLabels: {} # All values are treated as raw strings and not quoted. # @section -- General extraLabelsFrom: {} + # -- Rule blocks to apply to all metrics. Uses the [write_relabel_config block](https://grafana.com/docs/alloy/latest/reference/components/prometheus.remote_write/#write_relabel_config-block) # of the prometheus.remote_write component. Format: # write_relabel_config { diff --git a/charts/k8s-monitoring/destinations/pyroscope-values.yaml b/charts/k8s-monitoring/destinations/pyroscope-values.yaml index 376893aa2..6c1ec22ba 100644 --- a/charts/k8s-monitoring/destinations/pyroscope-values.yaml +++ b/charts/k8s-monitoring/destinations/pyroscope-values.yaml @@ -34,6 +34,15 @@ extraHeaders: {} # @section -- General extraHeadersFrom: {} +# -- Extra labels to be added to all profiles before delivering to the destination. +# All values are treated as strings and automatically quoted. +# @section -- General +extraLabels: {} +# -- Extra labels to be added to all profiles using a dynamic reference before delivering to the destination. +# All values are treated as raw strings and not quoted. +# @section -- General +extraLabelsFrom: {} + auth: # -- The type of authentication to do. # Options are "none" (default), "basic", "bearerToken". diff --git a/charts/k8s-monitoring/docs/destinations/pyroscope.md b/charts/k8s-monitoring/docs/destinations/pyroscope.md index 861f426ee..c9d8d44c0 100644 --- a/charts/k8s-monitoring/docs/destinations/pyroscope.md +++ b/charts/k8s-monitoring/docs/destinations/pyroscope.md @@ -54,6 +54,8 @@ This defines the options for defining a destination for profiles that use the Py |-----|------|---------|-------------| | extraHeaders | object | `{}` | Extra headers to be set when sending data. All values are treated as strings and automatically quoted. | | extraHeadersFrom | object | `{}` | Extra headers to be set when sending data through a dynamic reference. All values are treated as raw strings and not quoted. | +| extraLabels | object | `{}` | Extra labels to be added to all profiles before delivering to the destination. All values are treated as strings and automatically quoted. | +| extraLabelsFrom | object | `{}` | Extra labels to be added to all profiles using a dynamic reference before delivering to the destination. All values are treated as raw strings and not quoted. | | name | string | `""` | The name for this Pyroscope destination. | | proxyURL | string | `""` | The Proxy URL for the Pyroscope destination. | | tenantId | string | `""` | The tenant ID for the Pyroscope destination. | diff --git a/charts/k8s-monitoring/schema-mods/definitions/pyroscope-destination.schema.json b/charts/k8s-monitoring/schema-mods/definitions/pyroscope-destination.schema.json index 9a0320527..c9257345d 100644 --- a/charts/k8s-monitoring/schema-mods/definitions/pyroscope-destination.schema.json +++ b/charts/k8s-monitoring/schema-mods/definitions/pyroscope-destination.schema.json @@ -89,6 +89,12 @@ "extraHeadersFrom": { "type": "object" }, + "extraLabels": { + "type": "object" + }, + "extraLabelsFrom": { + "type": "object" + }, "name": { "type": "string" }, diff --git a/charts/k8s-monitoring/templates/destinations/_destination_pyroscope.tpl b/charts/k8s-monitoring/templates/destinations/_destination_pyroscope.tpl index 7e9973547..cf965f801 100644 --- a/charts/k8s-monitoring/templates/destinations/_destination_pyroscope.tpl +++ b/charts/k8s-monitoring/templates/destinations/_destination_pyroscope.tpl @@ -84,6 +84,12 @@ pyroscope.write {{ include "helper.alloy_name" .name | quote }} { external_labels = { cluster = {{ $.Values.cluster.name | quote }}, k8s_cluster_name = {{ $.Values.cluster.name | quote }}, + {{- range $key, $value := .extraLabels }} + {{ $key }} = {{ $value | quote }}, + {{- end }} + {{- range $key, $value := .extraLabelsFrom }} + {{ $key }} = {{ $value }}, + {{- end }} } } {{- end }} diff --git a/charts/k8s-monitoring/values.schema.json b/charts/k8s-monitoring/values.schema.json index ffa103a55..1351e0de7 100644 --- a/charts/k8s-monitoring/values.schema.json +++ b/charts/k8s-monitoring/values.schema.json @@ -2044,6 +2044,12 @@ "extraHeadersFrom": { "type": "object" }, + "extraLabels": { + "type": "object" + }, + "extraLabelsFrom": { + "type": "object" + }, "name": { "type": "string" },