VictoriaMetrics / victorialogs-datasource

Grafana datasource for VictoriaLogs
Apache License 2.0
77 stars 2 forks source link

More panels support for plugin #61

Open tenmozes opened 3 weeks ago

tenmozes commented 3 weeks ago

That would be awesome to add support for the following panel types

pgassmann commented 2 weeks ago

I managed to create a nice dashboard with pie and timeseries visualization. the data transformation needed is not trivial though. grafik

Dashboard Definition Code: logs-dashboard-victorialogs.json

Issues:

Time series:

host:~'^$host$' and compose_project:~'^$compose_project$' and compose_service:~'^$compose_service$' and $log_query
  | stats by (_time:1h, host) count() logs

grafik

Positive:

pgassmann commented 1 week ago

@hagen1778 can you add support for the $__interval variable in queries?

Are there plans to simplify timeseries queries and other numeric queries for victorialogs?

hagen1778 commented 1 week ago

Stats panel support depends on https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6942 Time series panel support depends on https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6943

hagen1778 commented 1 week ago

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 commented 1 week ago

@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?

pgassmann commented 1 week ago

@hagen1778 the $__interval variable support was just added. https://github.com/VictoriaMetrics/victorialogs-datasource/pull/69

dmitryk-dk commented 1 week ago

@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.

yincongcyincong commented 1 week ago

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

dmitryk-dk commented 1 week ago

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.

valyala commented 1 week ago

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.