-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[refactor] - Adjust File Handling Errors #3519
Conversation
defer func() { | ||
h.measureLatencyAndHandleErrors(start, err) | ||
h.metrics.incFilesProcessed() | ||
}() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that archives that generate errors during processing are no longer counted by the metric and no longer have their latency measured?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change increments incFilesProcessed
only for Non-Fatal errors, but latency is recorded regardless of success or failure. For Fatal errors, we increment the incErrors
metric within measureLatencyAndHandleErrors
instead.
I was concerned when I saw that we’re incrementing the file processed metric even in cases of errors. The metric name may be unclear, as I assumed "processed" meant successfully processed, not just acknowledged. With the current approach, even files we can’t open are counted as processed, which feels somewhat misleading. I’m open to changing it back, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Food for thought, the status could be represented with a metric tag and then we could use the same metric visualizations 'by status', which could be "success", "failure", "skipped" etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an interesting idea. I'll put together a separate PR with that. Thanks for the suggestion.
Description:
This PR address the first point in this comment.
Avoid shadowing
err
by handling it immediately upon encountering an error.Checklist:
make test-community
)?make lint
this requires golangci-lint)?