-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
docs(astro): Update getting started page #11953
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
Changes from 6 commits
a2fdf8b
7d59d37
4df6ea2
7f1a1d2
6d96162
71565dc
f02cdec
0038e56
6ad298d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,6 @@ | ||||||
| Get started by adding your DSN to your Astro config file (`astro.config.mjs`): | ||||||
| To set up the Sentry SDK, register the Sentry integration and initialize the SDK for client and server in the root directory of your project: | ||||||
|
|
||||||
| ### Astro Integration Setup | ||||||
|
|
||||||
|
|
||||||
| ```javascript {filename:astro.config.mjs} | ||||||
|
|
@@ -8,7 +10,6 @@ import sentry from "@sentry/astro"; | |||||
| export default defineConfig({ | ||||||
| integrations: [ | ||||||
| sentry({ | ||||||
| dsn: "___PUBLIC_DSN___", | ||||||
| sourceMapsUploadOptions: { | ||||||
| project: "___PROJECT_SLUG___", | ||||||
| authToken: process.env.SENTRY_AUTH_TOKEN, | ||||||
|
|
@@ -18,4 +19,57 @@ export default defineConfig({ | |||||
| }); | ||||||
| ``` | ||||||
|
|
||||||
| Once you've added your `dsn`, the SDK will automatically capture and send errors and performance events to Sentry. | ||||||
| <Alert level="warning"> | ||||||
| Passing runtime-specific configuration options (`dsn`, `release`, `environment`, `sampleRate`, `tracesSampleRate`, `replaysSessionSampleRate`, `replaysOnErrorSampleRate`) to the Sentry integration will be deprecated in future versions. | ||||||
| We recommend passing your configuration directly to the respective `Sentry.init()` calls in `sentry.client.config.js` and `sentry.server.config.js` instead. | ||||||
| </Alert> | ||||||
|
|
||||||
| ### Client-side Setup | ||||||
|
|
||||||
| ```javascript {filename:sentry.client.config.js} {"onboardingOptions": {"performance": "7,11-13", "session-replay": "8,14-21"}} | ||||||
| import * as Sentry from "@sentry/astro"; | ||||||
|
|
||||||
| Sentry.init({ | ||||||
| dsn: "___PUBLIC_DSN___", | ||||||
|
|
||||||
| integrations: [ | ||||||
| Sentry.browserTracingIntegration(), | ||||||
| Sentry.replayIntegration(), | ||||||
| ], | ||||||
|
|
||||||
| // Define how likely traces are sampled. Adjust this value in production, | ||||||
| // or use tracesSampler for greater control. | ||||||
| tracesSampleRate: 1.0, | ||||||
|
|
||||||
| // This sets the sample rate to be 10%. You may want this to be 100% while | ||||||
| // in development and sample at a lower rate in production | ||||||
| replaysSessionSampleRate: 0.1, | ||||||
|
|
||||||
| // If the entire session is not sampled, use the below sample rate to sample | ||||||
| // sessions when an error occurs. | ||||||
| replaysOnErrorSampleRate: 1.0, | ||||||
| }); | ||||||
| ``` | ||||||
|
|
||||||
| ### Server-side Setup | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ```javascript {filename:sentry.server.config.js} {"onboardingOptions": {"performance": "10-13", "profiling": "2,6-9,14-17"}} | ||||||
| import * as Sentry from "@sentry/astro"; | ||||||
| import { nodeProfilingIntegration } from '@sentry/profiling-node'; | ||||||
|
|
||||||
| Sentry.init({ | ||||||
| dsn: "___PUBLIC_DSN___", | ||||||
| integrations: [ | ||||||
| // Add our Profiling integration | ||||||
| nodeProfilingIntegration(), | ||||||
| ], | ||||||
|
|
||||||
| // Define how likely traces are sampled. Adjust this value in production, | ||||||
| // or use tracesSampler for greater control. | ||||||
| tracesSampleRate: 1.0, | ||||||
|
|
||||||
| // Set sampling rate for profiling | ||||||
| // This is relative to tracesSampleRate | ||||||
| profilesSampleRate: 1.0 | ||||||
| }); | ||||||
| ``` | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. m/h: What is our rationale behind moving away from Users are probably familiar with adding Astro integrations and we're also listed in their official integrations directory: https://astro.build/integrations/?search=sentry There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good point, I'll update that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the only thing that bugged me here is that we have another code snippet for adding profiling |
Uh oh!
There was an error while loading. Please reload this page.