You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a bunch of K8S NameSpaces (each for a separate customer). Each NameSpace (NS) has a label CLIENT_DEPLOYMENT_NAME with a different value. Let's say:
ns1 - CLIENT_DEPLOYMENT_NAME=Foo
ns2 - CLIENT_DEPLOYMENT_NAME=Bar
The end goal is to include label CLIENT_DEPLOYMENT_NAME=Foo or CLIENT_DEPLOYMENT_NAME=Bar for ns1 or ns2 respectively, in the alert message if any of the PrometheusRule is firing in the specific NS. If the NS has no CLIENT_DEPLOYMENT_NAME just skip it.
What was done so far
In values.yaml of prometheus-community/kube-prometheus-stack chart the next was added:
How to include label_client_deployment_name label of kube_namespace_labels in all alert messages by default if such exists?
Expected Result
Alert: Deployment has not matched the expected number of replicas.
Description: Deployment ns1/test-deploy has not matched the expected number of replicas for longer than 15 minutes.
Details:
• alertname: KubeDeploymentReplicasMismatch
• label_client_deployment_name: Foo <<<<<<<<<<<<<<< EXPECT THIS TO BE ADDED
• container: kube-state-metrics
• deployment: test-deploy
• endpoint: http
• instance: 11.1.170.226:8080
• job: kube-state-metrics
• namespace: ns1
• pod: prometheus-kube-state-metrics-64d58dbb89-24pvq
• prometheus: monitoring/prometheus-kube-prometheus-prometheus
• service: prometheus-kube-state-metrics
• severity: warning
Actual Result
Alert: Deployment has not matched the expected number of replicas.
Description: Deployment ns1/test-deploy has not matched the expected number of replicas for longer than 15 minutes.
Details:
• alertname: KubeDeploymentReplicasMismatch
• container: kube-state-metrics
• deployment: test-deploy
• endpoint: http
• instance: 11.1.170.226:8080
• job: kube-state-metrics
• namespace: ns1
• pod: prometheus-kube-state-metrics-64d58dbb89-24pvq
• prometheus: monitoring/prometheus-kube-prometheus-prometheus
• service: prometheus-kube-state-metrics
• severity: warning
This discussion was converted from issue #6494 on April 10, 2024 08:59.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What happened?
Description
Hi 👋 👋 👋 community,
There are a bunch of K8S NameSpaces (each for a separate customer). Each NameSpace (NS) has a label CLIENT_DEPLOYMENT_NAME with a different value. Let's say:
ns1 - CLIENT_DEPLOYMENT_NAME=Foo
ns2 - CLIENT_DEPLOYMENT_NAME=Bar
The end goal is to include label
CLIENT_DEPLOYMENT_NAME=Foo
orCLIENT_DEPLOYMENT_NAME=Bar
forns1
orns2
respectively, in the alert message if any of the PrometheusRule is firing in the specific NS. If the NS has no CLIENT_DEPLOYMENT_NAME just skip it.What was done so far
In values.yaml of
prometheus-community/kube-prometheus-stack
chart the next was added:And now
kube_namespace_labels
metric has a labellabel_client_deployment_name
:Question
How to include
label_client_deployment_name
label ofkube_namespace_labels
in all alert messages by default if such exists?Expected Result
Actual Result
Prometheus Operator Version
Kubernetes Version
Kubernetes Cluster Type
EKS
How did you deploy Prometheus-Operator?
helm chart:prometheus-community/kube-prometheus-stack
Manifests
No response
prometheus-operator log output
Not relevant for the question.
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions