-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nuxt): Add vue-router instrumentation (#13054)
Adding the Vue BrowserTracing instrumentation to get parametrized routes.
- Loading branch information
Showing
8 changed files
with
155 additions
and
95 deletions.
There are no files selected for viewing
11 changes: 10 additions & 1 deletion
11
dev-packages/e2e-tests/test-applications/nuxt-3/components/ErrorButton.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
dev-packages/e2e-tests/test-applications/nuxt-3/pages/test-param/[param].vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<template> | ||
<p>{{ $route.params.param }} - {{ $route.params.param }}</p> | ||
<ErrorButton errorText="Error thrown from Param Route Button" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import * as SentryBrowser from '@sentry/browser'; | ||
import { type BrowserClient, SDK_VERSION, getClient } from '@sentry/vue'; | ||
import { SDK_VERSION } from '@sentry/vue'; | ||
import { beforeEach, describe, expect, it, vi } from 'vitest'; | ||
import { init } from '../../src/client'; | ||
|
||
|
@@ -35,23 +35,6 @@ describe('Nuxt Client SDK', () => { | |
expect(browserInit).toHaveBeenLastCalledWith(expect.objectContaining(expectedMetadata)); | ||
}); | ||
|
||
describe('Automatically adds BrowserTracing integration', () => { | ||
it.each([ | ||
['tracesSampleRate', { tracesSampleRate: 0 }], | ||
['tracesSampler', { tracesSampler: () => 1.0 }], | ||
['enableTracing', { enableTracing: true }], | ||
['no tracing option set', {}] /* enable "tracing without performance" by default */, | ||
])('adds a browserTracingIntegration if tracing is enabled via %s', (_, tracingOptions) => { | ||
init({ | ||
dsn: 'https://[email protected]/1337', | ||
...tracingOptions, | ||
}); | ||
|
||
const browserTracing = getClient<BrowserClient>()?.getIntegrationByName('BrowserTracing'); | ||
expect(browserTracing).toBeDefined(); | ||
}); | ||
}); | ||
|
||
it('returns client from init', () => { | ||
expect(init({})).not.toBeUndefined(); | ||
}); | ||
|