Skip to content

Commit

Permalink
fix templates (add await startSpan)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 committed Dec 22, 2023
1 parent e82e240 commit 6544ae9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/nextjs/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ export default function Page() {
margin: "18px",
}}
onClick={async () => {
Sentry.startSpan({
await Sentry.startSpan({
name: 'Example Frontend Span',
op: 'test'
}, async () => {
const res = await fetch("/api/sentry-example-api");
if (!res.ok) {
Expand Down
2 changes: 1 addition & 1 deletion src/sveltekit/sveltekit-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export async function runSvelteKitWizardWithTelemetry(
}

const shouldCreateExamplePage = await askShouldCreateExamplePage(
'sentry-example',
'/sentry-example',
);

if (shouldCreateExamplePage) {
Expand Down
3 changes: 2 additions & 1 deletion src/sveltekit/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ Feel free to delete this file and the entire sentry route.
import * as Sentry from '@sentry/sveltekit';
async function getSentryData() {
Sentry.startSpan({
await Sentry.startSpan({
name: 'Example Frontend Span',
op: 'test',
}, async () => {
const res = await fetch('/sentry-example');
if (!res.ok) {
Expand Down

0 comments on commit 6544ae9

Please sign in to comment.