From 25e672c581f8369e78fc58d7e60f56784c50e9b5 Mon Sep 17 00:00:00 2001 From: Gabriel Dugny Date: Sat, 14 Mar 2026 14:19:11 +0100 Subject: [PATCH] Add metric unit Signed-off-by: Gabriel Dugny --- .changeset/solid-bats-flash.md | 2 +- .../src/lib/SlackNotificationProcessor.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.changeset/solid-bats-flash.md b/.changeset/solid-bats-flash.md index c14603ec50..0a4918fcc2 100644 --- a/.changeset/solid-bats-flash.md +++ b/.changeset/solid-bats-flash.md @@ -2,4 +2,4 @@ '@backstage/plugin-notifications-backend-module-slack': patch --- -The Slack notification processor now uses the `MetricsService` to create metrics, providing plugin-scoped attribution. +The Slack notification processor now uses the `MetricsService` to create metrics, providing plugin-scoped attribution. `{message}` unit has also been added. diff --git a/plugins/notifications-backend-module-slack/src/lib/SlackNotificationProcessor.ts b/plugins/notifications-backend-module-slack/src/lib/SlackNotificationProcessor.ts index d20587f2a1..28846fcbb5 100644 --- a/plugins/notifications-backend-module-slack/src/lib/SlackNotificationProcessor.ts +++ b/plugins/notifications-backend-module-slack/src/lib/SlackNotificationProcessor.ts @@ -169,12 +169,14 @@ export class SlackNotificationProcessor implements NotificationProcessor { 'notifications.processors.slack.sent.count', { description: 'Number of messages sent to Slack successfully', + unit: '{message}', }, ); this.messagesFailed = metrics.createCounter( 'notifications.processors.slack.error.count', { description: 'Number of messages that failed to send to Slack', + unit: '{message}', }, );