Skip to content

Commit 09bdfb3

Browse files
authored
docs(astro): Update getting started page (#11953)
1 parent 8f2fb15 commit 09bdfb3

File tree

5 files changed

+172
-258
lines changed

5 files changed

+172
-258
lines changed

docs/platforms/javascript/guides/astro/manual-setup.mdx

Lines changed: 0 additions & 254 deletions
This file was deleted.

platform-includes/getting-started-config/javascript.astro.mdx

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
Get started by adding your DSN to your Astro config file (`astro.config.mjs`):
1+
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:
2+
3+
### Astro Integration Setup
24

35

46
```javascript {filename:astro.config.mjs}
@@ -8,7 +10,6 @@ import sentry from "@sentry/astro";
810
export default defineConfig({
911
integrations: [
1012
sentry({
11-
dsn: "___PUBLIC_DSN___",
1213
sourceMapsUploadOptions: {
1314
project: "___PROJECT_SLUG___",
1415
authToken: process.env.SENTRY_AUTH_TOKEN,
@@ -18,4 +19,57 @@ export default defineConfig({
1819
});
1920
```
2021

21-
Once you've added your `dsn`, the SDK will automatically capture and send errors and performance events to Sentry.
22+
<Alert level="warning">
23+
Passing runtime-specific configuration options (`dsn`, `release`, `environment`, `sampleRate`, `tracesSampleRate`, `replaysSessionSampleRate`, `replaysOnErrorSampleRate`) to the Sentry integration will be deprecated in future versions.
24+
We recommend passing your configuration directly to the respective `Sentry.init()` calls in `sentry.client.config.js` and `sentry.server.config.js` instead.
25+
</Alert>
26+
27+
### Client-Side Setup
28+
29+
```javascript {filename:sentry.client.config.js} {"onboardingOptions": {"performance": "7,11-13", "session-replay": "8,14-21"}}
30+
import * as Sentry from "@sentry/astro";
31+
32+
Sentry.init({
33+
dsn: "___PUBLIC_DSN___",
34+
35+
integrations: [
36+
Sentry.browserTracingIntegration(),
37+
Sentry.replayIntegration(),
38+
],
39+
40+
// Define how likely traces are sampled. Adjust this value in production,
41+
// or use tracesSampler for greater control.
42+
tracesSampleRate: 1.0,
43+
44+
// This sets the sample rate to be 10%. You may want this to be 100% while
45+
// in development and sample at a lower rate in production
46+
replaysSessionSampleRate: 0.1,
47+
48+
// If the entire session is not sampled, use the below sample rate to sample
49+
// sessions when an error occurs.
50+
replaysOnErrorSampleRate: 1.0,
51+
});
52+
```
53+
54+
### Server-side Setup
55+
56+
```javascript {filename:sentry.server.config.js} {"onboardingOptions": {"performance": "10-13", "profiling": "2,6-9,14-17"}}
57+
import * as Sentry from "@sentry/astro";
58+
import { nodeProfilingIntegration } from '@sentry/profiling-node';
59+
60+
Sentry.init({
61+
dsn: "___PUBLIC_DSN___",
62+
integrations: [
63+
// Add our Profiling integration
64+
nodeProfilingIntegration(),
65+
],
66+
67+
// Define how likely traces are sampled. Adjust this value in production,
68+
// or use tracesSampler for greater control.
69+
tracesSampleRate: 1.0,
70+
71+
// Set sampling rate for profiling
72+
// This is relative to tracesSampleRate
73+
profilesSampleRate: 1.0
74+
});
75+
```

platform-includes/getting-started-install/javascript.astro.mdx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<OnboardingOptionButtons
2+
options={["error-monitoring", "performance", "profiling", "session-replay"]}
3+
/>
4+
15
Install the SDK by using the `astro` CLI:
26

37
```bash {tabTitle:npm}
@@ -14,4 +18,21 @@ pnpm astro add @sentry/astro
1418

1519
The `astro` CLI installs the SDK package and adds the Sentry integration to your `astro.config.mjs` file.
1620

17-
To finish the setup, configure the Sentry integration.
21+
22+
<OnboardingOption optionId="profiling">
23+
24+
```bash {tabTitle:npm}
25+
npm install @sentry/profiling-node
26+
```
27+
28+
```bash {tabTitle:yarn}
29+
yarn add @sentry/profiling-node
30+
```
31+
32+
```bash {tabTitle:pnpm}
33+
pnpm add @sentry/profiling-node
34+
```
35+
36+
</OnboardingOption>
37+
38+
To finish the setup, configure the Sentry integration.

0 commit comments

Comments
 (0)