Add client handshake tracing for Tyrus standalone WebSocket client
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- java
- Ambito
- observability-sre
Direzione di ricerca
Inizia con EndpointInstrumentation.CaptureHandshakeSpanAdvice e il test upstream denominato "if handshake is not captured traces are not generated"; segui il modo in cui il client standalone di Tyrus utilizza il proprio trasporto Grizzly prima di Endpoint.onOpen(). Il lavoro è completo quando lo span dell’handshake del client raggiunge onOpen() e la strumentazione esistente produce gli span websocket.send, websocket.receive e websocket.close per la riproduzione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Java
- Stelle
- 737
- Fork
- 361
- Merge medio
- 3g 13h
- PR unite (30g)
- 181
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DataDog/dd-trace-java
-
type: feature request
Difficoltà 1/5 1-3 ore Idoneità per principianti 70/100
DataDog/dd-trace-java#10245 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
comp: context propagation inst: grpc type: feature request
Difficoltà 3/5 1-2 giorni Idoneità per principianti 78/100
DataDog/dd-trace-java#12654 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 62/100
DataDog/dd-trace-java#12608 ·
I maintainer di solito rispondono entro 1 giorno
-
type: bug report
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
DataDog/dd-trace-java#12597 ·
I maintainer di solito rispondono entro 1 giorno
-
Queueing-time profiler aborts the whole instrumentation install under a JDK 24+ AOT cache (zero spans); disabling that one feature is enoughForse già presa @mcculls l’ha presa 6 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
DataDog/dd-trace-java#12540 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di DataDog/dd-trace-java
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
checkstyle/checkstyle#21755 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
github/copilot-sdk#2782 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation Good for newcomer quick win
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CodeForPhilly/benefit-decision-toolkit#519 ·
I maintainer di solito rispondono entro 1 giorno
-
area-deployment triage:bot-seen triage:needs-human
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoft/aspire#20533 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno