diff --git a/CHANGES.md b/CHANGES.md index c3ea6c19..2354fb65 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,10 @@ Notable changes between versions. * Switch Kubernetes Container Runtime from `docker` to `containerd` ([#1087](https://github.com/poseidon/typhoon/pull/1087)) +### Addons + +* Configure Prometheus to allow a custom scrape query parameter ([#1095](https://github.com/poseidon/typhoon/pull/1095)) + ## v1.23.0 * Kubernetes [v1.23.0](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.23.md#v1230) diff --git a/addons/prometheus/config.yaml b/addons/prometheus/config.yaml index 8d693ad5..4d98a359 100644 --- a/addons/prometheus/config.yaml +++ b/addons/prometheus/config.yaml @@ -175,6 +175,7 @@ data: # * `prometheus.io/path`: If the metrics path is not `/metrics` override this. # * `prometheus.io/port`: If the metrics are exposed on a different port to the # service then set this appropriately. + # * `prometheus.io/param`: Custom metrics query parameter, like "format=prometheus". - job_name: 'kubernetes-service-endpoints' kubernetes_sd_configs: - role: endpoints @@ -197,6 +198,11 @@ data: target_label: __address__ regex: ([^:]+)(?::\d+)?;(\d+) replacement: $1:$2 + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_param] + action: replace + target_label: __param_$1 + regex: ([^=]+)=(.*) + replacement: $2 - action: labelmap regex: __meta_kubernetes_service_label_(.+) - source_labels: [__meta_kubernetes_namespace]