How to see GraphQL specific metrics? #1227
-
|
Hello again, I was wondering how can one see any GraphQL specific metrics on the server? For example to be able to see a number of requests per query/mutation/subscription and per fields/params? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Hello 👋 e.g. |
Beta Was this translation helpful? Give feedback.
Hello 👋
Similar to that
graphql-java-kickstartproject, we also rely ongraphql-javafor query execution logic. This means that you can utilize Instrumentation mechanism to "observe the execution of a query and also change the runtime behaviour".e.g.
graphql-java-kickstartproject provideshttps://github.com/graphql-java-kickstart/graphql-spring-boot/blob/master/graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/autoconfigure/web/servlet/metrics/MetricsInstrumentation.java and you could create something similar in your repo. If you are using
graphql-kotlin-spring-serverthen if you create instrumentation bean it will be automatically picked up by the autoconfiguration (htt…