Skip to content

Commit a643ed2

Browse files
szibisTylerHelmuth
andauthored
fix(kube-stack): extend MetricRelabeling schema (#2071)
* fix(kube-stack): extend MetricRelabeling schema to support full Prometheus relabel_config The MetricRelabeling schema was too restrictive, only allowing action, regex, and sourceLabels properties. This prevented using standard Prometheus relabel_config features like targetLabel and replacement for label transformation use cases. Changes: - Add missing fields to MetricRelabeling: targetLabel, replacement, separator, modulus - Remove incorrect required constraint (different actions need different fields) - Align KubeServiceMonitor relabeling fields to use MetricRelabeling schema - Align Monitor.relabelings to use MetricRelabeling schema for consistency This enables use cases like: metricRelabelings: - sourceLabels: [namespace] targetLabel: k8s.namespace.name action: replace Affected components now properly support full relabel_config: - kube-state-metrics.prometheus.monitor.metricRelabelings - kubeApiServer.serviceMonitor.metricRelabelings - prometheus-node-exporter.prometheus.monitor.metricRelabelings - All KubeServiceMonitor relabeling fields - All Monitor relabeling fields * chore(kube-stack): bump chart version to 0.13.2 --------- Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
1 parent 6118b15 commit a643ed2

2 files changed

Lines changed: 28 additions & 11 deletions

File tree

charts/opentelemetry-kube-stack/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: opentelemetry-kube-stack
3-
version: 0.14.0
3+
version: 0.14.1
44
description: |
55
OpenTelemetry Quickstart chart for Kubernetes.
66
Installs an operator and collector for an easy way to get started with Kubernetes observability.

charts/opentelemetry-kube-stack/values.schema.json

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3819,11 +3819,15 @@
38193819
},
38203820
"metricRelabelings": {
38213821
"type": "array",
3822-
"items": {}
3822+
"items": {
3823+
"$ref": "#/$defs/MetricRelabeling"
3824+
}
38233825
},
38243826
"relabelings": {
38253827
"type": "array",
3826-
"items": {}
3828+
"items": {
3829+
"$ref": "#/$defs/MetricRelabeling"
3830+
}
38273831
},
38283832
"additionalLabels": {
38293833
"$ref": "#/$defs/AdditionalLabels"
@@ -3860,11 +3864,15 @@
38603864
},
38613865
"dnsmasqMetricRelabelings": {
38623866
"type": "array",
3863-
"items": {}
3867+
"items": {
3868+
"$ref": "#/$defs/MetricRelabeling"
3869+
}
38643870
},
38653871
"dnsmasqRelabelings": {
38663872
"type": "array",
3867-
"items": {}
3873+
"items": {
3874+
"$ref": "#/$defs/MetricRelabeling"
3875+
}
38683876
},
38693877
"scheme": {
38703878
"type": "string"
@@ -3982,7 +3990,9 @@
39823990
},
39833991
"relabelings": {
39843992
"type": "array",
3985-
"items": {}
3993+
"items": {
3994+
"$ref": "#/$defs/MetricRelabeling"
3995+
}
39863996
},
39873997
"jobLabel": {
39883998
"type": "string"
@@ -4022,13 +4032,20 @@
40224032
"items": {
40234033
"type": "string"
40244034
}
4035+
},
4036+
"targetLabel": {
4037+
"type": "string"
4038+
},
4039+
"replacement": {
4040+
"type": "string"
4041+
},
4042+
"separator": {
4043+
"type": "string"
4044+
},
4045+
"modulus": {
4046+
"type": "integer"
40254047
}
40264048
},
4027-
"required": [
4028-
"action",
4029-
"regex",
4030-
"sourceLabels"
4031-
],
40324049
"title": "MetricRelabeling"
40334050
},
40344051
"Selector": {

0 commit comments

Comments
 (0)