Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Dataloader integration #21
Dataloader integration #21
Changes from all commits
79023c3
0ab03fb
d50d91c
a3722b0
cfbac56
4665b89
f9be08e
a0e11fd
e47b52f
ba49b1d
f0522f2
d5b061b
7392dc0
79921bd
17c0cfa
1ed3410
0652d9e
d22663a
c28e4d6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to guard against this with some unit tests rather than commented out warnings. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added better comments and removed the commented-out warning 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the counter! Can we make that part of the main accumulator so we can track how many times we looped the loop regardless of the mechanism? I'm OK with an extra span per overall resolution named
"resolution 0"
etc.Let's also put the counter to the resolution span attributes as
"absinthe.blueprint.resolution"
, and the blueprint span attributes as"absinthe.blueprint.resolution_count"
. I'm pretty sure:ocp.put_span_attribute/2
and:oc_trace.put_span_attribute/3
won't mind it being put more than once.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok - I think I got this working - if not, please be detailed on what I'm doing wrong. Again, I'm not too familiar with Absinthe. ='(
Thank you very much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recently automated insertion of
Opencensus.Absinthe.Middleware
on literally every field with aresolver
in our code base, simulating what'll happen with Absinthe 1.5 by default.Turns out, it's a mess when tracing every field meets
Absinthe.Resolution.Helpers.dataloader/3
. For every item in the output, we get a span starting just before the call toDataloader.load
and ending just after the call to the laston_load
in the chain. We need to know how longDataloader.run/1
took and what it was doing, but the trace can't tell us.Strikes me if you finish your span right here, we'll know!
Read also, #26, which is all about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we wait until
after_resolution/1
to finish the span, it'll include a lot of time spent waiting for other middleware and plugins.