Add prometheus telemetry
All checks were successful
Build Docker image / test (push) Successful in 5m36s
Build Docker image / build (push) Successful in 8m19s

This commit is contained in:
Roman Krček
2025-05-06 20:06:36 +02:00
parent 8cc1c55026
commit 8829caceee
6 changed files with 320 additions and 276 deletions

View File

@@ -10,8 +10,11 @@ from telegram_downloader_bot.settings import settings
uvloop.install()
if settings.app_env == "PROD":
if settings.app_env == "production":
log.info("Starting telemetry server, in production mode.")
init_telemetry()
else:
log.info("Not starting telemetry server, not in production mode.")
app = Client("downloader_bot",
api_id=settings.api_id,
@@ -56,9 +59,9 @@ async def message_handler(_, message: Message):
msg = f"Downloading video {i+1}/{len(urls)}..."
log.info(msg)
await message.reply_text(msg)
await utils.download_tt_video(url)
status = await utils.download_tt_video(url)
await message.reply_text("Done.")
await message.reply_text(f"Done. {status}")
@app.on_message(filters.media)