Skip to content

Conversation

psauvage0
Copy link

@psauvage0 psauvage0 commented Sep 25, 2025

What this PR does

When using mimirtool analyze prometheus, failing queries logs look like the following:

WARN[0005] skipped up analysis because failed to run query count by (job) (up): terminated after 10 retries 

This isn't very helpful as you don't get to know why the query failed.

This behaviour is due to the withBackoff function that returns the error associated with the context, which is never set in the case of this command.

The simple fix proposed by this PR is to return the last error of the backoff if there was one, as the last error is most likely the most relevant.

After the fix, here is an example of log:

WARN[0005] skipped up analysis because failed to run query count by (job) (up): client_error: client error: 404

Which issue(s) this PR fixes or relates to

Fixes #

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]. If changelog entry is not needed, please add the changelog-not-needed label to the PR.
  • about-versioning.md updated with experimental features.

@psauvage0 psauvage0 requested a review from a team as a code owner September 25, 2025 09:58
@CLAassistant
Copy link

CLAassistant commented Sep 25, 2025

CLA assistant check
All committers have signed the CLA.

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.

2 participants