I am using Prometheus to monitor a Kubernetes cluster. Prometheus has been deployed using the CoreOS
Prometheus-Operator and
Kube-Prometheus.
I have used the ServiceMonitor to deploy a metric_relabel_config as follows.
kind: ServiceMonitor
metadata:
labels:
k8s-app: node-exporter
name: node-exporter
namespace: monitoring
spec:
endpoints:
interval: 30s
port: https
scheme: https
tlsConfig:
insecureSkipVerify: true
metricRelabelings:
- sourceLabels: [__meta_kubernetes_pod_node_name]
targetLabel: hostname
regex: (\w+).*
replacement: $1
jobLabel: k8s-app
namespaceSelector:
matchNames:
- monitoring
selector:
matchLabels:
k8s-app: node-exporter
This is mapping fine into Prometheus as follows:
metric_relabel_configs:
- source_labels: [__meta_kubernetes_pod_node_name]
separator: ;
regex: (\w+).*
target_label: hostname
replacement: $1
action: replaceBecause these are done at ingestion time I didn't expect to see the new label on the <server>/service-discovery or /targets. is that correct?
What I did expect was the ability to query using the new label.
avg(node_load1) by (hostname)
The above query returns a single chart for "{}"
Am I missing some aspect of this process?