-
Notifications
You must be signed in to change notification settings - Fork 314
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
Refine GraphQL metrics #19
Comments
We report metrics across a number of Java and Node.js apps. I'll share some of the things that we've done here that may be useful.
We also have a couple of teams that record a timer metric for each data fetcher execution. I think it would be important to avoid using query in the metric name when referring to the overall request. I believe the GraphQL spec uses the term request to describe the overall execution request to disambiguate from query operations. |
It may also be useful to record metrics that would reveal usage of deprecated schema elements in support of schema evolution. There's an RFC in the works that would provide a standard way to address elements in the schema: I expect a Counter tagged with the field coordinates of any deprecated field would get the job done. |
Thanks a lot @mcohen75 for your feedback. We've revisited the arrangement with a step in the right direction; we're not done processing your comments, but we'd like to collect some more feedback from various community members before implementing more advanced metrics. |
Now that #16 is done, we should work on refining the metrics and the associated tags.
Right now we're publishing a
"graphql.query"
timer metrics that's measuring the execution time of the query using aSimpleInstrumentation
. We're adding a"query"
tag with the actual query, and a"outcome"
tag describing the outcome of the query (success or error).There are quite a few things to refine here:
"query"
tag is not right, since it's publishing the raw query. Micrometer tags should be bounded and useful for building graphs. Unfortunately, the number of possible queries sent by clients are unbounded, and they can be very long, making it hard to use as a basis for graphs. Is there a way to derive useful information from the query without those downsides?"operation"
and"errors"
informations are not used as a tag. In general, what information could we use as tags?The text was updated successfully, but these errors were encountered: