Skip to content

Commit

Permalink
feat: removed legacy new relic support
Browse files Browse the repository at this point in the history
  • Loading branch information
abdullahwaheed committed Aug 5, 2024
1 parent 1c8ea2f commit f92e584
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
3 changes: 0 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,5 @@
},
"devDependencies": {
"@openedx/frontend-build": "^14.0.3"
},
"peerDependencies": {
"@edx/frontend-platform": "^5.0.0 ||^6.0.0 || ^7.0.0 || ^8.0.0"
}
}
7 changes: 1 addition & 6 deletions src/DatadogLoggingService.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { datadogRum } from '@datadog/browser-rum';
import { datadogLogs } from '@datadog/browser-logs';
import { NewRelicLoggingService } from '@edx/frontend-platform/logging';

const browserLogNameIgnoredError = 'IGNORED_ERROR';

Expand All @@ -19,9 +18,8 @@ function sendError(error, customAttributes) {
datadogLogs.logger.error(error, customAttributes);
}

class DatadogLoggingService extends NewRelicLoggingService {
class DatadogLoggingService {
constructor(options) {
super(options);
const config = options ? options.config : undefined;
this.ignoredErrorRegexes = config ? config.IGNORED_ERROR_REGEX : undefined;
this.initialize();
Expand Down Expand Up @@ -76,7 +74,6 @@ class DatadogLoggingService extends NewRelicLoggingService {
}

logInfo(infoStringOrErrorObject, customAttributes = {}) {
super.logInfo(infoStringOrErrorObject, customAttributes);
let message = infoStringOrErrorObject;
let customAttrs = { ...customAttributes };
if (typeof infoStringOrErrorObject === 'object' && 'message' in infoStringOrErrorObject) {
Expand All @@ -95,7 +92,6 @@ class DatadogLoggingService extends NewRelicLoggingService {
* @memberof DatadogLoggingService
*/
logError(errorStringOrObject, customAttributes = {}) {
super.logError(errorStringOrObject, customAttributes);
const errorCustomAttributes = errorStringOrObject.customAttributes || {};
let allCustomAttributes = { ...errorCustomAttributes, ...customAttributes };
if (Object.keys(allCustomAttributes).length === 0) {
Expand Down Expand Up @@ -124,7 +120,6 @@ class DatadogLoggingService extends NewRelicLoggingService {
* @param {string|number|null} value
*/
setCustomAttribute(name, value) {
super.setCustomAttribute(name, value);
if (name === 'userId') {
datadogLogs.setUserProperty('id', value);
datadogRum.setUserProperty('id', value);
Expand Down

0 comments on commit f92e584

Please sign in to comment.