-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I get transactionId in springboot application, not in log #7742
Comments
@emeroad If possible, i would prefer to migrate this feature into the official SDK. It wouldn't be hard. IMHO, the official SDK should have minimal dependency to avoid dependency conflicts and no dependency on pinpoint other modules should be recommended. |
It would be so much better to get the transaction info from a stable api. |
When will the SDK be released? |
Working on the migration ( move application-interaction module in PR #6801 to agent-sdk). A new PR would be make in a few days later. |
|
@yjqg6666 I have a question, why not use a plugin to enhancement the agent sdk to set the txid in, it may be more efficient |
@aalinyu Class.forName is called only 4 times per a HTTP request. According to this benchmarking, it may be not necessary. |
AlternativeNon-invasive implementation that does not require SDK The current implementation has a problem of high complexity across ClassLoader, ThreadLocal, and SDK.
public class Sample extends HttpServlet{
protected void doGet(HttpServletRequest request, HttpServletResponse response) {
// This information is injected by the pinpoint interceptor
String transactionId = request.getAttribute("PINPOINT_TRANSACTIONID")
Long spanId = request.getAttribute("PINPOINT_SPANID")
}
}
public class HttpServletRequestAdaptor implements RequestAdaptor<HttpServletRequest> {
@Override
public void setAttribute(HttpServletRequest request, String name, Object o) {
request.setAttribute(name, o);
}
}
|
How can I get transactionId in springboot application, like skywalking
I want to insert transactionId to mysql
The text was updated successfully, but these errors were encountered: