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

Add timestamp function #1557

Closed
brian-brazil opened this Issue Apr 15, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@brian-brazil
Copy link
Member

brian-brazil commented Apr 15, 2016

We should add a function that returns the timestamp of a point in unixtime. timestamp seems like a good name.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Apr 15, 2016

Isn't that automatically always the same as just time(), given that we set the timestamp of sample points to aligned time steps?

@brian-brazil

This comment has been minimized.

Copy link
Member Author

brian-brazil commented Apr 15, 2016

The timestamp of the sample may be up to 5 minutes earlier though.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Apr 15, 2016

Right, but we already set the timestamp of any sample to the evaluation timestamp before any function would be even able to look at the raw underlying timestamp. So this would imply changing that.

https://github.com/prometheus/prometheus/blob/master/promql/engine.go#L692

What'd be the use case for this?

@brian-brazil

This comment has been minimized.

Copy link
Member Author

brian-brazil commented Apr 15, 2016

It's a bit more relevant after #398, but for now it'd help for example detect stale series.

brian-brazil added a commit that referenced this issue Apr 14, 2017

Add timestamp() function.
Make the timestamp of instant vectors be the timestamp of the sample
rather than the evaluation. We were not using this anywhere, so this is
safe.

Add a function to return the timestamp of samples in an instant vector.

Fixes #1557

brian-brazil added a commit that referenced this issue May 3, 2017

Add timestamp() function.
Make the timestamp of instant vectors be the timestamp of the sample
rather than the evaluation. We were not using this anywhere, so this is
safe.

Add a function to return the timestamp of samples in an instant vector.

Fixes #1557

brian-brazil added a commit that referenced this issue May 12, 2017

Add timestamp() function.
Make the timestamp of instant vectors be the timestamp of the sample
rather than the evaluation. We were not using this anywhere, so this is
safe.

Add a function to return the timestamp of samples in an instant vector.

Fixes #1557

brian-brazil added a commit that referenced this issue May 12, 2017

Add timestamp() function.
Make the timestamp of instant vectors be the timestamp of the sample
rather than the evaluation. We were not using this anywhere, so this is
safe.

Add a function to return the timestamp of samples in an instant vector.

Fixes #1557
@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.