getsentry / getsentry/sentry-javascript

Add trace id in Sentry Event when `tracesSampleRate` is set to 0 in Cloudflare

オープン
#22,214 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
Cloudflare Workers Feature
主要言語
TypeScript
スター
8.7k
フォーク
1.8k
平均マージ
1日 17時間
マージ済み PR(30日)
515

説明

### Problem Statement

A new option called `Tracing` has been added in Cloudflare Wrangler types v5:

```js
export interface Tracing {
enterSpan(
name: string,
callback: (span: Span, ...args: A) => T,
...args: A
): T;
startActiveSpan(
name: string,
callback: (span: Span, ...args: A) => T,
...args: A
): T;
Span: typeof Span;
}
export declare abstract class Span {
get isTraced(): boolean;
setAttribute(key: string, value?: boolean | number | string): void;
end(): void;
}
```

This will be added when tracing has been enabled by the wrangler config. When `tracesSampleRate` is set to 0 the Error triggered from Sentry has no trace id. When there is a trace drain from Cloudflare to Sentry then this error won't be attached properly. It'd work when the Error/Event would have a trace id attached.

### Solution Brainstorm

Based on the the type there is no trace id, so let's see if there is any way to retrieve it, or only Tailworker have access to it (since they have a `SpanContext` attached in their type

### Additional Context

_No response_

### Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.

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

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

調査の方向性

The issue does not name files or tests. Start by locating the Cloudflare runtime integration and Sentry event construction, then determine whether the Wrangler tracing APIs expose a trace ID when tracesSampleRate is 0. Done means Cloudflare-drained errors are attached to the corresponding Sentry trace, with coverage for the supported behavior.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
observability-sre
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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