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(nuxt): Add piniaIntegration #14138

Merged
merged 5 commits into from
Nov 4, 2024
Merged

feat(nuxt): Add piniaIntegration #14138

merged 5 commits into from
Nov 4, 2024

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Oct 30, 2024

After reverting #14134, this is a more bundle-size friendly way of adding monitoring for Pinia in Nuxt.

The Nuxt SDK now allows you to track Pinia state for captured errors. To enable the Pinia plugin, add the piniaIntegration to your client config:

// sentry.client.config.ts
import { usePinia } from '#imports';

Sentry.init({
  integrations: [
    Sentry.piniaIntegration(usePinia(), {
      /* optional Pinia plugin options */
    }),
  ],
});

@s1gr1d s1gr1d changed the title feat(nuxt): Add piniaIntegration feat(nuxt): Add piniaIntegration Oct 30, 2024
CHANGELOG.md Outdated
@@ -10,6 +10,73 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

- **feat(nuxt): Add Sentry Pinia plugin ([#14138](https://github.com/getsentry/sentry-javascript/pull/14138))**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: the PR description here doesn't match the actual PR

consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
'[Sentry] You added the Pinia integration, but the passed parameter `pinia` has the wrong value. Make sure to enable Pinia by adding `"@pinia/nuxt"` to your Nuxt modules array and pass pinia to Sentry with `piniaIntegration(usePinia())`. Current value of `pinia`: ',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ultra-l: I'd change the prose and remove the you/your

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passive language: "The pinia integration was configured/added, ..."

consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
'[Sentry] You added the Pinia integration, but the passed parameter `pinia` has the wrong value. Make sure to enable Pinia by adding `"@pinia/nuxt"` to your Nuxt modules array and pass pinia to Sentry with `piniaIntegration(usePinia())`. Current value of `pinia`: ',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: You don't need the extra space after :, a space is rendered by default between arguments passed to console logs.

Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I'm just confused about the changelog

CHANGELOG.md Outdated
Sentry.init({
integrations: [
Sentry.piniaIntegration(usePinia(), {
/* optinal Pinia plugin options */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* optinal Pinia plugin options */
/* optional Pinia plugin options */

Copy link

codecov bot commented Oct 31, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
233 1 232 9
View the top 1 failed tests by shortest run time
client-app-routing-instrumentation.test.ts Creates a navigation transaction for app router routes
Stack Traces | 30s run time
client-app-routing-instrumentation.test.ts:19:5 Creates a navigation transaction for app router routes

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

expect(actionBreadcrumb?.message).toBe('Transformed: addItem');
expect(actionBreadcrumb?.level).toBe('info');

const stateContext = error.contexts?.state?.state;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q (probably no action required): Are the double state keys on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s1gr1d s1gr1d merged commit 738870d into develop Nov 4, 2024
118 checks passed
@s1gr1d s1gr1d deleted the sig/pinia-nuxt branch November 4, 2024 08:47
alexandresoro pushed a commit to alexandresoro/ouca that referenced this pull request Nov 9, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@sentry/node](https://github.com/getsentry/sentry-javascript/tree/master/packages/node) ([source](https://github.com/getsentry/sentry-javascript)) | dependencies | minor | [`8.36.0` -> `8.37.1`](https://renovatebot.com/diffs/npm/@sentry%2fnode/8.36.0/8.37.1) |
| [@sentry/react](https://github.com/getsentry/sentry-javascript/tree/master/packages/react) ([source](https://github.com/getsentry/sentry-javascript)) | dependencies | minor | [`8.36.0` -> `8.37.1`](https://renovatebot.com/diffs/npm/@sentry%2freact/8.36.0/8.37.1) |

---

### Release Notes

<details>
<summary>getsentry/sentry-javascript (@&#8203;sentry/node)</summary>

### [`v8.37.1`](https://github.com/getsentry/sentry-javascript/blob/HEAD/CHANGELOG.md#8371)

[Compare Source](getsentry/sentry-javascript@8.37.0...8.37.1)

-   feat(deps): Bump [@&#8203;opentelemetry/instrumentation](https://github.com/opentelemetry/instrumentation) from 0.53.0 to 0.54.0 for [@&#8203;sentry/opentelemetry](https://github.com/sentry/opentelemetry) ([#&#8203;14187](getsentry/sentry-javascript#14187))

### [`v8.37.0`](https://github.com/getsentry/sentry-javascript/blob/HEAD/CHANGELOG.md#8370)

[Compare Source](getsentry/sentry-javascript@8.36.0...8.37.0)

##### Important Changes

-   **feat(nuxt): Add `piniaIntegration` ([#&#8203;14138](getsentry/sentry-javascript#14138

The Nuxt SDK now allows you to track Pinia state for captured errors. To enable the Pinia plugin, add the `piniaIntegration` to your client config:

```ts
// sentry.client.config.ts
import { usePinia } from '#imports';

Sentry.init({
  integrations: [
    Sentry.piniaIntegration(usePinia(), {
      /* optional Pinia plugin options */
    }),
  ],
});
```

-   **feat: Deprecate metrics API ([#&#8203;14157](getsentry/sentry-javascript#14157

The Sentry Metrics beta has ended in favour of revisiting metrics in another form at a later date.

This new approach will include different APIs, making the current metrics API unnecessary. This release
deprecates the metrics API with the plan to remove in the next SDK major version. If you currently use the
metrics API in your code, you can safely continue to do so but sent data will no longer be processed by Sentry.

[Learn more](https://sentry.zendesk.com/hc/en-us/articles/26369339769883-Metrics-Beta-Ended-on-October-7th) about the end of the Metrics beta.

##### Other Changes

-   feat(browser): Add `http.response_delivery_type` attribute to resource spans ([#&#8203;14056](getsentry/sentry-javascript#14056))
-   feat(browser): Add `skipBrowserExtensionCheck` escape hatch option ([#&#8203;14147](getsentry/sentry-javascript#14147))
-   feat(deps): Bump [@&#8203;opentelemetry/instrumentation](https://github.com/opentelemetry/instrumentation) from 0.53.0 to 0.54.0 ([#&#8203;14174](getsentry/sentry-javascript#14174))
-   feat(deps): Bump [@&#8203;opentelemetry/instrumentation-fastify](https://github.com/opentelemetry/instrumentation-fastify) from 0.40.0 to 0.41.0 ([#&#8203;14175](getsentry/sentry-javascript#14175))
-   feat(deps): Bump [@&#8203;opentelemetry/instrumentation-graphql](https://github.com/opentelemetry/instrumentation-graphql) from 0.43.0 to 0.44.0 ([#&#8203;14173](getsentry/sentry-javascript#14173))
-   feat(deps): Bump [@&#8203;opentelemetry/instrumentation-mongodb](https://github.com/opentelemetry/instrumentation-mongodb) from 0.47.0 to 0.48.0 ([#&#8203;14171](getsentry/sentry-javascript#14171))
-   feat(deps): Bump [@&#8203;opentelemetry/propagator-aws-xray](https://github.com/opentelemetry/propagator-aws-xray) from 1.25.1 to 1.26.0 ([#&#8203;14172](getsentry/sentry-javascript#14172))
-   feat(nuxt): Add `asyncFunctionReExports` to define re-exported server functions ([#&#8203;14104](getsentry/sentry-javascript#14104))
-   feat(nuxt): Add `piniaIntegration` ([#&#8203;14138](getsentry/sentry-javascript#14138))
-   fix(browser): Avoid recording long task spans starting before their parent span ([#&#8203;14183](getsentry/sentry-javascript#14183))
-   fix(core): Ensure errors thrown in async cron jobs bubble up ([#&#8203;14182](getsentry/sentry-javascript#14182))
-   fix(core): Silently fail `maybeInstrument` ([#&#8203;14140](getsentry/sentry-javascript#14140))
-   fix(nextjs): Resolve path for dynamic webpack import ([#&#8203;13751](getsentry/sentry-javascript#13751))
-   fix(node): Make sure `modulesIntegration` does not crash esm apps ([#&#8203;14169](getsentry/sentry-javascript#14169))

Work in this release was contributed by [@&#8203;rexxars](https://github.com/rexxars). Thank you for your contribution!

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNyIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Reviewed-on: https://git.tristess.app/alexandresoro/ouca/pulls/299
Reviewed-by: Alexandre Soro <[email protected]>
Co-authored-by: renovate <[email protected]>
Co-committed-by: renovate <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants