src/nameko_prometheus/dependencies.py
def worker_result(
        self, worker_ctx: WorkerContext, result=None, exc_info=None
    ) -> None:
        """
        Called after service worker completes.

        At this point the default metrics such as worker latency are observed,
        regardless of whether the worker finished successfully or raised an
        exception.
        """
        try:
            start = self.worker_starts.pop(worker_ctx)
        except KeyError:
            logger.warning("No worker_ctx in request start dictionary")
            return
        worker_summary = WorkerSummary(
            duration=time.perf_counter() - start,
            result=result,
            exc_info=exc_info,
        )
        self.observe_entrypoint(worker_ctx.entrypoint, worker_summary)
        self.observe_state_metrics()

        Called after service worker completes.

        At this point the default metrics such as worker latency are observed,
        regardless of whether the worker finished successfully or raised an
        exception.
        
Called after service worker completes.
At this point the default metrics such as worker latency are observed,
regardless of whether the worker finished successfully or raised an
exception.
Called after service worker completes . At this point the default metrics such as worker latency are observed regardless of whether the worker finished successfully or raised an exception .
def worker_result(
        self, worker_ctx: WorkerContext, result=None, exc_info=None
    ) -> None:
        try:
            start = self.worker_starts.pop(worker_ctx)
        except KeyError:
            logger.warning("No worker_ctx in request start dictionary")
            return
        worker_summary = WorkerSummary(
            duration=time.perf_counter() - start,
            result=result,
            exc_info=exc_info,
        )
        self.observe_entrypoint(worker_ctx.entrypoint, worker_summary)
        self.observe_state_metrics()
def worker_result ( self , worker_ctx : WorkerContext , result = None , exc_info = None ) -> None : try : start = self . worker_starts . pop ( worker_ctx ) except KeyError : logger . warning ( "No worker_ctx in request start dictionary" ) return worker_summary = WorkerSummary ( duration = time . perf_counter ( ) - start , result = result , exc_info = exc_info , ) self . observe_entrypoint ( worker_ctx . entrypoint , worker_summary ) self . observe_state_metrics ( )
Called after service worker completes.
Called after service worker completes .
"""
        Called after service worker completes.

        At this point the default metrics such as worker latency are observed,
        regardless of whether the worker finished successfully or raised an
        exception.
        """
self
worker_ctx
WorkerContext
result
exc_info