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

Allow to specify -prometheus-http-prefix for mimirtool analyze prometheus #4966

Merged
merged 1 commit into from
May 10, 2023

Conversation

wilfriedroset
Copy link
Collaborator

What this PR does

When configuring mimirtool via environment variables users might use the following:

MIMIR_ADDRESS=https://mimir:9090
MIMIR_TENANT_ID=default
MIMIR_API_USER=default
MIMIR_API_KEY=1234

It works as expected for mimirtool analyze ruler but not for mimirtool analyze prometheus.

The HTTP client for analyze ruler is done with
github.com/grafana/mimir/pkg/mimirtool/client, when for analyze prometheus it is done with only the address.

Depending on which prometheus the user wants to analyze the path is not the same. For a mimir based analysis user needs to provide /prometheus.

This commit allow to specify the path to use for a mimir based analysis. It also simplify the scripting around the tool.

Example:

source .secrets.env
mimirtool analyze grafana && \
mimirtool analyze ruler && \
mimirtool analyze prometheus --prometheus-http-prefix="/prometheus"

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]

@wilfriedroset wilfriedroset force-pushed the mimirtool-prometheus-http-prefix branch from b8c80f8 to 876be9a Compare May 9, 2023 20:15
…heus

When configuring mimirtool via environment variables users might use the
following:

```
MIMIR_ADDRESS=https://mimir:9090
MIMIR_TENANT_ID=default
MIMIR_API_USER=default
MIMIR_API_KEY=1234
```

It works as expected for `mimirtool analyze ruler` but not for
`mimirtool analyze prometheus`.

The HTTP client for `analyze ruler` is done with
`github.com/grafana/mimir/pkg/mimirtool/client`, when for `analyze
prometheus` it is done with only the address.

Depending on which prometheus the user wants to analyze the path is not
the same. For a mimir based analysis user needs to provide
`/prometheus`.

This commit allow to specify the path to use for a mimir based analysis.
It also simplify the scripting around the tool.

Example:

```
source .secrets.env
mimirtool analyze grafana && \
mimirtool analyze ruler && \
mimirtool analyze prometheus --prometheus-http-prefix="/prometheus"
```

Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
@wilfriedroset wilfriedroset force-pushed the mimirtool-prometheus-http-prefix branch from 876be9a to 794e427 Compare May 9, 2023 20:23
@wilfriedroset wilfriedroset marked this pull request as ready for review May 9, 2023 20:33
@wilfriedroset wilfriedroset requested review from a team as code owners May 9, 2023 20:33
Copy link
Contributor

@colega colega left a comment

Choose a reason for hiding this comment

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

Thank you.

@colega colega merged commit ee8a8e2 into grafana:main May 10, 2023
@wilfriedroset wilfriedroset deleted the mimirtool-prometheus-http-prefix branch May 10, 2023 13:33
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