Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default value of prometheus_label to None #101

Merged
merged 3 commits into from
Jul 18, 2023

Conversation

cr7258
Copy link
Contributor

@cr7258 cr7258 commented Jul 11, 2023

krr calls prometheus.get_label_values function to get a list of all values for the specific label (the default label name is "cluster") to determine whether Prometheus monitors multiple clusters.

However, some metrics may contain the "cluster" label, but it doesn't mean that Prometheus monitors multiple clusters. For example, the cluster label in the following metric refers to the Elasticsearch cluster instead of the Kubernetes cluster.

elasticsearch_cluster_health_status{cluster="elasticsearch-1", color="green", instance="100.96.0.17:9108", job="kubernetes-service-endpoints", kubernetes_node="node-1", namespace="elastic"}

When I run krr simple, I will get this error:

[ERROR] No label specified, Rerun krr with the flag `-l <cluster>` where <cluster> is one of ['elasticsearch-1', 'elasticsearch-2', 'elasticsearch-3']

So I modified the default value of prometheus_label to None in order to prevent multiple cluster checks by default. If the user needs to handle multi-cluster scenarios, they can explicitly specify the "cluster" field.

@CLAassistant
Copy link

CLAassistant commented Jul 11, 2023

CLA assistant check
All committers have signed the CLA.

README.md Show resolved Hide resolved
Copy link
Contributor

@Avi-Robusta Avi-Robusta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, and nice code
One more place I would like you to change before we merge it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants