Skip to content

Commit

Permalink
Add the ability to specify extra labels for profiles
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <pete.wall@grafana.com>
  • Loading branch information
petewall committed Jan 8, 2025
1 parent ddc20ba commit d95d8c1
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/k8s-monitoring/destinations/prometheus-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 9 additions & 0 deletions charts/k8s-monitoring/destinations/pyroscope-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
2 changes: 2 additions & 0 deletions charts/k8s-monitoring/docs/destinations/pyroscope.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@
"extraHeadersFrom": {
"type": "object"
},
"extraLabels": {
"type": "object"
},
"extraLabelsFrom": {
"type": "object"
},
"name": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/k8s-monitoring/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,12 @@
"extraHeadersFrom": {
"type": "object"
},
"extraLabels": {
"type": "object"
},
"extraLabelsFrom": {
"type": "object"
},
"name": {
"type": "string"
},
Expand Down

0 comments on commit d95d8c1

Please # to comment.