Skip to content

fix: gauge post collect, infinity handling - #334

Merged
kwasniew merged 2 commits into
mainfrom
gauge-post-collect-fix
Jan 28, 2026
Merged

kwasniew merged 2 commits into
mainfrom
gauge-post-collect-fix

Conversation

@kwasniew

@kwasniew kwasniew commented Jan 28, 2026 •

Copy link
Copy Markdown
Contributor

About the changes

Making yggdrasil spec compliant (Unleash/client-specification#107)

  • handle +/- infinity and NaN
  • gauges post collect should unset instead of report zero

Important files

Discussion points

Self { labels, value }
}

pub(crate) fn zero() -> Self {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this was different from node and java

if samples.is_empty() {
samples.push(GaugeMetricSample::zero());
}
self.values.clear();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

a small race window where values inserted between iteration and clear may be lost. should be fine for gauges

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.

Don't think it's a problem here, the lock is held at a higher level in Ygg, this is all sync code unless Edge decides it wants to start doing this for whatever reason

@kwasniew kwasniew changed the title fix: gauge post collect, infinity handling, deprecation fix: gauge post collect, infinity handling Jan 28, 2026
@kwasniew
kwasniew requested review from sighphyre and sjaanus January 28, 2026 12:56

@sighphyre sighphyre left a comment

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.

Cheers!

@github-project-automation github-project-automation Bot moved this from New to Approved PRs in Issues and PRs Jan 28, 2026
@kwasniew
kwasniew merged commit 3554a99 into main Jan 28, 2026
2 checks passed
@kwasniew
kwasniew deleted the gauge-post-collect-fix branch January 28, 2026 13:59
@github-project-automation github-project-automation Bot moved this from Approved PRs to Done in Issues and PRs Jan 28, 2026
@unleash-bot unleash-bot Bot mentioned this pull request Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants