Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.

Updating PromQL queries to include tilde needed to work with 'all' variable - #21054

Merged
harshavardhana merged 1 commit into
minio:masterfrom
excircle:master
Mar 22, 2025
Merged

harshavardhana merged 1 commit into
minio:masterfrom
excircle:master

Conversation

@excircle

Copy link
Copy Markdown
Contributor

Updating PromQL queries to include tilde needed to work with 'all' variable

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.

Description

This pull requests modifies the PromQL queries inside the public facing MinIO Buckets Dashboard to include tildes or "~" characters.

At present, the buckets dashboard explicitly looks for a single job which contains the bucket metrics

# Example Query
sum by (bucket,api)
(increase(minio_bucket_requests_4xx_errors_total{job="$scrape_jobs"}[$__rate_interval])) # No Tilde

This is problematic because it prevents these dashboard visualizations from rendering data if the "all" variable is used.

Should be changed to include the tilde:

# Example Query
sum by (bucket,api)
(increase(minio_bucket_requests_4xx_errors_total{job=~"$scrape_jobs"}[$__rate_interval])) # With Tilde

Motivation and Context

If a user has a Prometheus data source, with multiple scrape jobs defined (E.G: minio-v2-bucket, minio-v2-cluster, etc), the current PromQL will only allow the visualizations to render if the scrape job is explicitly set to the job which targets the "/minio/v2/metrics/bucket" endpoint.

This can be avoided if we change job= to job=~.

By adding the tilde, users can specify 1 or more scrape jobs without causing the visualizations to show "no data" if more than 1 job is used.

How to test this PR?

  • Import the dashboard into Grafana
  • Connect it to the appropriate data source
  • Ensure the "show all" option is selected under the dashboard's "variable" menu
  • Toggle between "all" and the scrape job which targets "/minio/v2/metrics/bucket"

Test will be valid if the MinIO visualization data remains populated irrespective of whether "all" is toggled or not

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

@harshavardhana
harshavardhana merged commit 46922c7 into minio:master Mar 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants