From 4d6c28d5608c50dccb9d78ce6c8385e003f0a4b3 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Sun, 12 Jan 2020 10:41:19 +0100 Subject: Start Prometheus HTTP server on bot start. --- bot/bot.py | 3 +++ 1 file changed, 3 insertions(+) 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) -- cgit v1.2.3