Skip to content

Relax registry type annotations for exposition - #1149

Merged
csmarchbanks merged 2 commits into
prometheus:masterfrom
cjwatson:exposition-relax-collector-typing
Nov 26, 2025
Merged

Relax registry type annotations for exposition#1149
csmarchbanks merged 2 commits into
prometheus:masterfrom
cjwatson:exposition-relax-collector-typing

Conversation

@cjwatson

Copy link
Copy Markdown
Contributor

Anything with a suitable collect method will do: for instance, it's
sometimes useful to be able to define a class whose collect method
yields all metrics from a registry whose names have a given prefix, and
such a class doesn't need to inherit from CollectorRegistry.

We require Python >= 3.9 now, so there's no reason to avoid this any
more.

Signed-off-by: Colin Watson <cjwatson@debian.org>
Anything with a suitable `collect` method will do: for instance, it's
sometimes useful to be able to define a class whose `collect` method
yields all metrics from a registry whose names have a given prefix, and
such a class doesn't need to inherit from `CollectorRegistry`.

Signed-off-by: Colin Watson <cjwatson@debian.org>

@csmarchbanks csmarchbanks 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.

Nice to see that old comment addressed.

@csmarchbanks
csmarchbanks merged commit 13df124 into prometheus:master Nov 26, 2025
12 checks passed
@cjwatson
cjwatson deleted the exposition-relax-collector-typing branch January 15, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants