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: Add Bun docs #7858

Merged
merged 10 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/data/platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@
type: language
name: Dart
case_style: camelCase
- slug: bun
type: framework
name: Bun
19 changes: 19 additions & 0 deletions src/platform-includes/getting-started-config/javascript.bun.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Once installed, you can capture exceptions manually for now.

<Alert level="warning" title="Note">

It's not possible to capture unhandled exceptions, unhandled promise rejections now - Bun is working on adding support for it.
[Github Issue](https://github.com/oven-sh/bun/issues/5091) follow this issue.

</Alert>

<SignInNote />

```javascript {tabTitle:ESM}
import * as Sentry from "@sentry/bun";

Sentry.init({
dsn: "___PUBLIC_DSN___",
tracesSampleRate: 1.0,
});
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```bash {tabTitle:Bun}
bun add @sentry/bun
```
Empty file.
16 changes: 16 additions & 0 deletions src/platform-includes/getting-started-verify/javascript.bun.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
const transaction = Sentry.startTransaction({
op: "test",
name: "My First Test Transaction",
});

setTimeout(() => {
try {
foo();
} catch (e) {
Sentry.captureException(e);
} finally {
transaction.finish();
}
}, 99);
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Sentry SDK provides a `Tracing` integration to add automatic instrumentation for monitoring the performance of your application.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<SignInNote />

```javascript
import * as Sentry from "@sentry/bun";

Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [new Sentry.Tracing()],

// We recommend adjusting this value in production, or using tracesSampler
// for finer control
tracesSampleRate: 1.0,

// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
});
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
To enable tracing, include the `Tracing` integration in your SDK configuration options.

<SignInNote />

```javascript
import * as Sentry from "@sentry/bun";

Sentry.init({
dsn: "___PUBLIC_DSN___",

integrations: [new Sentry.Tracing()],

// We recommend adjusting this value in production, or using tracesSampler
// for finer control
tracesSampleRate: 1.0,
});
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Tracing is available by default in the Sentry Bun.
1 change: 1 addition & 0 deletions src/platforms/javascript/common/install/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ sidebar_order: 1
description: "Review our alternate installation methods."
notSupported:
- javascript.angular
- javascript.bun
- javascript.capacitor
- javascript.cordova
- javascript.electron
Expand Down
2 changes: 2 additions & 0 deletions src/platforms/javascript/common/profiling/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Profiling
sidebar_order: 1
supported:
- javascript
notSupported:
- javascript.bun
description: "Learn what transactions are captured after tracing is enabled."
---

Expand Down
8 changes: 8 additions & 0 deletions src/platforms/javascript/guides/bun/config.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these docs make more sense to live here, in the browser JS frameworks, or in the Node frameworks?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah good point, we discussed this
it's either/or 😅

At one point we might just merge Javascript and Node together.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: Bun
sdk: sentry.javascript.bun
fallbackPlatform: javascript
caseStyle: camelCase
supportLevel: production
categories:
- browser
- server
Loading