victorialogs-datasource
victorialogs-datasource copied to clipboard
Variable values fetch from query
Hi! Thank you for the datasource plugin.
I wanted to get the variable values from the query rather than defining them manually.
@Loori-R @dmitryk-dk would you mind taking a look?
I would like to build a logs dashboard like this using victorialogs:
The query for loki looks like this:
{host=~"$host",category="dockerlogs",compose_project=~"$project",compose_service=~"$service"} $filter |~ "$search"
| line_format "{{.compose_project }}/{{.compose_service }}\t| {{ __line__ }}"
For this, the grafana plugin would need to support querying field_values. The api is implemented: https://docs.victoriametrics.com/victorialogs/querying/#querying-stream-field-values
Dynamic variables allow some really useful dashboarding, looking forward to being able to do this with victorialogs.
Hi,
I agree, allow creating vars is very usefull. It can help to focus on specific point. It can be use to create clean dashboards with both vmlogs and vmetrics content.
@Loori-R is https://github.com/VictoriaMetrics/victorialogs-datasource/pull/58 enough for supporting variables in the plugin?
Yes, I think that will be enough. If anything was missed, you can reopen or create a new feature request.
Hi! Thank you for feature. I tried this out and found some bugs.
Multi-value seems doesn't work. I have query:
consumer: $consumer
Choose 2 options and get nothing. From google devtools in network i see following query:
consumer: <null>|admin
I think it should have looked like this:
consumer: ("<null>" OR "admin")
Query works badly with values with special characters. I have query:
proxy_list: $proxy_list
From google devtools in network i see following query:
proxy_list: api_name:clientid-persons-v1;v1\\.14\\.1
I think it should have looked like this:
proxy_list: "api_name:clientid-persons-v1;v1.14.1"
I think need to add quotes and work through the moment with multi-value
Hi @Neko-Follower! Thank you for the feedback. I created a separate issue #65.
The functionality for fetching variable values is supported in victorialogs-datasource starting from version v0.3.0.