getsentry / getsentry/sentry-javascript

Unify attribute typing and serialization

Aperta
#18,164 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
breaking breaking change javascript Meta: Breaking Task
Lingua principale
TypeScript
Stelle
8.7k
Fork
1.8k
Merge medio
1g 17h
PR unite (30g)
515

Descrizione

Right now, we have various implementations and type declarations for attributes, serialization/conversion, etc. Given that spans (v2), metrics and logs all accept the same attributes, we should unify the respective declarations and the logic. This probably saves some bundle size for multi-product users.

Fully unifying attribute typing and serialization is a breaking change because:

* logs and metrics currently stringify array values
* stringification is not handled perfectly well and we could extract more information from obscure values:
* circular objects /h/t @s1gr1d for bringing up!)
* `undefined/null` values
* objects throwing in `toJSON` but having a `toString`
* => All of these cases can be improved but are breaking changes in terms of values

Actually removing duplicated logic between logs, metrics and span attributes is not part of this issue and should be addressed in [JS-1145](https://linear.app/getsentry/issue/JS-1145/apply-scope-attributes-to-logs), [JS-1147](https://linear.app/getsentry/issue/JS-1147/apply-scope-attributes-to-spans-v2), [JS-1146](https://linear.app/getsentry/issue/JS-1146/apply-scope-attributes-to-metrics) directly (i.e. before the next major).

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.