getsentry / getsentry/sentry-javascript

profiling-node should store `profile_id` on span rather than profile context

Đang mở
#15,405 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Improvement Profiles profiling-node
Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.8k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
523

Mô tả

### Description

Currently `@sentry/profiling-node` stores the `profile_id` on the isolated context:
https://github.com/getsentry/sentry-javascript/blob/ec02f84fc6597e73bbc1c6d905da7b12b15dbc07/packages/profiling-node/src/integration.ts#L87

This means the profile cannot be found if there are multiple versions of `@sentry/core` in the dependencies.

Instead can we store the `profile_id` on the span? There's already a property for this:
https://github.com/getsentry/sentry-javascript/blob/bfe7bfa53270fc6f173e49f79177d367f1c78639/packages/core/src/types-hoist/span.ts#L49

Then the integration wouldn't rely on updating any scope. In the `beforeEnvelope` hook we just go through the spans until we find a `profile_id`?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.