Skip to content

Conversation

incertum
Copy link
Contributor

Add {emitToString, emitToBuffer} thread-safe internal buffer management variants to emit metrics.

Deduplicate TYPE and HELP lines per metric name by default on emit.

Fixes #118 @ptoffy

CC @ktoso and @FranzBusch

…per metric name

Add {emitToString, emitToBuffer} thread-safe internal buffer management variants to emit metrics.

Deduplicate TYPE and HELP lines per metric name by default on emit + enforce same HELP per metric name.

Signed-off-by: Melissa Kilby <[email protected]>
… sharing

Revert to stricter mutual exclusivity constraints for metric name sharing with respect to labeled and unlabeled cases while still allowing different label sets per metric name. While Prometheus wouldn't break with sharing a metric name for labeled and unlabeled variants, the client enforces that each unique metric name must either be labeled (allowing multiple label sets) or unlabeled in order to support correct Prometheus aggregations.

Use MetricFamily instead of MetricGroup.

Signed-off-by: Melissa Kilby <[email protected]>
@incertum incertum force-pushed the new/emit-to-string-alternative branch from 72e503b to 1184ea7 Compare August 28, 2025 18:29
@incertum
Copy link
Contributor Author

New emit variants should address thread-safety requirements #136.
Question: Is it even ok to feature a not thread-safe option?

@incertum
Copy link
Contributor Author

Fixes #137

@incertum
Copy link
Contributor Author

Fixes #138, amendment to #125 as initial fixes were slightly too permissive wrt metric name sharing.

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.

Awkward collection API
2 participants