Skip to content

Commit

Permalink
Prometheus: Fix notification metric (#10803)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigok authored May 17, 2018
1 parent 5f5914e commit 6d7b726
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function shouldNotifyAudio({
}

export function notifyAudioUser(userId, message, room) {
RocketChat.metrics.notificationsSent.inc({ type: 'audio' }, 1, new Date());
RocketChat.metrics.notificationsSent.inc({ notification_type: 'audio' }, 1, new Date());
RocketChat.Notifications.notifyUser(userId, 'audioNotification', {
payload: {
_id: message._id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function notifyDesktopUser({
return;
}

RocketChat.metrics.notificationsSent.inc({ type: 'desktop' }, 1, new Date());
RocketChat.metrics.notificationsSent.inc({ notification_type: 'desktop' }, 1, new Date());
RocketChat.Notifications.notifyUser(userId, 'notification', {
title,
text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function sendEmail({ message, user, subscription, room, emailAddress, toA
}

Meteor.defer(() => {
RocketChat.metrics.notificationsSent.inc({ type: 'email' }, 1, new Date());
RocketChat.metrics.notificationsSent.inc({ notification_type: 'email' }, 1, new Date());
Email.send(email);
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-lib/server/lib/PushNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class PushNotification {
};
}

RocketChat.metrics.notificationsSent.inc({ type: 'mobile' }, 1, new Date());
RocketChat.metrics.notificationsSent.inc({ notification_type: 'mobile' }, 1, new Date());
return Push.send(config);
}
}
Expand Down

0 comments on commit 6d7b726

Please sign in to comment.