Skip to content

Feature request - public registry._names_to_collectors access #1071

Description

@Lancetnik

Now we are working on Prometheus support in FastStream and faced with a problem. Shared registry between different middlewares leads to MetricsContainer duplication. So, we would like to have a public API to chech registry for already registered objects.

Can you please provide public access to this property some way?

https://github.com/prometheus/client_python/blob/master/prometheus_client/registry.py#L31

I think, the easiest way to save old API and provide us with a new one - add a public property like in the following snipper

class CollectorRegistry(Collector):
    def __init__(self):
        self._names_to_collectors: Dict[str, Collector] = {}

    @property
    def names_to_collectors(self):
        return self._names_to_collectors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions