Mimirtool analyze subcommand flags are not enough to get desired output #10152
Unanswered
sami-ul-islam
asked this question in
Help and support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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?
Beta Was this translation helpful? Give feedback.
All reactions