Skip to content

Commit

Permalink
Added prometheus client
Browse files Browse the repository at this point in the history
-- Defined metrics
  • Loading branch information
Amit Bhanja committed Feb 14, 2024
1 parent 57111a9 commit 2b76a9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/notify-slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ def worker(workq: multiprocessing.Queue):
log_local.error(f'Failed sending {msg} to {dest}: {resp.text}')
PROCESS_STATES.state('error - recoverable')
NOTIFICATIONS_ERROR.labels('slack',
f'{msg.value.get("NAME") or msg.value["RESOURCE_ID"] or msg.value["SUBS_NAME"]}'
f'{msg.value.get("NAME") or msg.value["SUBS_NAME"]}'
, dest, resp.text).inc()
else:
NOTIFICATIONS_SENT.labels('slack', f'{msg.value.get("NAME") or msg.value["RESOURCE_ID"] or msg.value["SUBS_NAME"]}'
NOTIFICATIONS_SENT.labels('slack', f'{msg.value.get("NAME") or msg.value["SUBS_NAME"]}'
, dest).inc()
log_local.info(f'sent: {msg} to {dest}')

Expand Down

0 comments on commit 2b76a9b

Please sign in to comment.