Skip to content

Commit f1e12ce

Browse files
committed
- forward errors to instana
1 parent 2f0d34a commit f1e12ce

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

js/logging.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ loggingModule.factory(
5353
return false;
5454
}
5555

56-
if (LOGGING_CONFIG.FORWARD_TO_NEWRELIC && $window.NREUM && $window.NREUM.noticeError) {
57-
$window.NREUM.noticeError(exception, { url: $window.location.href });
56+
if (LOGGING_CONFIG.FORWARD_TO_INSTANA && typeof ineum !== undefined && ineum) {
57+
ineum('reportError', exception);
5858
}
5959

6060
// check if the config says we should log to the remote, and also if a remote endpoint was specified
@@ -123,7 +123,7 @@ loggingModule.factory(
123123
return (iRequestedLevel >= iLoggingThreshold);
124124
};
125125

126-
var log = function (severity, message, desc, sendToNewRelic) {
126+
var log = function (severity, message, desc, sendToInstana) {
127127
if (!isLoggingEnabledForSeverity(severity)) {
128128
return;
129129
}
@@ -148,8 +148,12 @@ loggingModule.factory(
148148
return false;
149149
}
150150

151-
if (sendToNewRelic && $window.NREUM && $window.NREUM.noticeError) {
152-
$window.NREUM.noticeError(message, { desc: desc, url: $window.location.href });
151+
if (sendToInstana) {
152+
ineum('reportError', message, {
153+
meta: {
154+
errorDescription: JSON.stringify(desc)
155+
}
156+
});
153157
}
154158

155159
// check if the config says we should log to the remote, and also if a remote endpoint was specified
@@ -190,8 +194,8 @@ loggingModule.factory(
190194
log('warn', message, desc);
191195
},
192196
error: function (message, desc) {
193-
var sendToNewRelic = LOGGING_CONFIG.FORWARD_TO_NEWRELIC && $window.NREUM && $window.NREUM.noticeError;
194-
log('error', message, desc, sendToNewRelic);
197+
var sendToInstana = LOGGING_CONFIG.FORWARD_TO_INSTANA && typeof ineum !== undefined && ineum;
198+
log('error', message, desc, sendToInstana);
195199
},
196200
setLoggingThreshold: function (level) {
197201
/*

0 commit comments

Comments
 (0)