getsentry / getsentry/sentry-javascript

Unify attribute typing and serialization

Abierto
#18,164 2 comentarios 1 reacción 0 asignados Ver en GitHub
breaking breaking change javascript Meta: Breaking Task
Lenguaje dominante
TypeScript
Estrellas
8.7k
Forks
1.8k
Merge medio
1 d 17 h
PR fusionados (30 d)
523

Descripción

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

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.