-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing _count metrics and keep just custom labels in the labels …
…variable (#181) ## Description This PR fixes two issues that I encountered during testing the new metrics collector: 1) in case that we have metric with `_count` suffix and there is no histogram or summary, the metric is simply skipped. This is resolved by adding check for `TYPE` line where the type of the metric is parsed and in case that we go with the `_count` branch, which doesn't fit to the histogram or summary, it will pick type based on this variable 2) in case that the name is same, but the labels are different, we are putting everything into the first metric (so the labels difference is really ignored). This is now fixed by comparing the "custom labels" in the current histogram/summary and the newly parsed (again custom) labels from the new metric. ## Type of Change * Bug fix ## Checklist - [X] My code follows the style guidelines of this project - [X] I have performed a self-review of my own code - [X] I have commented my code, particularly in hard-to-understand areas - [X] I have made corresponding changes to the documentation - [X] My changes generate no new warnings - [X] I have added tests that prove my fix is effective or that my feature works - [X] New and existing unit/integration tests pass locally with my changes
- Loading branch information
Showing
1 changed file
with
49 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters