victorialogs-datasource
victorialogs-datasource copied to clipboard
More panels support for plugin
That would be awesome to add support for the following panel types
- stat
- pie
- time series
- gauge
- bar
I managed to create a nice dashboard with pie and timeseries visualization.
the data transformation needed is not trivial though.
Dashboard Definition Code: logs-dashboard-victorialogs.json
Issues:
- several Transformations needed to get data in the right format for the visualizations: Pie chart query:
host:~'^$host$' and compose_project:~'^$compose_project$' and compose_service:~'^$compose_service$' and $log_query
| stats by (host) count() logs
Transformations:
Time series:
host:~'^$host$' and compose_project:~'^$compose_project$' and compose_service:~'^$compose_service$' and $log_query
| stats by (_time:1h, host) count() logs
$__intervalcould not be used.| stats by (_time:$__interval, host) count() logsis forwarded in the query without being evaluated.
Positive:
- it's possible now to create dashboards with variables
- its possible to visualize log amounts in timeline
- victorialogs works much faster than loki! Loki is not responding in time when querying just a subset of the same ingested logs.
@hagen1778 can you add support for the $__interval variable in queries?
Are there plans to simplify timeseries queries and other numeric queries for victorialogs?
Stats panel support depends on https://github.com/VictoriaMetrics/VictoriaLogs/issues/310 Time series panel support depends on https://github.com/VictoriaMetrics/VictoriaLogs/issues/309
Are there plans to simplify timeseries queries and other numeric queries for victorialogs?
@pgassmann yes, see this comment https://github.com/VictoriaMetrics/victorialogs-datasource/issues/61#issuecomment-2331060221
@hagen1778 can you add support for the $__interval variable in queries?
@Loori-R do we have support for this variable? If no, would you mind creating a separate feature request for it?
@hagen1778 the $__interval variable support was just added. https://github.com/VictoriaMetrics/victorialogs-datasource/pull/69
@hagen1778 can you add support for the $__interval variable in queries?
@Loori-R do we have support for this variable? If no, would you mind creating a separate feature request for it?
I have merged the PR and made a follow-up PR to provide CHANGELOG and tests.
I thins this function can be reused https://github.com/VictoriaMetrics/victoriametrics-datasource/blob/main/pkg/plugin/step.go#L113
but loki can use this type variable https://github.com/grafana/grafana/blob/main/pkg/tsdb/loki/parse_query.go#L25
I thins this function can be reused https://github.com/VictoriaMetrics/victoriametrics-datasource/blob/main/pkg/plugin/step.go#L113
but loki can use this type variable https://github.com/grafana/grafana/blob/main/pkg/tsdb/loki/parse_query.go#L25
We have similar logic in the victoriametrics-datasource. Parsing of the different templates was implemented.
FYI, the /select/logsql/stats_query_range endpoint at VictoriaLogs is implemented in the commit 0a40064a6fa64f9d3e3ae60f6f12a9584dce459d . See these docs for details. This endpoint must be used by the VictoriaLogs datasource for building time series panel.
Also the /select/logsql/stats_query endpoint must be used by VictoriaLogs datasource for building stat, pie chart and gauge panels.
FYI, the
/select/logsql/stats_query_rangeendpoint at VictoriaLogs is implemented in the commit 0a40064a6fa64f9d3e3ae60f6f12a9584dce459d . See these docs for details. This endpoint must be used by the VictoriaLogs datasource for building time series panel.Also the
/select/logsql/stats_queryendpoint must be used by VictoriaLogs datasource for building stat, pie chart and gauge panels.
Are there any plans in the short term to take this into account in victorialogs-datasource?
Hi @crocchietta!
Thank you for your question. This is not planned in the near future, but we intend to address it later. The task is complex and will require time.
Hi @crocchietta!
Thank you for your question. This is not planned in the near future, but we intend to address it later. The task is complex and will require time.
I understand. In the meantime, I'll continue to use the transformations on the Grafana side (Convert field type).
https://github.com/VictoriaMetrics/victorialogs-datasource/pull/106 has been merged, but there are following enhancements required for better usability of this feature:
- gauge, bar gague, stat, bar chart panel should have toggle for instant and range requests
- support $__range variable in queries. That would be useful for building queries like
_time: $__range | stats by(host) count()to get the stats over selected time range in Grafana time picker. // this is probably related to backend implementation cc @dmitryk-dk - stats-like panels should explicitly warn user about adding
| statspipe, because these panels can only work with stats API - support legend template. For example, I'd like to choose which labels from the result should be plotted in the legend. Currently, I can't control legend
@dmitryk-dk @Loori-R could you please break it into tickets which suits you the best and implement?
Hi @tenmozes ! The feature was implemented in the v0.8.0 release. Close the ticket as implemented.
Other improvements were created in the other tickets and will be implemented soon