VictoriaMetrics icon indicating copy to clipboard operation
VictoriaMetrics copied to clipboard

How do you use the latency_offset query arg?

Open OmegaZero opened this issue 1 year ago • 3 comments

Is your question request related to a specific component?

VictoriaMetrics

Describe the question in detail

How do you use the latency_offset query arg? For instance I want to change it for a particular query to only be 5 seconds but if I do

windows_cpu_time_total{latency_offset="5s"}

it returns no data. Forgive my ignorance on how this works! :) Thanks!

Troubleshooting docs

  • [ ] General - https://docs.victoriametrics.com/Troubleshooting.html
  • [ ] vmagent - https://docs.victoriametrics.com/vmagent.html#troubleshooting
  • [ ] vmalert - https://docs.victoriametrics.com/vmalert.html#troubleshooting

OmegaZero avatar Feb 09 '24 03:02 OmegaZero

This param can be used via http request query arg:

curl localhost:8428/api/v1/query -g -d 'latency_offset=5s' -d 'query=windows_cpu_time_total'

f41gh7 avatar Feb 09 '24 10:02 f41gh7

But can it be used inside the query (like I had mentioned before?). Specifically, how can I use it from Grafana? Also how can I use it in vmui?

OmegaZero avatar Feb 09 '24 14:02 OmegaZero

@OmegaZero, no, it cannot be passed as part of MetricsQL query

Amper avatar Feb 20 '24 10:02 Amper

Closed as answered.

jiekun avatar Jul 25 '24 07:07 jiekun