Skip to content

Commit

Permalink
Merge pull request #751 from mountaindude/master
Browse files Browse the repository at this point in the history
.
  • Loading branch information
mountaindude authored Aug 17, 2023
2 parents 0f6480f + 2caf4f5 commit 24fd3f5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/lib/incident_mgmt/new_relic.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,11 @@ async function sendNewRelicEvent(incidentConfig, reloadParams, destNewRelicAccou
// Build final payload
const payload = [];

if (incidentConfig?.eventType === 'qs_reloadTaskAbortedEvent' || incidentConfig?.logType === 'qs_reloadTaskFailedLog') {
if (
incidentConfig?.eventType === 'qs_reloadTaskAbortedEvent' ||
incidentConfig?.eventType === 'qs_reloadTaskFailedEvent' ||
incidentConfig?.logType === 'qs_reloadTaskFailedLog'
) {
payload.push(Object.assign(incidentConfig.attributes, reloadParams));
} else if (incidentConfig?.eventType === 'qs_serviceStateEvent') {
payload.push(incidentConfig.attributes);
Expand Down Expand Up @@ -393,7 +397,13 @@ async function sendNewRelicEvent(incidentConfig, reloadParams, destNewRelicAccou
}
}
} catch (err) {
globals.logger.error(`NEWRELIC: ${JSON.stringify(err, null, 2)}`);
if (err.message) {
globals.logger.error(`NEWRELIC 1 message: ${err.message}`);
}

if (err.stack) {
globals.logger.error(`NEWRELIC 1 stack: ${err.stack}`);
}
}
}

Expand Down Expand Up @@ -510,7 +520,7 @@ async function sendNewRelicLog(incidentConfig, reloadParams, destNewRelicAccount
}
}
} catch (err) {
globals.logger.error(`NEWRELIC: ${JSON.stringify(err, null, 2)}`);
globals.logger.error(`NEWRELIC 2: ${JSON.stringify(err, null, 2)}`);
}
}

Expand Down

0 comments on commit 24fd3f5

Please sign in to comment.