getsentry / getsentry/sentry-javascript

Use Proxy for console instrumentation to avoid logs showing up as coming from `instrument.ts`

Abierto
#9,316 15 comentarios 1 reacción 0 asignados Ver en GitHub
Browser 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/sveltekit

### SDK Version

7.73.0

### Framework Version

"@sveltejs/kit": "^1.25.2",

### Link to Sentry event

_No response_

### SDK Setup

```js
Sentry.init({
dsn: '...',
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,

// If you don't want to use Session Replay, just remove the line below:
integrations: [new Replay()],
environment: dev ? 'development' : 'production'
});
```

### Steps to Reproduce

On the new Syntax site, our console.logs in firefox are showing up as from sentry’s instrument.ts.

I know chrome has a list to x-google-ignorelist (https://developer.chrome.com/articles/x-google-ignore-list/) scripts like this and show the real source, but turning that on in Firefox hides the logs entirely.

Using firefox' "ignore" option on both instrument.ts and the entire `@sentry/utils` package doesn't seem to change anything.

I think this is a new problem as I've not encountered this before and used firefox for years. Confirmed in Firefox developer 119 and stable 118.

Several github issues saying to just turn console breadcrumbs off, but that doesn’t seem to be a good fix because we want those as well.

### Expected Result

it shows the source as authored

### Actual Result

![image](https://github.com/getsentry/sentry-javascript/assets/176013/be88fa50-1582-4bc9-8ed0-81f1a737ea41)

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.