Skip to content

Commit 8b8fc3a

Browse files
committed
Revert "feat(tracing): enable Vue Router instrumentation by default"
This reverts commit 7200c3c.
1 parent 7200c3c commit 8b8fc3a

File tree

6 files changed

+5
-39
lines changed

6 files changed

+5
-39
lines changed

docs/content/en/sentry/options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export default function () {
327327
},
328328
}
329329
```
330-
- On the browser side the `BrowserTracing` integration is enabled by default and adds automatic instrumentation for monitoring the performance of the application. The Vue Router instrumentation (`Sentry.vueRouterInstrumentation`) is also automatically enabled. See all available [`BrowserTracing` options](https://docs.sentry.io/platforms/javascript/guides/vue/performance/instrumentation/automatic-instrumentation/).
330+
- On the browser side the `BrowserTracing` integration is enabled by default and adds automatic instrumentation for monitoring the performance of the application. See available [`BrowserTracing` options](https://docs.sentry.io/platforms/javascript/guides/vue/performance/instrumentation/automatic-instrumentation/).
331331
- On the browser side extra options for [Tracking Vue components](https://docs.sentry.io/platforms/javascript/guides/vue/features/component-tracking/) can be passed through the `vueOptions` object.
332332
333333
<alert type="info">

lib/plugin.client.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ export default async function (ctx, inject) {
5454
<% if (options.tracing) { %>
5555
// eslint-disable-next-line prefer-regex-literals
5656
const { browserTracing, vueOptions, ...tracingOptions } = <%= serialize(options.tracing) %>
57-
config.integrations.push(new BrowserTracing({
58-
...(ctx.app.router ? { routingInstrumentation: Sentry.vueRouterInstrumentation(ctx.app.router) } : {}),
59-
...browserTracing,
60-
}))
57+
config.integrations.push(new BrowserTracing(browserTracing))
6158
merge(config, vueOptions, tracingOptions)
6259
<% } %>
6360
<% if (options.customClientIntegrations) { %>

lib/plugin.lazy.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ async function loadSentry (ctx, inject) {
110110
}
111111
%>
112112
const Sentry = await import(/* <%= magicComments.join(', ') %> */ '@sentry/vue')
113-
<% if (options.tracing) { %>const { BrowserTracing } = await import(/* <%= magicComments.join(', ') %> */ '@sentry/tracing')<% } %>
114113
<%
115114
if (options.initialize) {
116115
let integrations = options.PLUGGABLE_INTEGRATIONS.filter(key => key in options.integrations)
@@ -123,7 +122,8 @@ async function loadSentry (ctx, inject) {
123122
const serializedConfig = Object
124123
.entries({
125124
...options.config,
126-
...(options.tracing ? options.tracing.vueOptions : {}),
125+
...options.integrations.Vue,
126+
...(options.tracing ? options.tracing.vueOptions.tracingOptions : {}),
127127
})
128128
.map(([key, option]) => {
129129
const value = typeof option === 'function' ? serializeFunction(option) : serialize(option)
@@ -159,20 +159,7 @@ async function loadSentry (ctx, inject) {
159159
}).join(',\n ')
160160
%>,
161161
]
162-
<% if (options.tracing) {
163-
const serializedTracingConfig = Object
164-
.entries(options.tracing.browserTracing)
165-
.map(([key, option]) => {
166-
const value = typeof option === 'function' ? serializeFunction(option) : serialize(option)
167-
return`${key}: ${value}`
168-
})
169-
.join(',\n ')
170-
%>
171-
config.integrations.push(new BrowserTracing({
172-
...(ctx.app.router ? { routingInstrumentation: Sentry.vueRouterInstrumentation(ctx.app.router) } : {}),
173-
<%= serializedTracingConfig %>
174-
}))
175-
<% } %>
162+
/* eslint-enable quotes, key-spacing */
176163

177164
<%if (options.customClientIntegrations) {%>
178165
const customIntegrations = (await import(/* <%= magicComments.join(', ') %> */ '<%= options.customClientIntegrations %>').then(m => m.default || m))(ctx)

test/default.test.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,5 @@ describe('Smoke test (default)', () => {
4444
expect(errors).toEqual([])
4545
})
4646

47-
test('reports error on crash', async () => {
48-
const page = await browser.newPage()
49-
await page.goto(url('/'))
50-
expect(await $$('#server-side', page)).toBe('Works!')
51-
expect(await $$('#client-side', page)).toBe('Works!')
52-
const crashButton = await page.$('#crash-button')
53-
expect(crashButton).not.toBeNull()
54-
await crashButton?.click()
55-
const reports = testkit.reports()
56-
expect(reports).toHaveLength(1)
57-
})
58-
5947
// TODO: Add tests for custom integration. Blocked by various sentry-kit bugs reported in its repo.
6048
})

test/fixture/default/pages/index.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
<span id="server-side">{{ serverSentry ? 'Works!' : '$sentry object is missing!' }}</span>
55
<h3>Client-side</h3>
66
<span id="client-side">{{ clientSentry ? 'Works!' : '$sentry object is missing!' }}</span>
7-
<p>
8-
<button id="crash-button" @click="crash_me()">
9-
crash me
10-
</button>
11-
</p>
127
</div>
138
</template>
149

test/fixture/lazy/nuxt.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const config = {
2121
TryCatch: { eventTarget: false },
2222
},
2323
customClientIntegrations: '~/config/custom-client-integrations.js',
24-
tracing: true,
2524
},
2625
publicRuntimeConfig: {
2726
sentry: {

0 commit comments

Comments
 (0)