Skip to content

Commit

Permalink
feat(metrics): Add comments for v7 configuration (#10154)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurKnaus authored May 27, 2024
1 parent 74c358b commit 3d840bd
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 21 deletions.
10 changes: 9 additions & 1 deletion platform-includes/metrics/configure/javascript.astro.mdx
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
To use metrics with astro, first [manually setup up the SDK as per the Astro SDK docs](/platforms/javascript/guides/astro/manual-setup/#manual-sdk-initialization).

Metrics work out of the box by calling `Sentry.init` no further setup is required.
Metrics work out of the box by calling `Sentry.init`, no further setup is required.

```JavaScript
// sentry.client.config.js
Sentry.init({
dsn: '___PUBLIC_DSN___',
// Only needed for SDK versions < 8.0.0
// integrations: [
// Sentry.metrics.metricsAggregatorIntegration(),
// ],
});
```

```JavaScript
// sentry.server.config.js
Sentry.init({
dsn: '___PUBLIC_DSN___',
// Only needed for SDK versions < 8.0.0
// _experiments: {
// metricsAggregator: true,
// },
});
```
9 changes: 5 additions & 4 deletions platform-includes/metrics/configure/javascript.bun.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
To configure metrics, add the `metricsAggregator` experimental option to your `Sentry.init` call.
Metrics work out of the box by calling `Sentry.init`, no further setup is required.

```JavaScript
Sentry.init({
dsn: '___PUBLIC_DSN___',
_experiments: {
metricsAggregator: true,
},
// Only needed for SDK versions < 8.0.0
// _experiments: {
// metricsAggregator: true,
// },
});
```
9 changes: 5 additions & 4 deletions platform-includes/metrics/configure/javascript.deno.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
To configure metrics, add the `metricsAggregator` experimental option to your `Sentry.init` call.
Metrics work out of the box by calling `Sentry.init`, no further setup is required.

```JavaScript
Sentry.init({
dsn: '___PUBLIC_DSN___',
_experiments: {
metricsAggregator: true,
},
// Only needed for SDK versions < 8.0.0
// _experiments: {
// metricsAggregator: true,
// },
});
```
9 changes: 5 additions & 4 deletions platform-includes/metrics/configure/javascript.electron.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
To configure metrics, add the `metricsAggregator` experimental option to your `Sentry.init` call in your main process.
Metrics work out of the box by calling `Sentry.init`, no further setup is required.

```JavaScript
import * as Sentry from '@sentry/electron/main';

Sentry.init({
dsn: '___PUBLIC_DSN___',
_experiments: {
metricsAggregator: true,
},
// Only needed for SDK versions < 8.0.0
// _experiments: {
// metricsAggregator: true,
// },
});
```
6 changes: 5 additions & 1 deletion platform-includes/metrics/configure/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Metrics work out of the box by calling `Sentry.init` no further setup is required.
Metrics work out of the box by calling `Sentry.init`, no further setup is required.

```JavaScript
Sentry.init({
dsn: '___PUBLIC_DSN___',
// Only needed for SDK versions < 8.0.0
// integrations: [
// Sentry.metrics.metricsAggregatorIntegration(),
// ],
});
```
11 changes: 10 additions & 1 deletion platform-includes/metrics/configure/javascript.nextjs.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
Metrics work out of the box by calling `Sentry.init` no further setup is required.
Metrics work out of the box by calling `Sentry.init`, no further setup is required.

```JavaScript
// sentry.client.config.js
Sentry.init({
dsn: '___PUBLIC_DSN___',
// Only needed for SDK versions < 8.0.0
// integrations: [
// Sentry.metrics.metricsAggregatorIntegration(),
// ],
});
```

```JavaScript
// instrumentation.js
Sentry.init({
dsn: '___PUBLIC_DSN___',
// Only needed for SDK versions < 8.0.0
// _experiments: {
// metricsAggregator: true,
// },
});
```
9 changes: 5 additions & 4 deletions platform-includes/metrics/configure/javascript.node.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
To configure metrics, add the `metricsAggregator` experimental option to your `Sentry.init` call.
Metrics work out of the box by calling `Sentry.init`, no further setup is required.

```JavaScript
Sentry.init({
dsn: '___PUBLIC_DSN___',
_experiments: {
metricsAggregator: true,
},
// Only needed for SDK versions < 8.0.0
// _experiments: {
// metricsAggregator: true,
// },
});
```
10 changes: 9 additions & 1 deletion platform-includes/metrics/configure/javascript.remix.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
Metrics work out of the box by calling `Sentry.init` no further setup is required.
Metrics work out of the box by calling `Sentry.init`, no further setup is required.

```JavaScript
// entry.client.tsx
Sentry.init({
dsn: '___PUBLIC_DSN___',
// Only needed for SDK versions < 8.0.0
// integrations: [
// Sentry.metrics.metricsAggregatorIntegration(),
// ],
});
```

```JavaScript
// entry.server.tsx
Sentry.init({
dsn: '___PUBLIC_DSN___',
// Only needed for SDK versions < 8.0.0
// _experiments: {
// metricsAggregator: true,
// },
});
```
10 changes: 9 additions & 1 deletion platform-includes/metrics/configure/javascript.sveltekit.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
Metrics work out of the box by calling `Sentry.init` no further setup is required.
Metrics work out of the box by calling `Sentry.init`, no further setup is required.

```JavaScript
// hooks.client.js
Sentry.init({
dsn: '___PUBLIC_DSN___',
// Only needed for SDK versions < 8.0.0
// integrations: [
// Sentry.metrics.metricsAggregatorIntegration(),
// ],
});
```

```JavaScript
// hooks.server.js
Sentry.init({
dsn: '___PUBLIC_DSN___',
// Only needed for SDK versions < 8.0.0
// _experiments: {
// metricsAggregator: true,
// },
});
```

0 comments on commit 3d840bd

Please sign in to comment.