You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add distribution summary metric for datafetcher calls
This commit adds a new `"graphql.request.datafetch.count"` distribution
summary metric for counting the number of data fetching calls per
request.
Closesgh-146
Copy file name to clipboardExpand all lines: graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/actuate/metrics/GraphQlMetricsInstrumentation.java
Copy file name to clipboardExpand all lines: spring-graphql-docs/src/docs/asciidoc/boot-starter.adoc
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -309,6 +309,20 @@ A `DataFetcher` metric timer is available at `/actuator/metrics/graphql.datafetc
309
309
|"SUCCESS", "ERROR"
310
310
|===
311
311
312
+
[[boot-graphql-metrics-datafetcher-summary]]
313
+
=== `DataFetcher` Distribution Summary
314
+
315
+
A https://micrometer.io/docs/concepts#_distribution_summaries[distribution summary]
316
+
that counts the number of non-trivial `DataFetcher` calls made per request.
317
+
This metric is useful for detecting "N+1" data fetching issues and consider batch loading;
318
+
it provides the `"TOTAL"` number of data fetcher calls made over the `"COUNT"` of recorded requests,
319
+
as well as the `"MAX"` calls made for a single request over the considered period.
320
+
321
+
The distribution is available at `/actuator/metrics/graphql.request.datafetch.count`.
322
+
323
+
More options are available for
324
+
{spring-boot-ref-docs}/application-properties.html#application-properties.actuator.management.metrics.distribution.maximum-expected-value[configuring distributions with application properties].
0 commit comments