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

Set the value of start and end parameters of a VictoriaMetrics Query in a Grafana Panel #200

Open
TheMuppet opened this issue Aug 29, 2024 · 3 comments

Comments

@TheMuppet
Copy link

I am trying to configure a Grafana panel to query data from VictoriaMetrics for a specific time range that is independent of the overall dashboard time range.

The use case is that various devices are assigned to a job for a certain amount of time (e.g. Job 1: 10:00 AM - 11:00 AM, Job 1: 11:00 AM - 12:00 AM). The aim is to select a Job via a Grafana variable and then retrieve the data for the runtime of the job.
The start and end time of a Job are stored in Grafana Variables and retrieved from another Database.
In other databases the start end time is defined in the query, so as a user I can edit them myself. As I know in VictoriaMetrics they are passed via the URL parameters start and end and are always set to the Dashboard time range?. Is there a way to edit these parameters to set it to a value of a Grafana Variable?
It would be nice if I had the possibility to set the start/end values like the step value in a panel.

@alekiv
Copy link

alekiv commented Sep 7, 2024

This would be a very useful feature. Being able to set custom time ranges for individual panels, separate from the dashboard's time range, is essential for visualizing data for specific jobs with precise time frames. This limitation is a significant blocker for migrating from InfluxDB, where these time ranges can be easily defined in queries. It's frustrating that VictoriaMetrics doesn't support this yet, and adding this functionality would be a great improvement.

@dg-nvm
Copy link
Contributor

dg-nvm commented Sep 18, 2024

Have you tried @ modifier? This will modify the date when query is executed to the pointed timestamp

@TheMuppet
Copy link
Author

Yes, I tried the @ modifier. As I know, VictoriaMetrics range queries work by running an instant query at each step of the given time range. An @ in an instant query gives me the time at a given timestamp. This causes range queries with @ to always return the same value. There may be a way around this that I am not aware of.

image

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

No branches or pull requests

3 participants