server: add prometheus instrumentation

This commit is contained in:
2023-09-12 13:11:13 +02:00
parent 487eb1ae22
commit 60edca6366
9 changed files with 235 additions and 34 deletions

View File

@@ -31,13 +31,11 @@ engine = sqlalchemy.create_engine(
metadata.create_all(engine)
async def database_connect():
@subscribers_startup.append
async def database_connect(_):
await database.connect()
async def database_disconnect():
@subscribers_shutdown.append
async def database_disconnect(_):
await database.disconnect()
subscribers_startup.append(database_connect)
subscribers_shutdown.append(database_disconnect)