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

Correctly handle error unwrapping in rules and remote write receiver #11727

Merged
merged 1 commit into from Dec 15, 2022

Conversation

juliusv
Copy link
Member

@juliusv juliusv commented Dec 15, 2022

errors.Unwrap() actually dangerously returns nil if the error does not have an Unwrap() method, which is the case in at least one of these places where I noticed that no error was being logged at all when it should have.

Signed-off-by: Julius Volz julius.volz@gmail.com

@roidelapluie
Copy link
Member

can you point this at the release 2.41 branch?

errors.Unwrap() actually dangerously returns nil if the error does not have an
Unwrap() method, which is the case in at least one of these places where I
noticed that no error was being logged at all when it should have.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
@roidelapluie roidelapluie changed the base branch from main to release-2.41 December 15, 2022 11:55
@roidelapluie roidelapluie merged commit 4f35683 into release-2.41 Dec 15, 2022
@roidelapluie roidelapluie deleted the fix-error-unwrapping branch December 15, 2022 12:44
@roidelapluie
Copy link
Member

Thanks!

@roidelapluie
Copy link
Member

It would be nice to see how you got this because it means we miss basic unit tests

@juliusv
Copy link
Member Author

juliusv commented Dec 15, 2022

It would be nice to see how you got this because it means we miss basic unit tests

For my blog post https://promlabs.com/blog/2022/12/15/understanding-duplicate-samples-and-out-of-order-timestamp-errors-in-prometheus I was trying to provoke error logs about out-of-order samples received via remote write, but I didn't see any, so I started digging around in the code. It's currently a bit hard to unit test because the only thing being done in the case of an error is a log output.

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