aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2020-01-12 10:41:19 +0100
committerGravatar Johannes Christ <[email protected]>2020-01-12 11:58:57 +0100
commit4d6c28d5608c50dccb9d78ce6c8385e003f0a4b3 (patch)
treee8406bf40641cbd8a47b6cf1f67f0fca6071e09d
parentInstall `prometheus-async`. (diff)
Start Prometheus HTTP server on bot start.
Diffstat (limited to '')
-rw-r--r--bot/bot.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/bot.py b/bot/bot.py
index 8f808272f..930aaf70e 100644
--- a/bot/bot.py
+++ b/bot/bot.py
@@ -4,6 +4,7 @@ from typing import Optional
import aiohttp
from discord.ext import commands
+from prometheus_async.aio.web import start_http_server as start_prometheus_http_server
from bot import api
@@ -50,4 +51,6 @@ class Bot(commands.Bot):
"""Open an aiohttp session before logging in and connecting to Discord."""
self.http_session = aiohttp.ClientSession(connector=self.connector)
+ await start_prometheus_http_server(addr="0.0.0.0", port=9330)
+ log.debug("Started Prometheus server on port 9330.")
await super().start(*args, **kwargs)