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

WIP: generator registry stale markers #4853

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

rlankfo
Copy link
Member

@rlankfo rlankfo commented Mar 14, 2025

What this PR does:
This PR adds stale marker support to the metrics generator registry. A series is marked stale when it's stale duration has elapsed. During the next collection interval, any series marked stale will append a stale marker value before removal from the metric's series map.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Sorry, something went wrong.

@rlankfo rlankfo self-assigned this Mar 14, 2025
@rlankfo rlankfo force-pushed the rlankfo/metrics-gen-registry-stale-markers branch from 3b14573 to 5d759ea Compare March 19, 2025 00:28
@rlankfo rlankfo force-pushed the rlankfo/metrics-gen-registry-stale-markers branch from cc7175c to 488efcc Compare March 20, 2025 03:57
@@ -147,30 +150,55 @@ func (c *counter) collectMetrics(appender storage.Appender, timeMs int64) (activ
endOfLastMinuteMs := getEndOfLastMinuteMs(timeMs)
_, err = appender.Append(0, s.labels, endOfLastMinuteMs, 0)
if err != nil {
c.seriesMtx.RUnlock()

Choose a reason for hiding this comment

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

Do you think we can avoid this manual unlocking? Makes it very easy to have a danging deadlock.

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.

None yet

3 participants