-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(logs): implem v2 logging (#1945)
## Context Contributes to NAN-582 Since we started talking about that a lot of stuff have fluctuated. So here is a recap: - When we want to log something we create an `Operation` that will contain the state and the main data (i.e: account, env, sync, connection, user) - Each log message has the exact same schema with `parentId` filled with the `Operation`'s id - logs and operation are stored in the same index ## Changes - Double write of logs to Elasticsearch storage The write is currently controlled by the env var `NANGO_LOGS_ENABLED` to be able to disable everything if something goes wrong. The main calls to ES have been try/catched temporarily to also avoid any issue. It should cover all logs across the codebase, but it's missing a lot of context data (i.e: account, env name, sync, connection) that were not added to limit the size of this PR. ## How to test? - Set the env ```sh # (false will log to console only, true will log to OpenSearch) NANGO_LOGS_ENABLED=false | true ``` - Launch the backend ```sh npm run dw npm run dwa ``` - Launch a sync / action, create a connection, cancel a sync, deploy integrations - Go to http://localhost:9500/messages/_search?sort=createdAt:desc Its not very readable but you should find all the logs there. ## Next steps - Complete the missing data - New API endpoint - Implement the new UI - Switch to new UI - Remove activityLogId param wherever it's now useless (it's still going to be needed at some place where it's serialized) - Remove old library
- Loading branch information
1 parent
ae170ea
commit dfd74ff
Showing
95 changed files
with
1,720 additions
and
456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.