From f92e584cfae7e14495c20bd2dc72a098a32ace10 Mon Sep 17 00:00:00 2001 From: Muhammad Abdullah Waheed Date: Mon, 5 Aug 2024 13:44:25 +0500 Subject: [PATCH] feat: removed legacy new relic support --- package-lock.json | 3 --- package.json | 3 --- src/DatadogLoggingService.js | 7 +------ 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index da1ada7..b80255e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,9 +14,6 @@ }, "devDependencies": { "@openedx/frontend-build": "^14.0.3" - }, - "peerDependencies": { - "@edx/frontend-platform": "^5.0.0 ||^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/@ampproject/remapping": { diff --git a/package.json b/package.json index a77d611..15b86d9 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/src/DatadogLoggingService.js b/src/DatadogLoggingService.js index f27f472..18526ec 100644 --- a/src/DatadogLoggingService.js +++ b/src/DatadogLoggingService.js @@ -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'; @@ -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(); @@ -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) { @@ -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) { @@ -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);