From 7b5696205573ba0117d75ee53afa6a796a180514 Mon Sep 17 00:00:00 2001 From: "Filipe W. Lima" <381395+filipewl@users.noreply.github.com> Date: Tue, 19 Sep 2023 14:49:25 -0300 Subject: [PATCH 1/4] Replace Splunk query reference with Lucene's, which is compatible to OS Since we're no longer using Splunk. --- CHANGELOG.md | 4 ++++ src/service/logger/logger.ts | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 925741a8e..f11c45511 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] +### Changed + +- Replace Spunk's reference to the app's error/warn logs with a valid OpenSearch's query. + ## [6.45.20] - 2023-08-30 ### Changed - Remove sampling decision from runtime diff --git a/src/service/logger/logger.ts b/src/service/logger/logger.ts index a37ebd5bc..54192e5d5 100644 --- a/src/service/logger/logger.ts +++ b/src/service/logger/logger.ts @@ -93,18 +93,18 @@ export class Logger { console.log(JSON.stringify(inflatedLog)) - // Warn the developer how to retrieve the error in splunk - this.logSplunkQuery() + // Warn the developer how to retrieve the error in the logging service + this.logLoggingServiceQuery() } /** - * Logs splunk query so the developer can search for the errors in splunk. + * Logs query so the developer can search for the errors in the logging service. * This function runs only once in the lifetime of the Logger class so we * don't mess up with the developer's terminal */ - private logSplunkQuery = () => { + private logLoggingServiceQuery = () => { if (linked) { - const message = `Try this query at Splunk to retrieve error log: 'index=io_vtex_logs app="${app}" account=${this.account} workspace=${this.workspace} level=error OR level=warn'` + const message = `Try this query at the logging service to retrieve error log (index = io_vtex_logs): 'Attributes.app:${app} AND Attributes.account:${this.account} AND Attributes.workspace:${this.workspace} AND (Attributes.level:error OR Attributes.level:warn)'` logOnceToDevConsole(message, LogLevel.Info) } } From 683a1d40fdf883644e2b5d3086068988a4414b67 Mon Sep 17 00:00:00 2001 From: "Filipe W. Lima" <381395+filipewl@users.noreply.github.com> Date: Tue, 19 Sep 2023 15:18:52 -0300 Subject: [PATCH 2/4] Log only if the app isn't 3P as user won't likely have access to OS --- src/service/logger/logger.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/service/logger/logger.ts b/src/service/logger/logger.ts index 54192e5d5..4b5ed9e5b 100644 --- a/src/service/logger/logger.ts +++ b/src/service/logger/logger.ts @@ -89,12 +89,12 @@ export class Logger { __SKIDDER_TOPIC_1: `skidder.vendor.${APP.VENDOR}`, __SKIDDER_TOPIC_2: `skidder.app.${APP.VENDOR}.${APP.NAME}`, }) + } else { + // Warn the developer how to retrieve the error in the logging service + this.logLoggingServiceQuery() } console.log(JSON.stringify(inflatedLog)) - - // Warn the developer how to retrieve the error in the logging service - this.logLoggingServiceQuery() } /** From 84de6b8801396be1901907241c560d5ea82a829b Mon Sep 17 00:00:00 2001 From: "Filipe W. Lima" <381395+filipewl@users.noreply.github.com> Date: Tue, 19 Sep 2023 15:55:22 -0300 Subject: [PATCH 3/4] Remove log altogether since it's something that should be known by us --- CHANGELOG.md | 4 ++-- src/service/logger/logger.ts | 15 --------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f11c45511..685127d98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -### Changed +### Removed -- Replace Spunk's reference to the app's error/warn logs with a valid OpenSearch's query. +- Remove reference of how to search for the app's errors on now-defunct Splunk. ## [6.45.20] - 2023-08-30 ### Changed diff --git a/src/service/logger/logger.ts b/src/service/logger/logger.ts index 4b5ed9e5b..f31e126b7 100644 --- a/src/service/logger/logger.ts +++ b/src/service/logger/logger.ts @@ -89,23 +89,8 @@ export class Logger { __SKIDDER_TOPIC_1: `skidder.vendor.${APP.VENDOR}`, __SKIDDER_TOPIC_2: `skidder.app.${APP.VENDOR}.${APP.NAME}`, }) - } else { - // Warn the developer how to retrieve the error in the logging service - this.logLoggingServiceQuery() } console.log(JSON.stringify(inflatedLog)) } - - /** - * Logs query so the developer can search for the errors in the logging service. - * This function runs only once in the lifetime of the Logger class so we - * don't mess up with the developer's terminal - */ - private logLoggingServiceQuery = () => { - if (linked) { - const message = `Try this query at the logging service to retrieve error log (index = io_vtex_logs): 'Attributes.app:${app} AND Attributes.account:${this.account} AND Attributes.workspace:${this.workspace} AND (Attributes.level:error OR Attributes.level:warn)'` - logOnceToDevConsole(message, LogLevel.Info) - } - } } From c94a0ba28629692ddcf196580655bb7b722523a1 Mon Sep 17 00:00:00 2001 From: "Filipe W. Lima" <381395+filipewl@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:26:24 -0300 Subject: [PATCH 4/4] Release v6.45.22 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fd812696..b3a456271 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [6.45.22] - 2023-09-20 + ### Removed - Remove reference of how to search for the app's errors on now-defunct Splunk. @@ -1797,11 +1799,12 @@ instead - `HttpClient` now adds `'Accept-Encoding': 'gzip'` header by default. -[Unreleased]: https://github.com/vtex/node-vtex-api/compare/v6.45.21...HEAD +[Unreleased]: https://github.com/vtex/node-vtex-api/compare/v6.45.22...HEAD [6.45.15]: https://github.com/vtex/node-vtex-api/compare/v6.45.14...v6.45.15 [6.45.14]: https://github.com/vtex/node-vtex-api/compare/v6.45.13...v6.45.14 [6.45.13]: https://github.com/vtex/node-vtex-api/compare/v6.45.12...v6.45.13 +[6.45.22]: https://github.com/vtex/node-vtex-api/compare/v6.45.21...v6.45.22 [6.45.21]: https://github.com/vtex/node-vtex-api/compare/v6.45.21-beta.2...v6.45.21 [6.45.21-beta.2]: https://github.com/vtex/node-vtex-api/compare/v6.45.21-beta.1...v6.45.21-beta.2 [6.45.21-beta.1]: https://github.com/vtex/node-vtex-api/compare/v6.45.21-beta.0...v6.45.21-beta.1 diff --git a/package.json b/package.json index a77a26374..e9885a147 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vtex/api", - "version": "6.45.21", + "version": "6.45.22", "description": "VTEX I/O API client", "main": "lib/index.js", "typings": "lib/index.d.ts",