From 0e2b0c4470eca4fa49bace69d580df06c8827cb2 Mon Sep 17 00:00:00 2001 From: Wagner Lemos Date: Wed, 28 Jun 2023 16:46:41 -0300 Subject: [PATCH 1/3] remove spluck refs --- CHANGELOG.md | 4 ++++ react/index.tsx | 2 +- react/utils/logger.ts | 7 +++++++ react/utils/splunk.ts | 32 -------------------------------- 4 files changed, 12 insertions(+), 33 deletions(-) create mode 100644 react/utils/logger.ts delete mode 100644 react/utils/splunk.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eeb4e8c..8dd14707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Removed + +- Logs to Splunk. + ## [0.42.1] - 2023-01-26 ### Fixed diff --git a/react/index.tsx b/react/index.tsx index 8b08a349..8201b852 100644 --- a/react/index.tsx +++ b/react/index.tsx @@ -2,7 +2,7 @@ import React, { Component } from 'react' import AppRouter from './components/AppRouter' import ClientSide from './components/ClientSide' -import { logMyAccountURL, logGeneralErrors } from './utils/splunk' +import { logMyAccountURL, logGeneralErrors } from './utils/logger' import 'vtex.country-codes/locales' import './style.global.css' diff --git a/react/utils/logger.ts b/react/utils/logger.ts new file mode 100644 index 00000000..194e46ec --- /dev/null +++ b/react/utils/logger.ts @@ -0,0 +1,7 @@ +export function logMyAccountURL() { + // TODO: log in OpenSearch +} + +export function logGeneralErrors(_error: any, _info: any) { + // TODO: log in OpenSearch +} diff --git a/react/utils/splunk.ts b/react/utils/splunk.ts deleted file mode 100644 index 58d9f3a3..00000000 --- a/react/utils/splunk.ts +++ /dev/null @@ -1,32 +0,0 @@ -import SplunkEvents from 'splunk-events' - -const splunkEvents = new SplunkEvents() - -splunkEvents.config({ - endpoint: 'https://splunk-heavyforwarder-public.vtex.com:8088', - token: 'feee5906-39b2-43a5-bb46-b927b8e01da3', -}) - -export function logMyAccountURL() { - const { account } = window.__RUNTIME__ - - splunkEvents.logEvent('Important', 'Info', 'MyAccount', 'MyAccountURL', { - account, - }) -} - -export function logGeneralErrors(error: any, info: any) { - const { account } = window.__RUNTIME__ - - splunkEvents.logEvent( - 'Critical', - 'Error', - 'MyAccount', - 'MyAccountGeneralError', - { - error: JSON.stringify(error), - info: JSON.stringify(info), - }, - account - ) -} From afead35eff6fd6ed50351e2536411cecd8dbaaf2 Mon Sep 17 00:00:00 2001 From: Wagner Lemos Date: Wed, 28 Jun 2023 17:10:57 -0300 Subject: [PATCH 2/3] remove splunk events --- react/package.json | 5 ++--- react/typings/splunk-events.d.ts | 4 ---- react/yarn.lock | 5 ----- 3 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 react/typings/splunk-events.d.ts diff --git a/react/package.json b/react/package.json index 2eb3f701..4817c744 100644 --- a/react/package.json +++ b/react/package.json @@ -10,8 +10,7 @@ "react-dom": "^16.9.0", "react-intl": "^2.4.0", "react-media": "^1.8.0", - "recompose": "^0.27.1", - "splunk-events": "^1.3.0" + "recompose": "^0.27.1" }, "devDependencies": { "@types/exenv": "^1.2.0", @@ -38,4 +37,4 @@ "test": "vtex-test-tools test" }, "version": "0.42.2" -} +} \ No newline at end of file diff --git a/react/typings/splunk-events.d.ts b/react/typings/splunk-events.d.ts deleted file mode 100644 index f692bcb1..00000000 --- a/react/typings/splunk-events.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module 'splunk-events' { - const Splunk: Constructable - export default Splunk -} diff --git a/react/yarn.lock b/react/yarn.lock index 395bc849..e853358a 100644 --- a/react/yarn.lock +++ b/react/yarn.lock @@ -4343,11 +4343,6 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" -splunk-events@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/splunk-events/-/splunk-events-1.4.1.tgz#8e3b55fda415ee6df7d0bd6ce22e92757681d121" - integrity sha512-jiIuHdxNnLi/J3xr72AnZDGwMqoYTK0CWu2mPzrwPRol2txrKhRCcaSdWRmyfYFMLwWHLIgOL16JgY/TPnkUtA== - sshpk@^1.7.0: version "1.16.1" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" From 4a6c8ca06656574366259d11db7346fdd8c3af16 Mon Sep 17 00:00:00 2001 From: Wagner Lemos Date: Wed, 28 Jun 2023 17:19:57 -0300 Subject: [PATCH 3/3] package.json --- node/package.json | 2 +- node/yarn.lock | 10 +++++----- react/package.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/node/package.json b/node/package.json index 57b2b386..021c58aa 100644 --- a/node/package.json +++ b/node/package.json @@ -19,7 +19,7 @@ "vtex.styleguide": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@8.73.11/public/@types/vtex.styleguide" }, "dependencies": { - "@vtex/api": "6.45.5" + "@vtex/api": "6.45.15" }, "version": "0.42.2" } diff --git a/node/yarn.lock b/node/yarn.lock index 0655f07a..0139d9db 100644 --- a/node/yarn.lock +++ b/node/yarn.lock @@ -210,10 +210,10 @@ lodash.unescape "4.0.1" semver "5.5.0" -"@vtex/api@6.45.5": - version "6.45.5" - resolved "https://registry.yarnpkg.com/@vtex/api/-/api-6.45.5.tgz#1e7b64b93c4c8e170f7f1dba09a92883a6102b62" - integrity sha512-GpNnBZi6LVxJ+UT63KDfwcKJd7ETlJ7imBYcHPrQv89rmMS9nBGn++OKf7el6oi9N6/JIF9JzahL7PpKVkq/SA== +"@vtex/api@6.45.15": + version "6.45.15" + resolved "https://registry.yarnpkg.com/@vtex/api/-/api-6.45.15.tgz#aa987d22f7df16ce2861130deda6ffd63156817b" + integrity sha512-Rg1VGDzJ4hHUNp1vSidMdGGPojr1PikMTptlZsJ3oNZVdEo4cPx2l8ZcAEwHWORL7QjPjXaEgmeA5ZOSf+boCQ== dependencies: "@types/koa" "^2.11.0" "@types/koa-compose" "^3.2.3" @@ -1846,7 +1846,7 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -stats-lite@vtex/node-stats-lite#dist: +"stats-lite@github:vtex/node-stats-lite#dist": version "2.2.0" resolved "https://codeload.github.com/vtex/node-stats-lite/tar.gz/1b0d39cc41ef7aaecfd541191f877887a2044797" dependencies: diff --git a/react/package.json b/react/package.json index 4817c744..e6a849f0 100644 --- a/react/package.json +++ b/react/package.json @@ -37,4 +37,4 @@ "test": "vtex-test-tools test" }, "version": "0.42.2" -} \ No newline at end of file +}