From b48fdfcd88db55e5e602eb3946d1c4d67d17c03c Mon Sep 17 00:00:00 2001 From: Jamil Date: Thu, 31 Oct 2024 18:23:29 +0600 Subject: [PATCH] feat: include service name to sentry logs (#7841) * feat: attach service name to sentry log * Update packages/auth/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/config/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/documents/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/gateway/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/metrics/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/notification/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/search/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/user-mgnt/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/webhooks/src/config/plugins.ts Co-authored-by: Riku Rouvila * Update packages/workflow/src/config/plugins.ts Co-authored-by: Riku Rouvila --------- Co-authored-by: Riku Rouvila --- packages/auth/src/config/plugins.ts | 5 ++++- packages/config/src/config/plugins.ts | 5 ++++- packages/documents/src/config/plugins.ts | 5 ++++- packages/gateway/src/config/plugins.ts | 5 ++++- packages/metrics/src/config/plugins.ts | 5 ++++- packages/notification/src/config/plugins.ts | 5 ++++- packages/search/src/config/plugins.ts | 5 ++++- packages/user-mgnt/src/config/plugins.ts | 5 ++++- packages/webhooks/src/config/plugins.ts | 5 ++++- packages/workflow/src/config/plugins.ts | 5 ++++- 10 files changed, 40 insertions(+), 10 deletions(-) diff --git a/packages/auth/src/config/plugins.ts b/packages/auth/src/config/plugins.ts index b3254d5e7a0..3fe1527b5d3 100644 --- a/packages/auth/src/config/plugins.ts +++ b/packages/auth/src/config/plugins.ts @@ -36,7 +36,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: env.SENTRY_DSN + dsn: env.SENTRY_DSN, + initialScope: { + tags: { service: 'auth' } + } }, catchLogErrors: true } diff --git a/packages/config/src/config/plugins.ts b/packages/config/src/config/plugins.ts index eda61ca6ce1..0e6a8a30641 100644 --- a/packages/config/src/config/plugins.ts +++ b/packages/config/src/config/plugins.ts @@ -37,7 +37,10 @@ export default function getPlugins() { options: { client: { environment: env.DOMAIN, - dsn: env.SENTRY_DSN + dsn: env.SENTRY_DSN, + initialScope: { + tags: { service: 'config' } + } }, catchLogErrors: true } diff --git a/packages/documents/src/config/plugins.ts b/packages/documents/src/config/plugins.ts index 276595b4b23..4f7f12d5444 100644 --- a/packages/documents/src/config/plugins.ts +++ b/packages/documents/src/config/plugins.ts @@ -38,7 +38,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'documents' } + } }, catchLogErrors: true } diff --git a/packages/gateway/src/config/plugins.ts b/packages/gateway/src/config/plugins.ts index f34cb6b42c8..430f40317da 100644 --- a/packages/gateway/src/config/plugins.ts +++ b/packages/gateway/src/config/plugins.ts @@ -57,7 +57,10 @@ export const getPlugins = () => { options: { client: { dsn: SENTRY_DSN, - environment: process.env.DOMAIN + environment: process.env.DOMAIN, + initialScope: { + tags: { service: 'gateway' } + } }, catchLogErrors: true } diff --git a/packages/metrics/src/config/plugins.ts b/packages/metrics/src/config/plugins.ts index 89e5bd35fe5..760abad67e5 100644 --- a/packages/metrics/src/config/plugins.ts +++ b/packages/metrics/src/config/plugins.ts @@ -38,7 +38,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'metrics' } + } }, catchLogErrors: true } diff --git a/packages/notification/src/config/plugins.ts b/packages/notification/src/config/plugins.ts index 809bb945721..7274b639990 100644 --- a/packages/notification/src/config/plugins.ts +++ b/packages/notification/src/config/plugins.ts @@ -38,7 +38,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'notification' } + } }, catchLogErrors: true } diff --git a/packages/search/src/config/plugins.ts b/packages/search/src/config/plugins.ts index e3e1310a8d5..db95c615902 100644 --- a/packages/search/src/config/plugins.ts +++ b/packages/search/src/config/plugins.ts @@ -37,7 +37,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'search' } + } }, catchLogErrors: true } diff --git a/packages/user-mgnt/src/config/plugins.ts b/packages/user-mgnt/src/config/plugins.ts index 40487a91d66..8b853a16ed4 100644 --- a/packages/user-mgnt/src/config/plugins.ts +++ b/packages/user-mgnt/src/config/plugins.ts @@ -37,7 +37,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'user-mgnt' } + } }, catchLogErrors: true } diff --git a/packages/webhooks/src/config/plugins.ts b/packages/webhooks/src/config/plugins.ts index 1eed22f0da1..418928e9562 100644 --- a/packages/webhooks/src/config/plugins.ts +++ b/packages/webhooks/src/config/plugins.ts @@ -37,7 +37,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'webhooks' } + } }, catchLogErrors: true } diff --git a/packages/workflow/src/config/plugins.ts b/packages/workflow/src/config/plugins.ts index b84086c20d5..9d8c14f1b1a 100644 --- a/packages/workflow/src/config/plugins.ts +++ b/packages/workflow/src/config/plugins.ts @@ -37,7 +37,10 @@ export default function getPlugins() { options: { client: { environment: process.env.DOMAIN, - dsn: SENTRY_DSN + dsn: SENTRY_DSN, + initialScope: { + tags: { service: 'workflow' } + } }, catchLogErrors: true }