With the default installation, PryIn monitors your regular Phoenix controllers and channels.
In this case, no metrics about your GraphQL queries and mutations will appear in PryIn by default, as they are not piped through a regular controller.
This is easily fixed with Custom Traces, though.
We simply create a small Plug:
And add it to the router pipeline of the Absinthe Plug:
With those changes, your GraphQL queries and mutations will appear under the “Absinthe” custom trace group:
Zooming into the “allProjects” query you get a graph showing the average and percentile execution time of all “allProject” requests and a list of those:
After clicking on one of the traces in the table, you get a detailed breakdown of that request, including all database queries:
One thing to note here: We’re using the
operationName as key for the Custom Traces.
This allows getting and comparing aggregate data for single operations,
as you can see in the second screenshot:
allProjects query get slower on average compared to last week?”
“What is the 95% percentile of all my
It also means that you need to set that in your queries.
Queries and mutations with empty or missing
operationName won’t end up on PryIn.
But it’s a good idea
to include an operation name anyway, so that was fine in our case.