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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
chauhankaranraj
left a comment
There was a problem hiding this comment.
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. DetailsIn 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. |
chauhankaranraj
left a comment
There was a problem hiding this comment.
Hi, @chauhankaranraj! Thanks, I replaced the duplicate code in aafd99b.
Awesome, thanks!
/lgtm
|
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.
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.