graphql-yoga: [useApolloUsageReport] Number of requests is missing
Describe the bug
Hello,
we recently migrated from Apollo Server to GraphQL Yoga and started using the “useApolloUsageReport” plugin instead of the original “ApolloServerPluginUsageReporting” plugin.
After a few days of use, we noticed that the metrics in Apollo Studio are missing important information about the number of requests that were previously there.
The problem only occurs in the section for “individual object fields” - Insights => Object Fields (filter). Details can be seen on the attached screenshots bellow. The number of requests for “GraphQL operations” - Insights => Operations (filter) is displayed correctly. NOTE that the number of requests is missing (is always zero), but the number of executions is available.
BEFORE - Apollo Server + ApolloServerPluginUsageReporting plugin
AFTER - GraphQL Yoga + useApolloUsageReport plugin
Maybe @EmrysMyrddin could help because he knows how it all works? 😉
Your Example Website or App
https://studio.apollographql.com/
Steps to Reproduce the Bug or Issue
Just use the “useApolloUsageReport” plugin. 🙂
Expected behavior
“useApolloUsageReport” plugin should report also number of requests for “individual object fields”.
Platform
@graphql-yoga/plugin-apollo-usage-report@0.5.3
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (10 by maintainers)
Hi ! I’ve been working on improving this plugin 😃
Could you give this PR a try #4020 ?
It’s implementing per field request count, and improving the reporting by adding trace compression, batching and error handling. Since this feature is behind the Entreprise Plan, we can’t really test this by ourself, so your help would be very appreciated !
Hello @EmrysMyrddin . Thanks for the new beta version of ApolloUsageReport plugin. We’ll try it out and give you feedback after the weekend. I also tested the original/official ApolloServerPluginUsageReporting plugin and even with this plugin, the metrics for the “Input Fields” and “Enum Values” are not collected. It seems that only the Rust version of this plugin in Apollo Router collects these metrics. The implementation can be seen HERE. So it’s possible that if your plugin also collected these metrics like the Rust version of this plugin does, we would see them in Apollo Studio. 😉
@EmrysMyrddin Sorry, I forgot to submit the comments. 🤦 You should see them now. We don’t have an “enterprise plan”, but currently no longer available paid “team plan” which have many features that have only “enterprise plan” now, but not all of them. We also see metric sections for “Input Fields” and “Enum Values”, but these metrics are not collected now and we’re not sure if we really had these metrics before. Here is written that these metrics are available only for “enterprise plan”. After the weekend, I will try to deploy an old version of our GraphQL gateway built on the
@apollo/gatewaylibrary to make sure whether these metrics were previously available to us or not.@kroupacz we’ve released an alpha. Our alpha release bot has some permission problems so it didnt leave comment on the PR, but you can try the following alpha:
Thanks for helping out on this one!
Ok, thanks for confirming! We will be working on a fix, I’ll ping you as soon as I have something to show.