Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Conversation

@andresgalindo-stripe
Copy link
Contributor

Summary

No longer erring out if one batch fails

Motivation

We want as many metrics to try and get written, errors may be related to things like writing duplicate time series which shouldn't stop the entire loop.

Test plan

Rollout/monitoring/revert plan

Copy link
Contributor

@andrewa-stripe andrewa-stripe left a comment

Choose a reason for hiding this comment

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

minor changes. Understand the change now and old comments were not relevant.

}

var _ sinks.MetricSink = (*CortexMetricSink)(nil)
var DoIfNotDoneError = errors.New("context finished before completing metrics flush")
Copy link
Contributor

@andrewa-stripe andrewa-stripe Dec 18, 2022

Choose a reason for hiding this comment

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

New also records the stack trace at the point it was called

errors.New should not be cached for usages

If error checking is necessary, we should introduce an error type and use errors.Is

s.logger.Error(err)
droppedMetrics += len(metrics) - flushedMetrics
// Any other type of error will happen inside of doIfNotDone
// so we only need ot handle context cancellations
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// so we only need ot handle context cancellations
// so we only need to handle context cancellations

@andrewa-stripe
Copy link
Contributor

andrewa-stripe commented Jan 22, 2023

#1022 does the ?same?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants