Skip to content

Commit

Permalink
fix: Better log messages when rate limiting for reload notifications …
Browse files Browse the repository at this point in the history
…passes

Fixes #571
  • Loading branch information
Göran Sander committed Dec 9, 2022
1 parent cc6e812 commit 0ee04fb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/lib/incident_mgmt/new_relic.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ async function sendReloadTaskFailureEvent(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`TASK FAILED NEWRELIC: Rate limiting ok: Sending reload failure event to New Relic for task "${params.qs_taskName}"`
`TASK FAILED NEWRELIC: Rate limiting check passed for failed task event. Task name: "${params.qs_taskName}"`
);
globals.logger.verbose(`TASK FAILED NEWRELIC: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down Expand Up @@ -642,7 +642,7 @@ async function sendReloadTaskFailureLog(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`TASK FAILED NEWRELIC: Rate limiting ok: Sending reload failure log entry to New Relic for task "${params.qs_taskName}"`
`TASK FAILED NEWRELIC: Rate limiting check passed for failed task log entry. Task name: "${params.qs_taskName}"`
);
globals.logger.verbose(`TASK FAILED NEWRELIC: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down Expand Up @@ -770,7 +770,7 @@ function sendReloadTaskAbortedEvent(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`TASK ABORT NEWRELIC: Rate limiting ok: Sending reload aborted event to New Relic for task "${params.qs_taskName}"`
`TASK ABORT NEWRELIC: Rate limiting check passed for abort task event. Task name: "${params.qs_taskName}"`
);
globals.logger.verbose(`TASK ABORT NEWRELIC: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down Expand Up @@ -900,7 +900,7 @@ function sendReloadTaskAbortedLog(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`TASK ABORT NEWRELIC: Rate limiting ok: Sending reload abort log entry to New Relic for task "${params.qs_taskName}"`
`TASK ABORT NEWRELIC: Rate limiting check passed for abort task log entry. Task name: "${params.qs_taskName}"`
);
globals.logger.verbose(`TASK ABORT NEWRELIC: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down
4 changes: 2 additions & 2 deletions src/lib/incident_mgmt/signl4.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function sendReloadTaskFailureNotification(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`TASK FAILED ALERT SIGNL4: Rate limiting ok: Sending reload failure notification to Signl4 for task "${reloadParams.taskName}"`
`TASK FAILED ALERT SIGNL4: Rate limiting check passed for failed task notification. Task name: "${reloadParams.taskName}"`
);
globals.logger.verbose(`TASK FAILED ALERT SIGNL4: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down Expand Up @@ -162,7 +162,7 @@ function sendReloadTaskAbortedNotification(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`SIGNL4ABORTED: Rate limiting ok: Sending reload aborted notification to Signl4 for task "${reloadParams.taskName}"`
`SIGNL4ABORTED: Rate limiting check passed for aborted task notification. Task name: "${reloadParams.taskName}"`
);
globals.logger.verbose(`SIGNL4ABORTED: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down
4 changes: 2 additions & 2 deletions src/lib/msteams_notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ function sendReloadTaskFailureNotificationTeams(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`TASK FAILED ALERT TEAMS: Rate limiting ok: Sending reload failure notification Teams for task "${reloadParams.taskName}"`
`TASK FAILED ALERT TEAMS: Rate limiting check passed for failed task notification. Task name: "${reloadParams.taskName}"`
);
globals.logger.verbose(`TASK FAILED ALERT TEAMS: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down Expand Up @@ -410,7 +410,7 @@ function sendReloadTaskAbortedNotificationTeams(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`TASK ABORTED ALERT TEAMS: Rate limiting ok: Sending reload aborted notification Teams for task "${reloadParams.taskName}"`
`TASK ABORTED ALERT TEAMS: Rate limiting check passed for aborted task notification. Task name: "${reloadParams.taskName}"`
);
globals.logger.verbose(`TASK ABORTED ALERT TEAMS: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down
4 changes: 2 additions & 2 deletions src/lib/slack_notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ function sendReloadTaskFailureNotificationSlack(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`TASK FAILED ALERT SLACK: Rate limiting ok: Sending reload failure notification Slack for task "${reloadParams.taskName}"`
`TASK FAILED ALERT SLACK: Rate limiting check passed for failed task notification. Task name: "${reloadParams.taskName}"`
);
globals.logger.verbose(`TASK FAILED ALERT SLACK: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down Expand Up @@ -438,7 +438,7 @@ function sendReloadTaskAbortedNotificationSlack(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`TASK ABORTED ALERT SLACK: Rate limiting ok: Sending reload aborted notification Slack for task "${reloadParams.taskName}"`
`TASK ABORTED ALERT SLACK: Rate limiting check passed for aborted task notification. Task name: "${reloadParams.taskName}"`
);
globals.logger.verbose(`TASK ABORTED ALERT SLACK: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down
4 changes: 2 additions & 2 deletions src/lib/smtp.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ async function sendReloadTaskFailureNotificationEmail(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`TASK FAILED ALERT EMAIL: Rate limiting ok: Sending reload failure notification email for task "${reloadParams.taskName}" to "${recipientEmailAddress}"`
`TASK FAILED ALERT EMAIL: Rate limiting check passed for failed task notification. Task name: "${reloadParams.taskName}", Recipient: "${recipientEmailAddress}"`
);
globals.logger.debug(`TASK FAILED ALERT EMAIL: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down Expand Up @@ -714,7 +714,7 @@ async function sendReloadTaskAbortedNotificationEmail(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`TASK ABORTED ALERT EMAIL: Rate limiting ok: Sending reload aborted notification email for task "${reloadParams.taskName}" to "${recipientEmailAddress}"`
`TASK ABORTED ALERT EMAIL: Rate limiting check passed for aborted task notification. Task name: "${reloadParams.taskName}", Recipient: "${recipientEmailAddress}"`
);
globals.logger.debug(`TASK ABORTED ALERT EMAIL: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down
4 changes: 2 additions & 2 deletions src/lib/webhook_notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function sendReloadTaskFailureNotificationWebhook(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`WEBHOOKOUTFAILED: Rate limiting ok: Sending reload failure notification outgoing webhook for task "${reloadParams.taskName}"`
`WEBHOOKOUTFAILED: Rate limiting check passed for failed task notification. Task name: "${reloadParams.taskName}"`
);
globals.logger.verbose(`WEBHOOKOUTFAILED: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down Expand Up @@ -222,7 +222,7 @@ function sendReloadTaskAbortedNotificationWebhook(reloadParams) {
.then(async (rateLimiterRes) => {
try {
globals.logger.info(
`WEBHOOKOUTABORTED: Rate limiting ok: Sending reload aborted notification via outgoing webhook for task "${reloadParams.taskName}"`
`WEBHOOKOUTABORTED: Rate limiting check passed for aborted task notification. Task name: "${reloadParams.taskName}"`
);
globals.logger.verbose(`WEBHOOKOUTABORTED: Rate limiting details "${JSON.stringify(rateLimiterRes, null, 2)}"`);

Expand Down

0 comments on commit 0ee04fb

Please sign in to comment.