    def restricted_registry(self, names: Iterable[str]) -> "RestrictedRegistry":
        """Returns object that only collects some metrics.

        Returns an object which upon collect() will return
        only samples with the given names.

        Intended usage is:
            generate_latest(REGISTRY.restricted_registry(['a_timeseries']))

        Experimental."""
        names = set(names)
        return RestrictedRegistry(names, self)
Returns object that only collects some metrics.

Returns an object which upon collect() will return
only samples with the given names.

Intended usage is:
generate_latest(REGISTRY.restricted_registry(['a_timeseries']))

Experimental.
prometheus_client/registry.py