-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(node): Add dataloader integration
#13664
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
Conversation
size-limit report 📦
|
e95324d to
fb171b0
Compare
dataloader instrumentationdataloader integration
AbhiPrasad
left a comment
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.
Let's create a GH issue in this repo to track the follow-up improvement to dataloader. We can then create GH issues in the OTEL repo accordingly.
Could you also link some example traces that have dataloader spans?
|
|
||
| const INTEGRATION_NAME = 'Dataloader'; | ||
|
|
||
| export const instrumentDataloader = generateInstrumentOnce(INTEGRATION_NAME, () => new DataloaderInstrumentation({})); |
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 think we should set requireParentSpan to be true by default, and then expose config to change it accordingly, but I'm open to other opinions.
@mydea what do you think?
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.
Let's set requireParentSpan to be true by default @onurtemizkan. We don't need to expose config for now, we can add that later based on user request.
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.
Just realised it's also true by default in DataloaderIntegration. Still, passed true from our side, and we can expose it later if we need to.
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.
this sounds reasonable to me, I guess you rarely want this to be a transaction!
@AbhiPrasad, here's the trace of what we test in the integration tests. Link |
AbhiPrasad
left a comment
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.
Alright let's get this in, and work toward improving stuff on it upstream!
Resolves: #13313
Adds integration for
dataloaderusing@opentelemetry/instrumentation-dataloaderon the background.A few notes:
@opentelemetry/instrumentation-dataloader. So, we don't havecache.hit,cache.key,cache.item_sizeand so on, in this integration. I can try to implement those upstream, but if you have another way in mind to access those please let me know.@opentelemetry/instrumentation-dataloaderonly records spans forload,loadManyandbatch, which all arecache.getoperations. There are alsoprime,clear,clearAll. We also can implement those upstream and update the integration in future.