Code Monkey home page Code Monkey logo

Comments (4)

garthk avatar garthk commented on June 14, 2024

From my poking around Absinthe so far, strikes me Absinthe.Phase.Document.Execution.Resolution will keep working on entries in res.middleware until it either finishes or gets %{state: :suspended} from one of the three async troublemakers. The good news is that we can set the “current” span context for the field/path at the beginning of res.middleware, and it'll be available whenever anything is kicked off during that first pass. The bad news is, I haven't yet found a way to put it back for any subsequent activity e.g. the post_batch_fun callback, nor to clear it at the end of the first pass.

from opencensus_absinthe.

garthk avatar garthk commented on June 14, 2024

Might be wrong about the end of the first pass: the after_resolution callback will fire. And, then, again as long as any of the plugins' pipeline/2 callbacks insert another Absinthe.Phase.Document.Execution.Resolution.

from opencensus_absinthe.

garthk avatar garthk commented on June 14, 2024

Would it be too intrusive to insert a phase to rewrite the blueprint to replace all the {Absinthe.Middleware.Batch, {batch_key, post_batch_fun}} tuples with something that'd call seq_trace first? I'd have to come last, somehow…

  def plugins do
    [Absinthe.Middleware.Dataloader] ++ AbsinthePlugin.defaults()
  end

… like putting myself at the end of that list, there.

from opencensus_absinthe.

garthk avatar garthk commented on June 14, 2024

Ugh. Absinthe.Phase.Document.Execution.Resolution.run_callbacks/4 always runs the plugins in order. We'll need two to measure the whole loop: one first, and one last.

from opencensus_absinthe.

Related Issues (16)

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.