src/nameko_prometheus/dependencies.py
def expose_metrics(self, request: Request) -> Response:
        """
        Returns metrics as a HTTP response in Prometheus text format.
        """
        if "name" not in request.args:
            logger.debug(
                "Registry name(s) not found in query string, using global registry"
            )
            registry = REGISTRY
        else:
            names = request.args.getlist("name")
            registry = REGISTRY.restricted_registry(names)
        encoder, content_type = choose_encoder(request.headers["Accept"])
        try:
            output = encoder(registry)
            return Response(output, status=200, content_type=content_type)
        except Exception:
            message = "Failed to generate metrics"
            logger.exception(message)
            return Response(message, status=500)

        Returns metrics as a HTTP response in Prometheus text format.
        
Returns metrics as a HTTP response in Prometheus text format.
Returns metrics as a HTTP response in Prometheus text format .
def expose_metrics(self, request: Request) -> Response:
        if "name" not in request.args:
            logger.debug(
                "Registry name(s) not found in query string, using global registry"
            )
            registry = REGISTRY
        else:
            names = request.args.getlist("name")
            registry = REGISTRY.restricted_registry(names)
        encoder, content_type = choose_encoder(request.headers["Accept"])
        try:
            output = encoder(registry)
            return Response(output, status=200, content_type=content_type)
        except Exception:
            message = "Failed to generate metrics"
            logger.exception(message)
            return Response(message, status=500)
def expose_metrics ( self , request : Request ) -> Response : if "name" not in request . args : logger . debug ( "Registry name(s) not found in query string, using global registry" ) registry = REGISTRY else : names = request . args . getlist ( "name" ) registry = REGISTRY . restricted_registry ( names ) encoder , content_type = choose_encoder ( request . headers [ "Accept" ] ) try : output = encoder ( registry ) return Response ( output , status = 200 , content_type = content_type ) except Exception : message = "Failed to generate metrics" logger . exception ( message ) return Response ( message , status = 500 )
Returns metrics as a HTTP response in Prometheus text format.
Returns metrics as a HTTP response in Prometheus text format .
"""
        Returns metrics as a HTTP response in Prometheus text format.
        """
self
request
Request