From d4f8e08dfc5f05078ec177784833d8d62e9cdda6 Mon Sep 17 00:00:00 2001 From: Arthur Knaus Date: Mon, 27 May 2024 12:49:48 +0200 Subject: [PATCH 1/3] feat(metrics-onboarding): Metrics integration only for v7 --- .../utils/metricsOnboarding.tsx | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/static/app/components/onboarding/gettingStartedDoc/utils/metricsOnboarding.tsx b/static/app/components/onboarding/gettingStartedDoc/utils/metricsOnboarding.tsx index 3ebef1dfb6d3bf..8b680f735c0d5b 100644 --- a/static/app/components/onboarding/gettingStartedDoc/utils/metricsOnboarding.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/utils/metricsOnboarding.tsx @@ -13,9 +13,10 @@ import {getInstallConfig as getNodeInstallConfig} from 'sentry/utils/gettingStar const getJSConfigureSnippet = (params: DocsParams) => ` Sentry.init({ dsn: "${params.dsn}", - integrations: [ - Sentry.metrics.metricsAggregatorIntegration(), - ], + // Only needed for SDK versions < 8.0.0 + // integrations: [ + // Sentry.metrics.metricsAggregatorIntegration(), + // ], });`; const JSExampleConfig = { @@ -101,21 +102,16 @@ const getJSMetricsOnboardingConfigure = (params: DocsParams) => [ { type: StepType.CONFIGURE, description: tct( - 'To enable capturing metrics, you first need to add the metrics aggregator integration under the [codeNamespace:Sentry.metrics] namespace.', + 'With the default snippet in place, there is no need for any further configuration.', { + codeVersion: , codeNamespace: , } ), configurations: [ { - code: [ - { - label: 'Counter', - value: 'counter', - language: 'javascript', - code: getJSConfigureSnippet(params), - }, - ], + code: getJSConfigureSnippet(params), + language: 'javascript', }, ], }, From dc610cf3a762ae10346650a9fb054fdade32d1e4 Mon Sep 17 00:00:00 2001 From: Arthur Knaus Date: Mon, 27 May 2024 12:52:39 +0200 Subject: [PATCH 2/3] fix(metrics-onboarding): tct -> t --- .../gettingStartedDoc/utils/metricsOnboarding.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/static/app/components/onboarding/gettingStartedDoc/utils/metricsOnboarding.tsx b/static/app/components/onboarding/gettingStartedDoc/utils/metricsOnboarding.tsx index 8b680f735c0d5b..732241d217a370 100644 --- a/static/app/components/onboarding/gettingStartedDoc/utils/metricsOnboarding.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/utils/metricsOnboarding.tsx @@ -101,12 +101,8 @@ export const getReactNativeMetricsOnboarding = ({ const getJSMetricsOnboardingConfigure = (params: DocsParams) => [ { type: StepType.CONFIGURE, - description: tct( - 'With the default snippet in place, there is no need for any further configuration.', - { - codeVersion: , - codeNamespace: , - } + description: t( + 'With the default snippet in place, there is no need for any further configuration.' ), configurations: [ { From e907293987d8222bc3db5957838bc6668de2b093 Mon Sep 17 00:00:00 2001 From: Arthur Knaus Date: Mon, 27 May 2024 13:10:32 +0200 Subject: [PATCH 3/3] feat(metrics-onboarding): Handle node metrics experiment --- .../utils/metricsOnboarding.tsx | 25 ++++++------------- static/app/gettingStartedDocs/bun/bun.tsx | 25 ++++++------------- static/app/gettingStartedDocs/deno/deno.tsx | 25 ++++++------------- .../gettingStartedDocs/electron/electron.tsx | 25 ++++++------------- .../app/gettingStartedDocs/node/awslambda.tsx | 25 ++++++------------- .../gettingStartedDocs/node/gcpfunctions.tsx | 25 ++++++------------- 6 files changed, 48 insertions(+), 102 deletions(-) diff --git a/static/app/components/onboarding/gettingStartedDoc/utils/metricsOnboarding.tsx b/static/app/components/onboarding/gettingStartedDoc/utils/metricsOnboarding.tsx index 732241d217a370..7b5b0eb3570c85 100644 --- a/static/app/components/onboarding/gettingStartedDoc/utils/metricsOnboarding.tsx +++ b/static/app/components/onboarding/gettingStartedDoc/utils/metricsOnboarding.tsx @@ -151,9 +151,10 @@ const getJSMetricsOnboardingVerify = ({docsLink}: {docsLink: string}) => [ const getJSServerConfigureSnippet = (params: DocsParams) => ` Sentry.init({ dsn: "${params.dsn}", - _experiments: { - metricsAggregator: true, - }, + // Only needed for SDK versions < 8.0.0 + // _experiments: { + // metricsAggregator: true, + // }, });`; export const getJSServerMetricsOnboarding = (): OnboardingConfig => ({ @@ -175,23 +176,13 @@ export const getJSServerMetricsOnboarding = (): OnboardingConfig => ({ configure: params => [ { type: StepType.CONFIGURE, - description: tct( - 'To enable capturing metrics, you first need to add the [codeIntegration:metricsAggregator] experiment to your [codeNamespace:Sentry.init] call in your main process.', - { - codeIntegration: , - codeNamespace: , - } + description: t( + 'With the default snippet in place, there is no need for any further configuration.' ), configurations: [ { - code: [ - { - label: 'JavaScript', - value: 'javascript', - language: 'javascript', - code: getJSServerConfigureSnippet(params), - }, - ], + code: getJSServerConfigureSnippet(params), + language: 'javascript', }, ], }, diff --git a/static/app/gettingStartedDocs/bun/bun.tsx b/static/app/gettingStartedDocs/bun/bun.tsx index 65a056c43f46ac..38c7a2ed2a8784 100644 --- a/static/app/gettingStartedDocs/bun/bun.tsx +++ b/static/app/gettingStartedDocs/bun/bun.tsx @@ -48,9 +48,10 @@ const getVerifySnippet = () => `try { const getMetricsConfigureSnippet = (params: DocsParams) => ` Sentry.init({ dsn: "${params.dsn}", - _experiments: { - metricsAggregator: true, - }, + // Only needed for SDK versions < 8.0.0 + // _experiments: { + // metricsAggregator: true, + // }, });`; const onboarding: OnboardingConfig = { @@ -123,23 +124,13 @@ const customMetricsOnboarding: OnboardingConfig = { configure: params => [ { type: StepType.CONFIGURE, - description: tct( - 'To enable capturing metrics, you first need to add the [codeIntegration:metricsAggregator] experiment to your [codeNamespace:Sentry.init] call in your main process.', - { - codeIntegration: , - codeNamespace: , - } + description: t( + 'With the default snippet in place, there is no need for any further configuration.' ), configurations: [ { - code: [ - { - label: 'JavaScript', - value: 'javascript', - language: 'javascript', - code: getMetricsConfigureSnippet(params), - }, - ], + code: getMetricsConfigureSnippet(params), + language: 'javascript', }, ], }, diff --git a/static/app/gettingStartedDocs/deno/deno.tsx b/static/app/gettingStartedDocs/deno/deno.tsx index 9587766ba17a4c..8b99e84df8e8a8 100644 --- a/static/app/gettingStartedDocs/deno/deno.tsx +++ b/static/app/gettingStartedDocs/deno/deno.tsx @@ -51,9 +51,10 @@ setTimeout(() => { const getMetricsConfigureSnippet = (params: DocsParams) => `; Sentry.init({ dsn: '${params.dsn}', - _experiments: { - metricsAggregator: true, - }, + // Only needed for SDK versions < 8.0.0 + // _experiments: { + // metricsAggregator: true, + // }, }); `; @@ -132,23 +133,13 @@ const customMetricsOnboarding: OnboardingConfig = { configure: params => [ { type: StepType.CONFIGURE, - description: tct( - 'To enable capturing metrics, you first need to add the [codeIntegration:metricsAggregator] experiment to your [codeNamespace:Sentry.init] call in your main process.', - { - codeIntegration: , - codeNamespace: , - } + description: t( + 'With the default snippet in place, there is no need for any further configuration.' ), configurations: [ { - code: [ - { - label: 'JavaScript', - value: 'javascript', - language: 'javascript', - code: getMetricsConfigureSnippet(params), - }, - ], + code: getMetricsConfigureSnippet(params), + language: 'javascript', }, ], }, diff --git a/static/app/gettingStartedDocs/electron/electron.tsx b/static/app/gettingStartedDocs/electron/electron.tsx index 4ade923731d798..3831a8af6868f1 100644 --- a/static/app/gettingStartedDocs/electron/electron.tsx +++ b/static/app/gettingStartedDocs/electron/electron.tsx @@ -39,9 +39,10 @@ import * as Sentry from '@sentry/electron/main'; // main process init Sentry.init({ dsn: "${params.dsn}", - _experiments: { - metricsAggregator: true, - }, + // Only needed for SDK versions < 8.0.0 + // _experiments: { + // metricsAggregator: true, + // }, });`; const getInstallConfig = () => [ @@ -188,23 +189,13 @@ const customMetricsOnboarding: OnboardingConfig = { configure: params => [ { type: StepType.CONFIGURE, - description: tct( - 'To enable capturing metrics, you first need to add the [codeIntegration:metricsAggregator] experiment to your [codeNamespace:Sentry.init] call in your main process.', - { - codeIntegration: , - codeNamespace: , - } + description: t( + 'With the default snippet in place, there is no need for any further configuration.' ), configurations: [ { - code: [ - { - label: 'JavaScript', - value: 'javascript', - language: 'javascript', - code: getMetricsConfigureSnippet(params), - }, - ], + code: getMetricsConfigureSnippet(params), + language: 'javascript', }, ], }, diff --git a/static/app/gettingStartedDocs/node/awslambda.tsx b/static/app/gettingStartedDocs/node/awslambda.tsx index 6c8d39f5181b8a..bd708d023d4370 100644 --- a/static/app/gettingStartedDocs/node/awslambda.tsx +++ b/static/app/gettingStartedDocs/node/awslambda.tsx @@ -33,9 +33,10 @@ exports.handler = Sentry.wrapHandler(async (event, context) => { const getMetricsConfigureSnippet = (params: DocsParams) => ` Sentry.init({ dsn: "${params.dsn}", - _experiments: { - metricsAggregator: true, - }, + // Only needed for SDK versions < 8.0.0 + // _experiments: { + // metricsAggregator: true, + // }, });`; const onboarding: OnboardingConfig = { @@ -107,23 +108,13 @@ const customMetricsOnboarding: OnboardingConfig = { configure: params => [ { type: StepType.CONFIGURE, - description: tct( - 'To enable capturing metrics, you first need to add the [codeIntegration:metricsAggregator] experiment to your [codeNamespace:Sentry.init] call in your main process.', - { - codeIntegration: , - codeNamespace: , - } + description: t( + 'With the default snippet in place, there is no need for any further configuration.' ), configurations: [ { - code: [ - { - label: 'JavaScript', - value: 'javascript', - language: 'javascript', - code: getMetricsConfigureSnippet(params), - }, - ], + code: getMetricsConfigureSnippet(params), + language: 'javascript', }, ], }, diff --git a/static/app/gettingStartedDocs/node/gcpfunctions.tsx b/static/app/gettingStartedDocs/node/gcpfunctions.tsx index 061202500b7adb..c92aa53514f82b 100644 --- a/static/app/gettingStartedDocs/node/gcpfunctions.tsx +++ b/static/app/gettingStartedDocs/node/gcpfunctions.tsx @@ -48,9 +48,10 @@ exports.helloHttp = Sentry.wrapHttpFunction((req, res) => { const getMetricsConfigureSnippet = (params: DocsParams) => ` Sentry.init({ dsn: "${params.dsn}", - _experiments: { - metricsAggregator: true, - }, + // Only needed for SDK versions < 8.0.0 + // _experiments: { + // metricsAggregator: true, + // }, });`; const onboarding: OnboardingConfig = { @@ -129,23 +130,13 @@ const customMetricsOnboarding: OnboardingConfig = { configure: params => [ { type: StepType.CONFIGURE, - description: tct( - 'To enable capturing metrics, you first need to add the [codeIntegration:metricsAggregator] experiment to your [codeNamespace:Sentry.init] call in your main process.', - { - codeIntegration: , - codeNamespace: , - } + description: t( + 'With the default snippet in place, there is no need for any further configuration.' ), configurations: [ { - code: [ - { - label: 'JavaScript', - value: 'javascript', - language: 'javascript', - code: getMetricsConfigureSnippet(params), - }, - ], + code: getMetricsConfigureSnippet(params), + language: 'javascript', }, ], },