diff --git a/docs/platforms/javascript/guides/nuxt/config.yml b/docs/platforms/javascript/guides/nuxt/config.yml index e55b63f7ffaf4..c4457c5a689aa 100644 --- a/docs/platforms/javascript/guides/nuxt/config.yml +++ b/docs/platforms/javascript/guides/nuxt/config.yml @@ -2,5 +2,6 @@ title: Nuxt description: Nuxt is a framework for full-stack web apps and websites. Learn how to set it up with Sentry. sdk: sentry.javascript.nuxt categories: + - javascript - browser - - server + - server \ No newline at end of file diff --git a/docs/platforms/javascript/guides/nuxt/features/component-tracking.mdx b/docs/platforms/javascript/guides/nuxt/features/component-tracking.mdx new file mode 100644 index 0000000000000..8f885af22c0bd --- /dev/null +++ b/docs/platforms/javascript/guides/nuxt/features/component-tracking.mdx @@ -0,0 +1,104 @@ +--- +title: Track Vue Components +description: "Learn how to monitor the rendering performance of your application and its components with Sentry's Nuxt SDK." +sidebar_order: 10 +--- + +Sentry's Nuxt SDK has a component-tracking feature that lets you monitor the performance of your Vue components. Enabling this feature provides you with spans in your transactions that represent the component lifecycle events and durations. This allows you to get a drilled-down view into how your components are behaving so you can do things like identify slow initializations or frequent updates, which might be impacting your app's performance. + +## Usage + + + +To set up component tracking, you need to first configure performance monitoring. For details on how to do this, check out our [Performance documentation](/platforms/javascript/guides/nuxt/performance/). + + + +### Initial Application Load + +By default, the Nuxt SDK tracks the rendering performance of your app (that is, its root component) on the initial page load. This operation is represented in the page load transaction by the **`ui.vue.render`** span. + +### Child Components + +You can also track your app's child components to get more details about the rendering process. This feature will create spans for each tracked component instance. The spans are called **`ui.vue.[hook]`** where `[hook]` is replaced by each tracked lifecycle stage. For example, the span representing the mount stage (the time between `beforeMount` and `mounted`) is called `ui.vue.mount`. + +To set it up, add [`trackComponents`](#trackcomponents) in your `Sentry.init` call. You can also optionally add [`hooks`](#hooks), and [`timeout`](#timeout). + +#### `trackComponents` + +This is the main option that controls which child components should be tracked. Set it to `true` to track all of them or specify a list of individual components you want to track: + +```javascript +Sentry.init({ + // ... + trackComponents: true, + // OR + trackComponents: [ + "App", + "RwvHeader", + "RwvFooter", + "RwvArticleList", + "Pagination", + ], +}); +``` + +The default is `false`. + +#### `hooks` + +Control which lifecycle hooks should be tracked. This is helpful if, for example, you want to know if some components are removed during the initial page load, in which case you can add an `unmount` hook to the default: + +```javascript +Sentry.init({ + // ... + trackComponents: true + hooks: ["mount", "update", "unmount"], +}); +``` + +The following hooks are available to track in Vue 3: `['activate', 'create', 'unmount', 'mount', 'update']` + +Note, that when specifying `hooks`, we use the simple verb rather than `before` and `-ed` pairs. For example, `unmount` is correct, while `beforeUnmount` and `unmounted` are incorrect. + + + +If you're using Vue 2, use `destroy` instead of `unmount`. But in Vue 3 `destroy` doesn't work because the names of the lifecycle hooks themselves [changed](https://v3-migration.vuejs.org/breaking-changes/#other-minor-changes). + + + +The default set of hooks is `['activate', 'mount', 'update']`. + +#### `timeout` + +You can specify how long the root rendering span should wait until the last component is rendered. +Every new rendering cycle debounces the timeout and it starts counting from the beginning. Once the timeout is reached, tracking is completed and all the rendering information is sent to Sentry: + +```javascript +Sentry.init({ + // ... + trackComponents: true, + timeout: 500, +}); +``` + +The default is `2000`. + +#### Alternative Configuration With `tracingOptions` + +You can also group the component-tracking options by using the optional `tracingOptions` property in `Sentry.init`: + +```javascript +Sentry.init({ + // ... + tracingOptions: { + trackComponents: true; + timeout: 500; + hooks: ['mount', 'update']; + } +}) +``` + +Note, that when you use this property there is no change in behaviour, as opposed to when you use the three top-level properties described above. + +The default value for `tracingOptions` is `undefined`. \ No newline at end of file diff --git a/docs/platforms/javascript/guides/nuxt/features/index.mdx b/docs/platforms/javascript/guides/nuxt/features/index.mdx new file mode 100644 index 0000000000000..45d97a177d706 --- /dev/null +++ b/docs/platforms/javascript/guides/nuxt/features/index.mdx @@ -0,0 +1,9 @@ +--- +title: Vue Features +description: "Learn how to exposes features for first class integration with Vue with Sentry's Nuxt SDK." +sidebar_order: 4 +--- + +The Sentry Nuxt SDK offers Vue-specific features for first class integration with the framework. + + diff --git a/docs/platforms/javascript/guides/nuxt/features/vue-router.mdx b/docs/platforms/javascript/guides/nuxt/features/vue-router.mdx new file mode 100644 index 0000000000000..9112a207c771d --- /dev/null +++ b/docs/platforms/javascript/guides/nuxt/features/vue-router.mdx @@ -0,0 +1,9 @@ +--- +title: Vue Router +description: "Learn about Sentry's Vue Routing integration." +--- + +Nuxt uses the `vue-router` under the hood, and our Nuxt SDK instruments your routing automatically, to parameterize transactions according to your routes. + + + diff --git a/docs/platforms/javascript/guides/react/features/index.mdx b/docs/platforms/javascript/guides/react/features/index.mdx index 2a6d1ae879155..76e796f7a3037 100644 --- a/docs/platforms/javascript/guides/react/features/index.mdx +++ b/docs/platforms/javascript/guides/react/features/index.mdx @@ -1,6 +1,7 @@ --- title: React Features description: "Learn how Sentry's React SDK exposes custom components for first class integration with the React framework." +sidebar_order: 4 --- The Sentry React SDK offers React-specific features for first class integration with the framework. diff --git a/docs/platforms/javascript/guides/vue/features/index.mdx b/docs/platforms/javascript/guides/vue/features/index.mdx index aa6db25956925..8b5a6dbaa0182 100644 --- a/docs/platforms/javascript/guides/vue/features/index.mdx +++ b/docs/platforms/javascript/guides/vue/features/index.mdx @@ -1,7 +1,7 @@ --- title: Vue Features description: "Learn how Sentry's Vue SDK exposes features for first class integration with Vue." -excerpt: "" +sidebar_order: 4 --- The Sentry Vue SDK offers Vue-specific features for first class integration with the framework.