Skip to content

Support limit param for metrics discovery #82

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

Closed
hagen1778 opened this issue Jul 13, 2023 · 1 comment
Closed

Support limit param for metrics discovery #82

hagen1778 opened this issue Jul 13, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request TBD

Comments

@hagen1778
Copy link
Contributor

Grafana's Prometheus datasource could return too many series on /api/v1/series or /api/v1/labels API and crash user's browser.
VictoriaMetrics supports limit param for these APIs - see https://docs.victoriametrics.com/#prometheus-querying-api-enhancements

VictoriaMetrics accepts limit query arg for /api/v1/labels and /api/v1/label//values handlers for limiting the number of returned entries. For example, the query to /api/v1/labels?limit=5 returns a sample of up to 5 unique labels, while ignoring the rest of labels. If the provided limit value exceeds the corresponding -search.maxTagKeys / -search.maxTagValues command-line flag values, then limits specified in the command-line flags are used.

By default, VictoriaMetrics returns time series for the last day starting at 00:00 UTC from /api/v1/series, /api/v1/labels and /api/v1/label//values, while the Prometheus API defaults to all time. Explicitly set start and end to select the desired time range. VictoriaMetrics rounds the specified start..end time range to day granularity because of performance optimization concerns. If you need the exact set of label names and label values on the given time range, then send queries to /api/v1/query or to /api/v1/query_range.

VictoriaMetrics accepts limit query arg at /api/v1/series for limiting the number of returned entries. For example, the query to /api/v1/series?limit=5 returns a sample of up to 5 series, while ignoring the rest of series. If the provided limit value exceeds the corresponding -search.maxSeries command-line flag values, then limits specified in the command-line flags are used.

Would be nice if we had these limits configurable and preset in the datasource.

@hagen1778
Copy link
Contributor Author

The issue was added in 3d45f97 and will be included to the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request TBD
Projects
None yet
Development

No branches or pull requests

2 participants