getsentry / getsentry/sentry-javascript

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

未关闭
#15,405 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Improvement Profiles profiling-node
主要语言
TypeScript
星标
8.7k
派生
1.8k
平均合并
1 天 17 小时
30 天内合并 PR
523

描述

### 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`?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。