Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(telemetry): Add telemetry for org and project CLI argument usage #677

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading