Add client handshake tracing for Tyrus standalone WebSocket client
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- java
調査の方向性
EndpointInstrumentation.CaptureHandshakeSpanAdvice と、"if handshake is not captured traces are not generated" という名前の upstream テストから始めます。Tyrus standalone client が Endpoint.onOpen() の前にどのように Grizzly transport を使用しているかを追跡します。完了条件は、クライアントの handshake span が onOpen() に到達し、既存の instrumentation が再現用に websocket.send、websocket.receive、websocket.close の各 span を生成することです。
索引モデルが issue の本文から書いたものです。
説明
Library Name
Tyrus standalone WebSocket client with its Grizzly transport, optionally used through Spring StandardWebSocketClient.
Library Version(s)
org.glassfish.tyrus:tyrus-standalone-client:2.2.0- Jakarta WebSocket 2.x
- Also observed with Spring Framework 6.2.15 and Java 17.0.13
Describe the feature you would like
Please add end-to-end client handshake tracing for the Tyrus standalone Jakarta WebSocket client when it uses the Grizzly transport.
The existing Jakarta WebSocket instrumentation should then be able to associate the handshake span with the jakarta.websocket.Session and create websocket.send, websocket.receive, and websocket.close spans.
Is your feature request related to a problem?
Yes. The current generic Jakarta WebSocket instrumentation initializes its session state in EndpointInstrumentation.CaptureHandshakeSpanAdvice only when AgentTracer.get().activeSpan() is non-null during Endpoint.onOpen().
With a Tyrus standalone client, the HTTP upgrade and Endpoint.onOpen() callback execute through the Grizzly client transport without an active Datadog HTTP client span. Consequently, no HandlerContext.Sender is attached to the session. Later send and receive advice finds no handler context and creates no WebSocket message spans.
This was observed with:
trace.websocket.messages.enabled=trueJakartaWebsocketModuleapplied successfullyjakarta.websocket.Endpointand SpringStandardWebSocketHandlerAdaptertransformed successfully- no WebSocket-specific transformation errors
- ordinary HTTP, Redis, and other spans created and exported normally
- application WebSocket logs on
Grizzly(...)threads showing no active trace or span IDs
A downstream agent build based on 1.63.4 was used for the initial observation. The same dependency on an already-active handshake span is still present on the current upstream main branch. The upstream test named if handshake is not captured traces are not generated also documents the resulting behavior.
Reproduction outline
Configure Tyrus as the Jakarta WebSocket client implementation, connect to an echo WebSocket server, register a message handler, and send a message:
WebSocketContainer container = ContainerProvider.getWebSocketContainer();
Session session =
container.connectToServer(
new Endpoint() {
@Override
public void onOpen(Session session, EndpointConfig config) {
session.addMessageHandler(String.class, message -> received.countDown());
}
},
URI.create("ws://localhost:8080/echo"));
session.getBasicRemote().sendText("hello");
received.await();
session.close();
Expected spans include a client handshake span followed by websocket.send, websocket.receive, and websocket.close. Currently none of the WebSocket spans are created because there is no active handshake span when Endpoint.onOpen() runs.
Alternatives considered
- Manually creating spans around each application-level send and receive handler.
- Propagating trace context in the WebSocket message payload.
- Creating a synthetic handshake span in generic Jakarta WebSocket instrumentation when no active span exists.
The preferred solution is dedicated Tyrus client handshake instrumentation that creates the handshake span and activates or propagates it into Endpoint.onOpen(), allowing the existing Jakarta WebSocket message instrumentation to work as designed.
- 主要言語
- Java
- スター
- 737
- フォーク
- 361
- 平均マージ
- 3日 13時間
- マージ済み PR(30日)
- 181
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DataDog/dd-trace-java のほかの issue
-
type: feature request
難易度 1/5 1〜3時間 初心者へのやさしさ 70/100
DataDog/dd-trace-java#10245 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
comp: context propagation inst: grpc type: feature request
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
DataDog/dd-trace-java#12654 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 62/100
DataDog/dd-trace-java#12608 ·
メンテナーはふだん 1 日以内に返信
-
type: bug report
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
DataDog/dd-trace-java#12597 ·
メンテナーはふだん 1 日以内に返信
-
Queueing-time profiler aborts the whole instrumentation install under a JDK 24+ AOT cache (zero spans); disabling that one feature is enough対応中かも @mcculls が 5 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
DataDog/dd-trace-java#12540 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
DataDog/dd-trace-java の issue をすべて見る
似ている issue
-
TerminalRow.mSpaceUsed (short) overflows on terminals wider than 1023 columns, crashing setCharオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
termux/termux-app#5340 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
apache/rocketmq-dashboard#5110 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 4 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
TS2502 in shipped .d.ts: `compileHighlightConfig` parameter shadows the de-aliased `Query` typeオープンbug javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信