Skip to content

scrape: Added trackTimestampsStaleness configuration option#13060

Merged
roidelapluie merged 1 commit intoprometheus:mainfrom
roidelapluie:trackTimestampsStaleness
Oct 31, 2023
Merged

scrape: Added trackTimestampsStaleness configuration option#13060
roidelapluie merged 1 commit intoprometheus:mainfrom
roidelapluie:trackTimestampsStaleness

Conversation

@roidelapluie
Copy link
Copy Markdown
Member

@roidelapluie roidelapluie commented Oct 31, 2023

Add the ability to track staleness when an explicit timestamp is set. Useful for cAdvisor.

fixes #11565

Add the ability to track staleness when an explicit timestamp is set.
Useful for cAdvisor.

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
Copy link
Copy Markdown
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

Awesome, this will be very good for cAdvisor users.

Comment on lines +229 to +230
# inserted in the TSDB when a metric is no longer present or the target
# is down.
Copy link
Copy Markdown
Member

@SuperQ SuperQ Oct 31, 2023

Choose a reason for hiding this comment

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

Are there any other cases where we would/wouldn't insert a staleness marker?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

no. do you think we should improve the wording?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No, wording is fine. I was just wondering if we had an exception to these.

@roidelapluie roidelapluie merged commit 79bbfe6 into prometheus:main Oct 31, 2023
@jan--f
Copy link
Copy Markdown
Contributor

jan--f commented Nov 1, 2023

Awesome, thanks!

roidelapluie pushed a commit to roidelapluie/prometheus that referenced this pull request Nov 9, 2023
This commit introduces an additional test in `scrape_test.go` to verify
staleness tracking when `trackTimestampStaleness` is enabled. The new
`TestScrapeLoopAppendStalenessIfTrackTimestampStaleness` function
asserts that the scrape loop correctly appends staleness markers when
necessary, reflecting the expected behavior with the feature flag turned
on.

The previous tests were only testing end of scrape staleness.

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
roidelapluie pushed a commit to roidelapluie/prometheus that referenced this pull request Nov 9, 2023
This commit introduces an additional test in `scrape_test.go` to verify
staleness tracking when `trackTimestampStaleness` is enabled. The new
`TestScrapeLoopAppendStalenessIfTrackTimestampStaleness` function
asserts that the scrape loop correctly appends staleness markers when
necessary, reflecting the expected behavior with the feature flag turned
on.

The previous tests were only testing end of scrape staleness.

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
roidelapluie pushed a commit that referenced this pull request Nov 9, 2023
Follow-up to #13060: Add test to ensure staleness tracking
bboreham pushed a commit to grafana/agent that referenced this pull request Feb 6, 2024
bboreham pushed a commit to grafana/agent that referenced this pull request Feb 6, 2024
rfratto pushed a commit to grafana/agent that referenced this pull request Feb 6, 2024
Added upstream 4 months ago:
prometheus/prometheus#13060

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
BarunKGP pushed a commit to BarunKGP/grafana-agent that referenced this pull request Feb 20, 2024
Added upstream 4 months ago:
prometheus/prometheus#13060

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
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.

Improve staleness handling for series with explicit timestamps

3 participants