Git Product home page Git Product logo

Comments (2)

realark avatar realark commented on August 21, 2024

Hi @mwirges, yes it is intentional that the flag be set. However we can explore some options to make things more smooth on your end.

First, some context. Propagating our trace by default can cause problems because the executor instrumentation is too low level to know where to start and stop automatically. This sometimes causes traces to be linked across logical boundaries. We've seen http servers with code like this:

writeResponseToUser(response);
// the executor instrumentation will link this call to submit
// causing the two requests to be captured under the same trace
threadPool.submit(processNextRequestCallback);

To avoid this issue we're using higher level instrumentation to turn the async instrumentation on and off at the appropriate times.

For example, in play we enable async instrumentation when the request comes in and disable when the response goes out.

Setting this flag does not require a dependency on dd-trace-ot, just on dd-trace-api, which is a smaller library with no transitive dependencies. https://mvnrepository.com/artifact/com.datadoghq/dd-trace-api/0.7.0

As a solution, we can add async logic to our builtin servlet instrumentation similar to what we do with play. That will give you the old behavior when using async libraries inside a servlet request. What do you think about that?

from dd-trace-java.

mwirges avatar mwirges commented on August 21, 2024

@realark yeah understood on not wanting to inadvertently continue unrelated things. I do think turning it on from servlet instrumentation automatically would be helpful. Thanks for clarifying on dd-trace-api; I'll give that a whirl in the meantime.

from dd-trace-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.