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

Unify mimirtool authentication options and add extra-headers support for commands that depend on MimirClient #10179

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

LeszekBlazewski
Copy link
Contributor

@LeszekBlazewski LeszekBlazewski commented Dec 9, 2024

What this PR does

  1. Unifies all authentication options for mimirtool commands so that the Configuration options work the same for subcommands which use MimirClient.
  2. Adds extra headers support to all commands from mimirtool which depend on MimirClient so that any supported command can be used like in the use case that was described in Mimirtool: add the ability to include extra headers with requests made to the server #7141.
  3. Adjusted the Prometheus api client for analyse prometheus command so that its auth behaves similarly to other mimirtools commands.

Which issue(s) this PR fixes or relates to

There is a discussion opened by my team member: #10152 (comment) and I have created an issue from it: #10178. This PR addresses the issues he is facing.

Related PRs to the changes I am proposing:

Thanks for making such a great product and all the tooling around it! Working with mimir and mimirtool is a breeze and helps a lot with our monitoring setup. We have discovered the above limitations during optimising our stored metrics in mimir. For us the basic auth username configured on the nginx proxy that is in front of mimir does not match the tenant name to which we push metrics and that prevents us from using some of the subcommands but others work and with that PR all of them should be unified. The proposed changes should be backwards compatible so anyone using mimirtool shouldn't be forced to change the passed ENVS / flags.

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

@LeszekBlazewski LeszekBlazewski requested review from tacole02 and a team as code owners December 9, 2024 09:13
@CLAassistant
Copy link

CLAassistant commented Dec 9, 2024

CLA assistant check
All committers have signed the CLA.

@LeszekBlazewski LeszekBlazewski changed the title feat: unify mimirtool authentication options and add extra-headers support to all MimirClient commands Unify mimirtool authentication options and add extra-headers support for commands that depend on MimirClient Dec 9, 2024
@chencs
Copy link
Contributor

chencs commented Dec 10, 2024

The CHANGELOG has just been cut to prepare for the next release. Please rebase main and eventually move the CHANGELOG entry added / updated in this PR to the top of the CHANGELOG.md document. Thanks!

@LeszekBlazewski
Copy link
Contributor Author

@chencs Rebased PR and adjusted changelog as requested.

@LeszekBlazewski LeszekBlazewski force-pushed the main branch 3 times, most recently from 8847a67 to e2d2511 Compare December 12, 2024 07:06
docs/sources/mimir/manage/tools/mimirtool.md Outdated Show resolved Hide resolved
docs/sources/mimir/manage/tools/mimirtool.md Outdated Show resolved Hide resolved
docs/sources/mimir/manage/tools/mimirtool.md Outdated Show resolved Hide resolved
docs/sources/mimir/manage/tools/mimirtool.md Outdated Show resolved Hide resolved
@LeszekBlazewski LeszekBlazewski force-pushed the main branch 5 times, most recently from 7982540 to e458bc3 Compare December 17, 2024 08:53
@LeszekBlazewski
Copy link
Contributor Author

I am not sure from whom should I request a review here and it does not seem possible to tag @grafana/mimir-maintainers team as a whole. Maybe @dimitarvdimitrov you could take a look as I have seen some of your work on mimirtool?

If there is anything missing/wrong with this PR, please let me know.

@armandgrillet armandgrillet requested a review from colega December 18, 2024 14:08
CHANGELOG.md Outdated Show resolved Hide resolved
@colega
Copy link
Contributor

colega commented Dec 18, 2024

Thank you for your contribution, this looks very good! I just left a small nit about the changelog entry, waiting for confirmation there before merging.

@LeszekBlazewski LeszekBlazewski force-pushed the main branch 4 times, most recently from 8b9291e to d153329 Compare December 18, 2024 18:42
@colega
Copy link
Contributor

colega commented Dec 19, 2024

Thank you.

@colega colega enabled auto-merge (squash) December 19, 2024 08:15
@LeszekBlazewski
Copy link
Contributor Author

@colega it looks like before the CI checks can run, they need to be approved by a maintainer: source

By default, all first-time contributors require approval to run workflows.

@colega
Copy link
Contributor

colega commented Dec 19, 2024

Oh, but I approved the PR. Now I see what happened, I'm trying "the new merge experience" and it seems that the approval button is missing in it:

New:
image

Classic:
image

@LeszekBlazewski
Copy link
Contributor Author

LeszekBlazewski commented Dec 19, 2024

@colega I checked the CI logs and I don't see how my changes could fail the TestInstantQuerySplittingCorrectness test . The test passes locally. On my local fork that test also failed but after I have rerun it, it passed OK: source. Is there any chance that those tests could be flaky and CI run dependant? Or there is indeed something off with the changes I am proposing? It seems I am not able to trigger a rerun for the failed ci / test (2,4) job.

I have rebased the PR with main and force pushed which disabled the auto merge and it looks like CI needs another approval - sorry for that.

auto-merge was automatically disabled December 19, 2024 10:21

Head branch was pushed to by a user without write access

@colega
Copy link
Contributor

colega commented Dec 19, 2024

Hey, yes, TestInstantQuerySplittingCorrectness is known to be flaky, there's an issue with a long discussion about how to tackle it, so I'll just restart the build if it fails again. Sorry for the inconvenience.

@LeszekBlazewski
Copy link
Contributor Author

I think that the new merge experience got in a way again 😅 since the CI workflow is not running and must be approved again.

@colega colega enabled auto-merge (squash) December 19, 2024 16:47
@colega colega merged commit aa375f8 into grafana:main Dec 19, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants