Skip to content

feat: add opt-in typed metric family descriptors#2122

Closed
zeitlinger wants to merge 4 commits into
prometheus:mainfrom
zeitlinger:alt/typed-metric-family-descriptor-opt-in
Closed

feat: add opt-in typed metric family descriptors#2122
zeitlinger wants to merge 4 commits into
prometheus:mainfrom
zeitlinger:alt/typed-metric-family-descriptor-opt-in

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

@zeitlinger zeitlinger commented May 18, 2026

Alternative to #2114 that keeps typed metric family descriptors opt-in.

Difference from #2114:

  • Keeps the legacy snapshot builders using plain MetricMetadata construction.
  • Does not derive counter/info metadata automatically in CounterSnapshot.Builder or InfoSnapshot.Builder.
  • Restores the builder fields to private and avoids forcing legacy/deprecated consumers into the typed descriptor path.

The new typed descriptor API remains available for collectors that explicitly opt in to the new behavior.

Related validation:

Local validation:

  • mise run build

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger
Copy link
Copy Markdown
Member Author

Closing this alternate branch. After re-checking #1800, the Collector/MultiCollector registration metadata hooks are already optional via default methods. #2114 is the right typed-descriptor branch; the validation PRs are now restacked on #2114 instead of this alternate.

@zeitlinger zeitlinger closed this May 18, 2026
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.

1 participant