getsentry / getsentry/sentry-javascript

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

Aperta
#9,316 15 commenti 1 reazione 0 assegnatari Vedi su GitHub
Browser Improvement
Lingua principale
TypeScript
Stelle
8.7k
Fork
1.8k
Merge medio
1g 17h
PR unite (30g)
515

Descrizione

### 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)

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.