k8sgpt-ai / k8sgpt-operator

Automatic SRE Superpowers within your Kubernetes cluster
https://k8sgpt.ai
Apache License 2.0
279 stars 76 forks source link

fix: add prometheus metric label "k8sgpt" #364

Closed JuHyung-Son closed 4 months ago

JuHyung-Son commented 4 months ago

Closes #363

📑 Description

add prometheus metric label to distinguish clusters.

✅ Checks

ℹ Additional Information

i set label name as k8sgpt. and its value is k8sgpt.metadata.name. if there is more appropriate label name, please suggest.

example metric

# TYPE k8sgpt_reconcile_error_count counter
k8sgpt_reconcile_error_count{k8sgpt="gangnam1"} 13
arbreezy commented 4 months ago

I am wondering @JuHyung-Son if we have to update also chart's dashboard to include the filtering

JuHyung-Son commented 4 months ago

oh yes. it need to be updated.

JuHyung-Son commented 4 months ago

i added label on promql. but it needs to be tested. since operator runs on local, not minikube, prometheus can not scrape new metrics.

arbreezy commented 4 months ago

It's a small change, it's fine I believe lets get it merged