Code Repositories xandikos / master
Make prometheus client support optional. Jelmer Vernooń≥ 12 days ago
2 changed file(s) with 7 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
4444 'dulwich>=0.19.1',
4545 'defusedxml',
4646 'jinja2',
47 'prometheus_client',
48 'aiohttp',
4947 ],
5048 packages=find_packages(),
5149 package_data={'xandikos': ['templates/*.html']},
11241124 from aiohttp import web
11251125
11261126 app = web.Application()
1127 setup_metrics(app)
1127 try:
1128 import prometheus_client
1129 except ModuleNotFoundError:
1130 logging.warning(
1131 'Prometheus client not found; /metrics will not be available.')
1132 else:
1133 setup_metrics(app)
11281134
11291135 for path in WELLKNOWN_DAV_PATHS:
11301136 app.router.add_route(