from prometheus_client import CollectorRegistry registry = CollectorRegistry()
from prometheus_client import Counter registry = CollectorRegistry() # Define a counter metric requests_total = Counter('requests_total', 'Total requests served') # Register the counter in the registry registry.register(requests_total)In this example, we define a `Counter` metric to track the total number of requests served. We then register the counter with the previously created `CollectorRegistry` instance. Package Library: prometheus-client