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

Fix timestamps for global variables in Prometheus output #9779

Merged
merged 1 commit into from
Aug 20, 2020

Conversation

vlvkobal
Copy link
Contributor

Summary

Prometheus drops global variables from responses by default

If no sample is found (by default) 5 minutes before a sampling timestamp, no value is returned for that time series at this point in time.

We will provide current time as a timestamp for the global variables to be sure they are available in Prometheus' responses.

Fixes #6470

Component Name

Web API

Test Plan

Query Netdata with the following URL

http://localhost:19999/api/v1/allmetrics?format=prometheus&source=raw&variables=yes&help=yes

Timestamps for global host and chart variables should represent the current time.

Copy link
Contributor

@thiagoftsm thiagoftsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this PR comparing it with Master branch, and it is fixing the reported issue.

@vlvkobal vlvkobal merged commit 83e5cbe into netdata:master Aug 20, 2020
@vlvkobal vlvkobal deleted the change-timestamps branch August 20, 2020 11:52
@joelhans joelhans changed the title Change timestamps for global variables in Prometheus output Fix timestamps for global variables in Prometheus output Aug 26, 2020
@joelhans joelhans changed the title Fix timestamps for global variables in Prometheus output Fix timestamps for global variables in Prometheus backends output Aug 26, 2020
@joelhans joelhans changed the title Fix timestamps for global variables in Prometheus backends output Fix timestamps for global variables in Prometheus output Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Variables exposed as prometheus metrics grow stale over time
3 participants