getsentry / getsentry/sentry-javascript

Integrations not working for Bun

Abierto
#14,202 30 comentarios 4 reacciones 0 asignados Ver en GitHub
Bun Improvement
Lenguaje dominante
TypeScript
Estrellas
8.7k
Forks
1.8k
Merge medio
1 d 17 h
PR fusionados (30 d)
515

Descripción

### Is there an existing issue for this?

- [X] I have checked for existing issues [https://github.com/getsentry/sentry-javascript/issues]()
- [X] I have reviewed the documentation [https://docs.sentry.io/]()
- [X] I am using the latest SDK release [https://github.com/getsentry/sentry-javascript/releases]()

### How do you use Sentry?

Sentry Saas ([sentry.io]())

### Which SDK are you using?

@sentry/bun

### SDK Version

8.37.1

### Framework Version

*No response*

### Link to Sentry event

*No response*

### Reproduction Example/SDK Setup

Hey,
which integrations should I expect to work in bun? So far only manual instrumentation seems to be working.
Is this expected behavior? If so, a few more notes on that would be appreciated in the documentation.

Bun

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

// Ensure to call this before importing any other modules!
Sentry.init({
dsn: DSN,
debug: true,
// Add Performance Monitoring by setting tracesSampleRate
// Set tracesSampleRate to 1.0 to capture 100% of transactions
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
});
```

```
import "./instrument.ts";
import * as Sentry from "@sentry/bun";

await Sentry.startSpan(
{
op: "test",
name: "My First Test Transaction in bun",
},
async () => {
await fetch(`https://google.com`);
},
);

const sleep = () => new Promise((res) => setTimeout(() => res("hi"), 3000));

await sleep();
throw new Error("I just crashed Bun");
`

Node
`
import * as Sentry from "@sentry/node";

// Ensure to call this before importing any other modules!
Sentry.init({
dsn: DSN,
debug: true,
// Add Performance Monitoring by setting tracesSampleRate
// Set tracesSampleRate to 1.0 to capture 100% of transactions
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
});
```

### Steps to Reproduce

[https://github.com/doepnern/sentry-node-bun-comparison]()

### Expected Result

## Expected http instrumentation to work, according to docs (See result for node below)

[https://docs.sentry.io/platforms/javascript/guides/bun/configuration/integrations/http/]()

![Image](https://uploads.linear.app/3ed206af-f87a-40aa-82a0-150bf83e43e6/04a720b9-40c6-45df-b01d-c8fd5c3b5ca6/afcc026c-5600-41ab-b230-f1b62afb9f81?signature=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXRoIjoiLzNlZDIwNmFmLWY4N2EtNDBhYS04MmEwLTE1MGJmODNlNDNlNi8wNGE3MjBiOS00MGM2LTQ1ZGYtYjAxZC1jOGZkNWMzYjVjYTYvYWZjYzAyNmMtNTYwMC00MWFiLWIyMzAtZjFiNjJhZmI5ZjgxIiwiaWF0IjoxNzY5NzAyMzYxLCJleHAiOjE4MDEyNzI5MjF9.mydAcPPbkKg98-O67a3EP9L4ILuFY357ESregmDLnDs)

### Actual Result

![Image](https://uploads.linear.app/3ed206af-f87a-40aa-82a0-150bf83e43e6/a9287d00-ef8f-4b2c-b66f-344c85c3470d/178880d5-2873-42f9-8004-80c91154e735?signature=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXRoIjoiLzNlZDIwNmFmLWY4N2EtNDBhYS04MmEwLTE1MGJmODNlNDNlNi9hOTI4N2QwMC1lZjhmLTRiMmMtYjY2Zi0zNDRjODVjMzQ3MGQvMTc4ODgwZDUtMjg3My00MmY5LTgwMDQtODBjOTExNTRlNzM1IiwiaWF0IjoxNzY5NzAyMzYxLCJleHAiOjE4MDEyNzI5MjF9.1wLnNVYYRbFat2c4EzStaW71_C_4WOeitgefdWFMqO4)

## error handling is noted as not working in the npm package page, so i guess that is to be expected

![Image](https://uploads.linear.app/3ed206af-f87a-40aa-82a0-150bf83e43e6/24b2626a-356a-4d53-8b7e-5f0e5db0d0d9/25c0be27-7c8f-48cb-85bc-d05097b14f6c?signature=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXRoIjoiLzNlZDIwNmFmLWY4N2EtNDBhYS04MmEwLTE1MGJmODNlNDNlNi8yNGIyNjI2YS0zNTZhLTRkNTMtOGI3ZS01ZjBlNWRiMGQwZDkvMjVjMGJlMjctN2M4Zi00OGNiLTg1YmMtZDA1MDk3YjE0ZjZjIiwiaWF0IjoxNzY5NzAyMzYxLCJleHAiOjE4MDEyNzI5MjF9.S_EJuYMBFPQFDV_6OHSQtChOxXrsNYDTqiGqSn5sjd4)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.