add monitoring.ignore-duplicates to skip duplicate time series#511
Open
hcavarsan wants to merge 1 commit into
Open
add monitoring.ignore-duplicates to skip duplicate time series#511hcavarsan wants to merge 1 commit into
hcavarsan wants to merge 1 commit into
Conversation
Signed-off-by: hcavarsan <hcavarsan@yahoo.com.br> feat: add monitoring.ignore-duplicates to skip duplicate time series Signed-off-by: hcavarsan <hcavarsan@yahoo.com.br> feat: add monitoring.ignore-duplicates to skip duplicate time series Signed-off-by: hcavarsan <hcavarsan@yahoo.com.br> feat: add monitoring.ignore-duplicates to skip duplicate time series Signed-off-by: hcavarsan <hcavarsan@yahoo.com.br> feat: add monitoring.ignore-duplicates to skip duplicate time series Signed-off-by: hcavarsan <hcavarsan@yahoo.com.br> feat: add monitoring.ignore-duplicates to skip duplicate time series Signed-off-by: hcavarsan <hcavarsan@yahoo.com.br>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
the Cloud Monitoring API sometimes returns the same time series more than once in a single scrape, and prometheus refuses the duplicate while gathering:
promhttpturns that into a 500/503, so one duplicate fails the whole scrape.Solution
this adds
monitoring.ignore-duplicates(off by default). when it's on, the gatherer drops the duplicate-series error and returns what was collected.only exact duplicates get dropped, since prometheus decides what counts as the same series by name, labels, and timestamp. anything differing in a label or timestamp is kept, and with the flag off nothing changes.
Testing
collectors/gatherer_test.gohas an end-to-end test where a duplicate gets suppressed and the series collapses. it also has a table test for the error filtering.related: #57, #103, #166, #450, #470.