Skip to content

Commit

Permalink
Reduce the cardinality of request tracing metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
joinemm committed Apr 17, 2024
1 parent 2f3769d commit 5530123
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cogs/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, bot):
self.outgoing_requests = Counter(
"miso_outgoing_requests",
"Aiohttp clientsession total requests per domain.",
["host", "path"],
["host"],
)

async def cog_load(self):
Expand Down
4 changes: 1 addition & 3 deletions modules/misobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ async def get_context(self, message: discord.Message):
async def request_tracing(self, session, context, params):
try:
if prom := self.get_cog("Prometheus"):
prom.outgoing_requests.labels(
host=params.url.host, path=params.url.path
).inc() # type: ignore
prom.outgoing_requests.labels(host=params.url.host).inc() # type: ignore
except Exception as e:
logger.warning(f"Unhandled exception in tracing: {e}")

Expand Down

0 comments on commit 5530123

Please sign in to comment.