Skip to content

wip: refactor: uniquely identify metric time series by name and label sets #131

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

incertum
Copy link
Contributor

@incertum incertum commented Aug 5, 2025

Previously, metrics were identified by their name. This change allows a shared metric name per metric type, with each unique set of labels defining a distinct time series.

Additionally, the internal data structure for a stored metric has been refactored, providing a more robust and programmatic representation.

CC @FranzBusch, @ktoso, @blindspotbounty

Let me know how you'd prefer to proceed. We have two main options:

  1. I can split this work into a few smaller, more focused PRs.
  2. We can finalize the overall approach in this PR, and I can push the remaining changes here next week.

Fixes #125 opened by @blindspotbounty

Previously, counters could only be identified by their name. This change allows multiple counters to share the same name, with each unique set of labels defining a distinct time series.

Additionally, the internal data structure for a stored metric has been refactored, providing a more robust and programmatic representation.

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

private enum MetricType {
case counterMetrics(String, MetricContainer<Counter>)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In general not sure yet about naming, ideas?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also I would love to benefit from your Swift expertise re below ... it's probably the Type? It should be typed out for each metric type?

 note: consider making enum 'MetricType' conform to the 'Sendable' protocol
    private enum MetricType {

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.

Crash if tags and not the same (allow different tags for the same metric name)
1 participant