-
Notifications
You must be signed in to change notification settings - Fork 529
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
Multiple telemetry events when using dataloader #892
Comments
After digging through the code a bit, perhaps separate dataloader start/stop events should be emitted here: https://github.com/absinthe-graphql/dataloader/blob/master/lib/dataloader/kv.ex#L107. Thoughts? |
Hi @akoutmos, the behaviour you are seeing is correct and expected. Batch style resolvers like dataloader group the resolution of many fields together. Suppose you have this:
and there are 3 posts, the Dataloader should definitely emit telemetry events though. Please feel free to open up an issue about that there. |
Thanks for the detailed answer @benwilson512! That all makes sense. I'll get to work on adding telemetry to dataloader and will open up a PR. As a side note (mostly since I am new to Absinthe), how would I go about filtering out |
Can you elaborate on why you want to filter those out? The times are 100% valid, they're just happening concurrently. |
My bad. I should have given some more context. While the timings are 100% valid and accurate, I cannot reliably use those events to count how many times I have had to perform that batch resolution. For example, let's say I had a Prometheus counter set up inside the |
Environment
Expected behavior
When using a dataloader for a field, I would expect a single
[:absinthe, :resolve, :field, :start]
event and a single[:absinthe, :resolve, :field, :stop]
event to be emitted via telemetry during the resolution of a field.Actual behavior
I am currently getting 1 pair of start/stop telemetry events per reference of that field in a list of items even though I am only reaching out once to fetch the batch data.
I'll try and throw together a dummy project to repro the issue more clearly, but for now any assistance would be greatly appreciated. Thanks for all the hard work you've put into Absinthe!! Appreciate it :).
The text was updated successfully, but these errors were encountered: