Skip to content

Make InfoMetricFamily.add_metric labels and value optional - #1263

Open
harish-ram247 wants to merge 1 commit into
prometheus:masterfrom
harish-ram247:info-metric-defaults
Open

harish-ram247 wants to merge 1 commit into
prometheus:masterfrom
harish-ram247:info-metric-defaults

Conversation

@harish-ram247

Copy link
Copy Markdown

InfoMetricFamily.add_metric() required both labels and value, even when only one was needed. Both now have empty defaults. Argument order is unchanged, so existing calls behave as before. I added tests for leaving out each argument.

Addresses the default-values part of #1049. The naming and dictionary-label points are unchanged.

I had AI help writing the change and tests.

@csmarchbanks

Signed-off-by: Harish Ram S <harishram2407@gmail.com>

This branch has not been deployed

No deployments
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