File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
packages/service-library/src/servicelib Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 1212 CONTENT_TYPE_LATEST ,
1313)
1414from prometheus_client .registry import CollectorRegistry
15- from servicelib .aiohttp .typing_extension import Handler
16- from servicelib .prometheus_metrics import (
17- PrometheusMetrics ,
18- get_prometheus_metrics ,
19- record_request_metrics ,
20- record_response_metrics ,
21- )
2215
2316from ..common_headers import (
2417 UNDEFINED_DEFAULT_SIMCORE_USER_AGENT_VALUE ,
2518 X_SIMCORE_USER_AGENT ,
2619)
2720from ..logging_utils import log_catch
21+ from ..prometheus_metrics import (
22+ PrometheusMetrics ,
23+ get_prometheus_metrics ,
24+ record_request_metrics ,
25+ record_response_metrics ,
26+ )
27+ from .typing_extension import Handler
2828
2929log = logging .getLogger (__name__ )
3030
Original file line number Diff line number Diff line change @@ -66,9 +66,6 @@ async def dispatch(
6666
6767
6868def initialize_prometheus_instrumentation (app : FastAPI ) -> None :
69- # NOTE: this cannot be ran once the application is started
70-
71- # NOTE: use that registry to prevent having a global one
7269 metrics = get_prometheus_metrics ()
7370 app .state .prometheus_metrics = metrics
7471 app .add_middleware (PrometheusMiddleware , metrics = metrics )
You can’t perform that action at this time.
0 commit comments