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

support koa-graphql #2411

Closed
sibelius opened this issue Nov 3, 2021 · 2 comments
Closed

support koa-graphql #2411

sibelius opened this issue Nov 3, 2021 · 2 comments
Labels
agent-nodejs Make available for APM Agents project planning. community

Comments

@sibelius
Copy link
Contributor

sibelius commented Nov 3, 2021

Is your feature request related to a problem? Please describe.
We use koa-graphql instead of express-graphql, so we'd like to support it

Describe the solution you'd like
Create something like this https://github.com/elastic/apm-agent-nodejs/blob/master/lib/instrumentation/modules/express-graphql.js for koa-graphql

Describe alternatives you've considered
how can I add this custom instrumentations to my own code without modifying this package?

Additional context
image

if I implement this for koa-graphql, the transaction name will be the operation name of the GraphQL query/mutation?

@github-actions github-actions bot added agent-nodejs Make available for APM Agents project planning. community triage labels Nov 3, 2021
@trentm
Copy link
Member

trentm commented Nov 4, 2021

Hi. Theoretically you can implement the instrumentation yourself and call apm.addPatch(...) to have the APM agent automatically load your instrumentation file when koa-graphql is require()d. However, practically, there aren't a lot of examples and usage of this, so it might be a little painful to get going.

If you are willing, you could start a PR for this and we could try to help you get it working. I'm not familiar with koa-graphql to know if it would potentially be a very similar implementation to the express-graphql instrumentation.

@trentm trentm removed the triage label Nov 4, 2021
@sibelius
Copy link
Contributor Author

we added a custom label per operation name, it works well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning. community
Projects
None yet
Development

No branches or pull requests

2 participants