Replies: 1 comment 1 reply
-
Yes, ThreadLocals and asynchronous handling of requests don't go together. (I originally stumbled upon the problem in the context of https://logback.qos.ch/manual/mdc.html). The now deprecated https://www.playframework.com/documentation/2.7.x/JavaHttpContextMigration27#Http.Context.current()-and-Http.Context.request()-deprecated may provide some further background information, by the way. That said, you could consider using the request ID: https://www.playframework.com/documentation/2.8.x/api/java/play/mvc/Http.RequestHeader.html#id-- Or you could consider propagating the traceId as an attribute: https://www.playframework.com/documentation/2.7.x/api/java/play/mvc/Http.Request.html#addAttr-play.libs.typedmap.TypedKey-A- I hope this helps! |
Beta Was this translation helpful? Give feedback.
-
hi I am new to play framework, my team is using apache-skywalking for observablity.
when integrating play framework with the agent I noticed that its not able to link (with common traceId) db calls with http requests, as they run in different threads
trace context is stored/retreived from threadlocal variable (in framework like springmvc single thread makes all the operations for a particular request),
I wanted to understand if there a way to link the operations ?
any suggestions would be helpful
discussion from skywalking repo apache/skywalking#10430
Beta Was this translation helpful? Give feedback.
All reactions