Absinthe request flow - flame graph

Hello,

I am trying to generate a flame graph for my Absinthe application and I am having a hard time understanding the whole Absinthe flow and how to make it work.

I am using the eflambe library and it contains a capture function where I have to specify the module and function that I want to trace.

Eg:
:eflambe.capture({Absinthe.Plug.GraphiQL, :call, 2}, 1, output_format: :brendan_gregg)

Can someone help me understand the entry point of an Absinthe request call and a module that I can use to trace the whole execution?

NOTE:

I don’t want to benchmark only the resolver call because Absinthe is doing a lot of more work after that and that’s what I want to see in a flame graph.

I realized that having nested fields might slow down things and this is what I am trying to see and improve.

Thanks in advance

Hey @devmarco Absinthe.run(document, schema, variables: variables, context: context) is probably what will work best for you.

Let me know what you find!

@benwilson512 It seems that eflamble does not work with external modules.

I think it only works with modules defined by my application. Or maybe because the code is not executing that after all.

I tried to run this, but after making a request I didn’t see any trigger to the capture function.

:eflambe.capture({Absinthe, :run, 3}, 1, output_format: :brendan_gregg)

When I use Absinthe.Plug.GraphiQL call function, it works. So I don’t think it’s an external module issue. Are we calling that even using the GraphiQL plug?

Do you know any other way where I can generate a flame graph for an Absinthe request?

I am not familiar with that library, sorry. Your theory about whether it works with external modules though is pretty easy to test, just call a simple function in another library and see what happens.

I did a couple of tests and it worked with Absinthe.Pipeline.run/2.

Thank you @benwilson512