File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
services/director/src/simcore_service_director Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 11import prometheus_client
2- from aiohttp import web
2+ from fastapi import FastAPI
33from prometheus_client import CONTENT_TYPE_LATEST
44from prometheus_client .registry import CollectorRegistry
5-
6-
7- from servicelib .monitor_services import ( # pylint: disable=no-name-in-module
5+ from servicelib .monitor_services import (
86 add_instrumentation as add_services_instrumentation ,
97)
10-
11- from . import config
8+ from simcore_service_director .core .settings import ApplicationSettings
129
1310kCOLLECTOR_REGISTRY = f"{ __name__ } .collector_registry"
1411
@@ -21,8 +18,9 @@ async def metrics_handler(request: web.Request):
2118 return resp
2219
2320
24- def setup_app_monitoring (app : web .Application , app_name : str ) -> None :
25- if not config .MONITORING_ENABLED :
21+ def setup_app_monitoring (app : FastAPI , app_name : str ) -> None :
22+ app_settings : ApplicationSettings = app .state .settings
23+ if not app_settings .DIRECTOR_MONITORING_ENABLED :
2624 return
2725 # app-scope registry
2826 app [kCOLLECTOR_REGISTRY ] = reg = CollectorRegistry (auto_describe = True )
You can’t perform that action at this time.
0 commit comments