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

Some Mimirtool commands do not support unified authentication options #10178

Open
LeszekBlazewski opened this issue Dec 9, 2024 · 0 comments

Comments

@LeszekBlazewski
Copy link
Contributor

Hi
I am trying to run a command mimirtool analyze ruler --address=https://mimir.ops.com --id $MIMIR_USER --key $MIMIR_PASSWORD
INFO[0000] log level set to debug
DEBU[0000] New Mimir client created address="https://mimir.ops.com" id=mimir_id
DEBU[0000] sending request to Grafana Mimir API method=GET url="https://mimir.ops.com/prometheus/config/v1/rules"
DEBU[0001] checking response status="200 OK"
Expected output:
{ "metricsUsed": [ "apiserver_request_duration_seconds_bucket", "container_cpu_usage_seconds_total", "scheduler_scheduling_algorithm_duration_seconds_bucket" ], "ruleGroups": [ { "namspace": "prometheus_rules", "name": "kube-apiserver.rules", "metrics": [ "apiserver_request_duration_seconds_bucket", "apiserver_request_duration_seconds_count", "apiserver_request_total" ], "parse_errors": null } ] }

Actual Output:
{ "metricsUsed": null, "ruleGroups": null }

The reason for this, there is no option to specify tenant id for the above mimirtool analyze ruler command.
Without tenant id:
curl -u "$MIMIR_USER:$MIMIR_PASSWORD" https://mimir.ops.com/prometheus/config/v1/rules {}

With tenant id:
it is able to browse the rules and gives me the list of all the rule i have in mimir with below command:
curl -H "X-Scope-OrgID: mimir-monitoring" -u "$MIMIR_USER:$MIMIR_PASSWORD" https://mimir.ops.com//prometheus/config/v1/rules

So currently supported options doesn't seem enough and they are also quite confusing https://grafana.com/docs/mimir/latest/manage/tools/mimirtool/#ruler
Environment variable Flag Description
MIMIR_ADDRESS --address Sets the address of the Prometheus instance.
MIMIR_TENANT_ID --id Sets the basic auth username. If you’re using Grafana Cloud, this variable is your instance ID.
MIMIR_API_KEY --key Sets the basic auth password. If you’re using Grafana Cloud, this variable is your API key.
-output Sets the output file path, which by default is metrics-in-ruler.json.

The flag --id is quite confusing as i need to provide both username and tenant id in order to get desired result but seems like i can only specify one which results in {} output.
How can i specify tenant id as well along with mimir username and password?

Originally posted by @sami-ul-islam in #10152

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

No branches or pull requests

1 participant