Skip to content

Commit

Permalink
feat(telemetry): Add telemetry for org and project CLI argument usage (
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 authored Sep 24, 2024
1 parent a893cd7 commit 7dd1be7
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- fix(sveltekit): Create bundler plugin env file instead of sentryclirc (#675)
- fix(check-sdk-version): update sentry sdk packages (#676)
- feat(telemetry): Add telemetry for org and project CLI argument usage (#677)

## 3.30.0

Expand Down
1 change: 1 addition & 0 deletions src/android/android-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export async function runAndroidWizard(options: WizardOptions): Promise<void> {
{
enabled: options.telemetryEnabled,
integration: 'android',
wizardOptions: options,
},
() => runAndroidWizardWithTelemetry(options),
);
Expand Down
1 change: 1 addition & 0 deletions src/apple/apple-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export async function runAppleWizard(options: WizardOptions): Promise<void> {
{
enabled: options.telemetryEnabled,
integration: 'ios',
wizardOptions: options,
},
() => runAppleWizardWithTelementry(options),
);
Expand Down
1 change: 1 addition & 0 deletions src/nextjs/nextjs-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function runNextjsWizard(options: WizardOptions) {
{
enabled: options.telemetryEnabled,
integration: 'nextjs',
wizardOptions: options,
},
() => runNextjsWizardWithTelemetry(options),
);
Expand Down
1 change: 1 addition & 0 deletions src/react-native/react-native-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export async function runReactNativeWizard(
{
enabled: params.telemetryEnabled,
integration: 'react-native',
wizardOptions: params,
},
() => runReactNativeWizardWithTelemetry(params),
);
Expand Down
1 change: 1 addition & 0 deletions src/remix/remix-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export async function runRemixWizard(options: WizardOptions): Promise<void> {
{
enabled: options.telemetryEnabled,
integration: 'remix',
wizardOptions: options,
},
() => runRemixWizardWithTelemetry(options),
);
Expand Down
1 change: 1 addition & 0 deletions src/sourcemaps/sourcemaps-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export async function runSourcemapsWizard(
{
enabled: options.telemetryEnabled,
integration: 'sourcemaps',
wizardOptions: options,
},
() => runSourcemapsWizardWithTelemetry(options),
);
Expand Down
1 change: 1 addition & 0 deletions src/sveltekit/sveltekit-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export async function runSvelteKitWizard(
{
enabled: options.telemetryEnabled,
integration: 'sveltekit',
wizardOptions: options,
},
() => runSvelteKitWizardWithTelemetry(options),
);
Expand Down
6 changes: 6 additions & 0 deletions src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import {
flush,
} from '@sentry/node';
import packageJson from '../package.json';
import { WizardOptions } from './utils/types';

export async function withTelemetry<F>(
options: {
enabled: boolean;
integration: string;
wizardOptions: WizardOptions;
},
callback: () => F | Promise<F>,
): Promise<F> {
Expand All @@ -29,6 +31,10 @@ export async function withTelemetry<F>(
const sentrySession = sentryHub.startSession();
sentryHub.captureSession();

// Set tag for passed CLI args
sentryHub.setTag('args.project', !!options.wizardOptions.projectSlug);
sentryHub.setTag('args.org', !!options.wizardOptions.orgSlug);

try {
return await startSpan(
{
Expand Down

0 comments on commit 7dd1be7

Please sign in to comment.