getsentry / getsentry/sentry-javascript

Unify attribute typing and serialization

オープン
#18,164 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
breaking breaking change javascript Meta: Breaking Task
主要言語
TypeScript
スター
8.7k
フォーク
1.8k
平均マージ
1日 17時間
マージ済み PR(30日)
515

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。