Skip to content
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

More panels support for plugin #61

Closed
tenmozes opened this issue Aug 21, 2024 · 15 comments · Fixed by #69
Closed

More panels support for plugin #61

tenmozes opened this issue Aug 21, 2024 · 15 comments · Fixed by #69
Assignees
Labels
enhancement New feature or request

Comments

@tenmozes
Copy link
Contributor

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

  • stat
  • pie
  • time series
  • gauge
  • bar
@pgassmann
Copy link

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:

  • 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:
grafik

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

  • $__interval could not be used. | stats by (_time:$__interval, host) count() logs is 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.

@pgassmann
Copy link

@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
Copy link
Contributor

Stats panel support depends on VictoriaMetrics/VictoriaMetrics#6942
Time series panel support depends on VictoriaMetrics/VictoriaMetrics#6943

@hagen1778
Copy link
Contributor

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

@pgassmann yes, see this comment #61 (comment)

@hagen1778
Copy link
Contributor

@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
Copy link

@hagen1778 the $__interval variable support was just added. #69

@dmitryk-dk
Copy link
Contributor

@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
Copy link
Contributor

@dmitryk-dk
Copy link
Contributor

dmitryk-dk commented Sep 5, 2024

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 added a commit to VictoriaMetrics/VictoriaMetrics that referenced this issue Sep 6, 2024
…ing time series panels in VictoriaLogs plugin for Grafana

Updates #6943
Updates VictoriaMetrics/victorialogs-datasource#61
valyala added a commit to VictoriaMetrics/VictoriaMetrics that referenced this issue Sep 6, 2024
…ing time series panels in VictoriaLogs plugin for Grafana

Updates #6943
Updates VictoriaMetrics/victorialogs-datasource#61
@valyala
Copy link

valyala commented Sep 6, 2024

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.

@crocchietta
Copy link

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.

Are there any plans in the short term to take this into account in victorialogs-datasource?

@Loori-R
Copy link
Contributor

Loori-R commented Oct 2, 2024

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.

@crocchietta
Copy link

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

@hagen1778
Copy link
Contributor

hagen1778 commented Nov 20, 2024

#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 | stats pipe, 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
image

@dmitryk-dk @Loori-R could you please break it into tickets which suits you the best and implement?

@dmitryk-dk
Copy link
Contributor

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

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

Successfully merging a pull request may close this issue.

8 participants