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

Merge exceptions instead of swapping #145

Merged
merged 13 commits into from
Oct 9, 2020
Merged

Merge exceptions instead of swapping #145

merged 13 commits into from
Oct 9, 2020

Conversation

marctc
Copy link
Contributor

@marctc marctc commented Oct 2, 2020

  • Changed method to combine errors. Now we compute the total of errors counting the errors per target (instances of a given service). This allows us to have historical data of errors that are already fix after a deploy.
  • Target added to ResponsePayload, need to aggreggate errors per target.
  • Added a hash map to track resolved errors.
  • When an error is mark as resolved, we still add to list of errors if the error is scraped in the next cycle.
  • Minor refactors and added some comented some functions.

This PR solves #128

if existing, exists := errorAggregates[item.AggregationKey]; exists {
prevCount := targetErrorsCount[rp.Target][item.AggregationKey]
errorAggregates[item.AggregationKey] = errorAggregate{
TotalCount: existing.TotalCount + (item.TotalCount - prevCount),
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a possibility that his number would become negative and subtract instead of add to the total count?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did some manually testing and it didn't happen. So not sure in which circumstances might happen.

@marctc marctc merged commit 626e2d1 into master Oct 9, 2020
@marctc marctc deleted the merge_exceptions branch October 9, 2020 14:15
marctc pushed a commit that referenced this pull request Oct 9, 2020
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.

None yet

2 participants