getsentry / getsentry/sentry-javascript

Unify attribute typing and serialization

Offen
#18,164 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
breaking breaking change javascript Meta: Breaking Task
Vorherrschende Sprache
TypeScript
Sterne
8.7k
Forks
1.8k
Ø Merge
1 T. 17 Std.
Gemergte PRs (30 T.)
515

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.