Skip to content
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

GraphQL Apollo Server #14

Closed
hekike opened this issue Dec 9, 2019 · 14 comments · Fixed by #226
Closed

GraphQL Apollo Server #14

hekike opened this issue Dec 9, 2019 · 14 comments · Fixed by #226

Comments

@hekike
Copy link
Member

hekike commented Dec 9, 2019

Is your plugin request related to a problem? Please describe.
GraphQL batches multiple queries and entities as a data access protocol into a single HTTP request.
In the background, the GraphQL server will run multiple so-called resolvers that return data for a specific chunk of the graph to fulfill these GraphQL queries. Resolvers can run parallel and depend on each other while they usually fetch data from downstream services or from databases using data-loader concept which makes the data orchestration even more complex. Understanding this execution with timing and error is crucial to debug and optimize GraphQL servers.

https://blog.apollographql.com/graphql-explained-5844742f195e

Apollo Server is probably the most popular library to run GraphQL in production.

Commercial alternative for GraphQL Apollo Tracing
https://blog.apollographql.com/the-new-trace-view-in-apollo-engine-566b25bdfdb0

Is it applicable for Node or Browser or both
Node.js only.

Do you expect this plugin to be commonly used
Yes
Weekly Downloads: don't know the exact number

Additional context

@hekike
Copy link
Member Author

hekike commented Dec 9, 2019

Here is a PoC with using the Apollo Server extensions interface: https://github.com/open-telemetry/opentelemetry-js/compare/master...hekike:feat/plugin-apollo-server?expand=1

@dyladan
Copy link
Member

dyladan commented Dec 9, 2019

According to npm, the apollo module receives ~250k downloads weekly.

@hekike if a request comes in on http, and apollo looks into a couple data stores (say mysql, a http api, and a mongodb) then isn't it sufficient to instrument the underlying transports? What value is gained in this case from instrumenting apollo directly?

@hekike
Copy link
Member Author

hekike commented Dec 9, 2019

The mapping between GraphQL resolvers and data sources like MongoDB won't be 1:1 mapping.
GraphQL will run a resolver for every index, for example, it will also skip resolvers when the parent over fetches from data source. Also usually people put the dataloader layer between resolvers and data sources so batching and caching will make an even bigger disconnect between resolver dependencies, errors and latencies between resolver and data sources. For example, 10 resolvers will maybe cause one partial HTTP request. In some organizations, this separation also reflects in team structures and data source clients are provided by other teams than teams who work on resolvers. Personally I see a value in tracking GraphQL orchestration/resolver in tracing.

@wtgtybhertgeghgtwtg
Copy link

With a few nits, the PoC looks good. Is there anything I can do to help move it along?

@dyladan
Copy link
Member

dyladan commented Feb 26, 2020

We're trying to move away from hosting all possible plugins in this repo. In the future we plan to have a contrib style repo where plugins may live, but for now you may be better off self-hosting your plugin and adding it to the registry at https://opentelemetry.io/registry/.

@vmarchaud
Copy link
Member

I'm moving the issue on the contrib repository, if someone has a implementation feel free to open up a PR over there so we can merge it !

@vmarchaud vmarchaud transferred this issue from open-telemetry/opentelemetry-js Apr 25, 2020
@jon-whit
Copy link

What's the status on this effort? I'm also looking at integrating OpenTelemetry into a GraphQL implementation using apollo-server.

@dyladan
Copy link
Member

dyladan commented May 21, 2020

As far as I'm aware, nobody is working on this right now

@obecny
Copy link
Member

obecny commented Aug 3, 2020

@jon-whit are you working on that ?

@obecny
Copy link
Member

obecny commented Aug 7, 2020

ok it looks like no1 is working on that, I'm taking over it

@obecny obecny self-assigned this Aug 7, 2020
@hongbo-miao
Copy link
Contributor

Hi @obecny just a suggestion, it would be great to support from GraphQL.js level, so it does not matter which GraphQL framework people are using. 😀

@obecny
Copy link
Member

obecny commented Aug 24, 2020

@hongbo-miao yes that's exactly what will be doing

@jon-whit
Copy link

@obecny how's this work coming along? Anything that I can help with? My team and I are looking to expedite this process a bit. We really would love to have this.

@obecny
Copy link
Member

obecny commented Sep 24, 2020

@jon-whit in progress (graphql first), FYI to be able to patch graphql I had to refactor plugin instrumentation too which was done, without this such plugin could not be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants