diff --git a/matrix_alertbot/alertmanager.py b/matrix_alertbot/alertmanager.py index 5fafef3..2f813fd 100644 --- a/matrix_alertbot/alertmanager.py +++ b/matrix_alertbot/alertmanager.py @@ -6,6 +6,7 @@ from typing import Any, Dict, List import aiohttp import pytimeparse from aiohttp import ClientError +from aiohttp_prometheus_exporter.trace import PrometheusTraceConfig from diskcache import Cache from matrix_alertbot.errors import ( @@ -19,7 +20,7 @@ class AlertmanagerClient: def __init__(self, url: str, cache: Cache) -> None: self.api_url = f"{url}/api/v2" self.cache = cache - self.session = aiohttp.ClientSession() + self.session = aiohttp.ClientSession(trace_configs=[PrometheusTraceConfig()]) async def close(self) -> None: await self.session.close()