Skip to content

docs: instant queries don't return the actual sample timestamp#5708

Closed
dandv wants to merge 1 commit into
VictoriaMetrics:masterfrom
dandv:patch-2
Closed

docs: instant queries don't return the actual sample timestamp#5708
dandv wants to merge 1 commit into
VictoriaMetrics:masterfrom
dandv:patch-2

Conversation

@dandv
Copy link
Copy Markdown
Contributor

@dandv dandv commented Jan 28, 2024

This behavior is counter-intuitive and quite annoying when I want to get the actual timestamp of the last event in a series.

What is the utility of returning the timestamp provided by the caller, instead of the actual timestamp of the sample?

@hagen1778
Copy link
Copy Markdown
Collaborator

hagen1778 commented Jan 29, 2024

What is the utility of returning the timestamp provided by the caller, instead of the actual timestamp of the sample?

It is the perspective of view. If you think of VictoriaMetrics or Prometheus like about systems allowing you to view a state of other systems - it becomes more understandable. Each system has its state, all the time, whenever we'll decide to observe. But the system can't report its state to monitoring system instantly. It does it periodically, like each 30s it sends a snapshot of its state in the form of metrics (a scrape). So VM and Prometheus assumes that when you query the metric, you observe its state at the moment you queried it.

It abstracts the fact of when this state was last updated, or how frequently it is updated. You just ask: "what's the cpu usage of system Foo". And VM responds: "it is 40% now, from what I can tell".

It doesn't say: "it was 40% 15s ago". This would be observing not the state, but events. So think of VM/Prometheus like systems that show state, while Influx/Timescale/etc. show events.

hagen1778 added a commit that referenced this pull request Jan 29, 2024
Mention explicitly what are value and timestamp field in returned
results from Instant and Range queries.

Updates
#5710
#5708

Signed-off-by: hagen1778 <roman@victoriametrics.com>
@hagen1778
Copy link
Copy Markdown
Collaborator

Closing this PR in favour of b5978ed
Thanks for contribution!

@hagen1778 hagen1778 closed this Jan 29, 2024
@dandv dandv deleted the patch-2 branch January 29, 2024 15:09
valyala added a commit that referenced this pull request Jan 29, 2024
…rned by instant and range queries

Do not use `raw samples` term there, since it adds more confusion than clarity:
the `raw samples` refers to real samples stored in the database, while neither range nor instant queries
do not return raw samples - they both return *calculated* samples at *the given* timestamps.

This is a follow-up for b5978ed

Updates #5710
Updates #5708
valyala pushed a commit that referenced this pull request Jan 29, 2024
Mention explicitly what are value and timestamp field in returned
results from Instant and Range queries.

Updates
#5710
#5708

Signed-off-by: hagen1778 <roman@victoriametrics.com>
valyala added a commit that referenced this pull request Jan 29, 2024
…rned by instant and range queries

Do not use `raw samples` term there, since it adds more confusion than clarity:
the `raw samples` refers to real samples stored in the database, while neither range nor instant queries
do not return raw samples - they both return *calculated* samples at *the given* timestamps.

This is a follow-up for b5978ed

Updates #5710
Updates #5708
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

Successfully merging this pull request may close these issues.

2 participants