-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add get_label_values function in prometheus_connect.py. #235
Conversation
Pre-Commit Test failed! Click here
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, thanks for the contribution, this is great!
Just a thought, would it be a good idea to update the all_metrics
function to use this functoin internally like so:
self.get_label_values(label_name="__name__")
@chauhankaranraj: GitHub didn't allow me to request PR reviews from the following users: lixir. Note that only AICoE members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Pre-Commit Test failed! Click here
|
Hi, @chauhankaranraj! Thanks, I replaced the duplicate code in aafd99b. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @chauhankaranraj! Thanks, I replaced the duplicate code in aafd99b.
Awesome, thanks!
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New changes are detected. LGTM label has been removed. |
Pre-Commit Test failed! Click here
|
self.assertEqual(metrics_list, self.pc.get_label_values("__name__")) | ||
# Check for the "job" label. | ||
label_values = self.pc.get_label_values("job") | ||
self.assertTrue(len(label_values) > 0, "no metrics received from prometheus") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I added a check for this label(job) for your test server (http://demo.robustperception.io:9090/). I am comparing the number of values to zero. If you need to compare the result with the current value and it will not change over time, I can make an edit.
Current value for "job" label: ['alertmanager', 'node', 'prometheus', 'pushgateway']
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with /lifecycle stale |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with /lifecycle rotten |
@lixir sorry for the delay in review. This PR look good 👍 |
Hello! You can add this function to be able to get a list of all values for a specific label.