VictoriaMetrics / victorialogs-datasource

Grafana datasource for VictoriaLogs
Apache License 2.0
92 stars 5 forks source link

Calls to /field_values should have `limit` param #75

Closed hagen1778 closed 6 days ago

hagen1778 commented 2 months ago

Calls to the mentioned API from the plugin should always include limit param (see https://docs.victoriametrics.com/victorialogs/querying/#querying-field-values):

The /select/logsql/field_values endpoint supports optional limit=N query arg, which allows limiting the number of returned values to N. The endpoint returns arbitrary subset of values if their number exceeds N, so limit=N cannot be used for pagination over big number of field values. When the limit is reached, hits are zeroed, since they cannot be calculated reliably.

The limit should protect browser from crashing and lead to better user experience. If API returned len(items) == limit it also means that limit was reached, and plugin should notify the user about this and discard the response completely.

Loori-R commented 6 days ago

The feature was added in the v0.6.0.