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.

Closes gh-146
This commit is contained in:
Brian Clozel
2021-09-22 16:53:08 +02:00
parent 74ba9061d5
commit 552c4f72d0
2 changed files with 36 additions and 2 deletions

View File

@@ -309,6 +309,20 @@ A `DataFetcher` metric timer is available at `/actuator/metrics/graphql.datafetc
|"SUCCESS", "ERROR"
|===
[[boot-graphql-metrics-datafetcher-summary]]
=== `DataFetcher` Distribution Summary
A https://micrometer.io/docs/concepts#_distribution_summaries[distribution summary]
that counts the number of non-trivial `DataFetcher` calls made per request.
This metric is useful for detecting "N+1" data fetching issues and consider batch loading;
it provides the `"TOTAL"` number of data fetcher calls made over the `"COUNT"` of recorded requests,
as well as the `"MAX"` calls made for a single request over the considered period.
The distribution is available at `/actuator/metrics/graphql.request.datafetch.count`.
More options are available for
{spring-boot-ref-docs}/application-properties.html#application-properties.actuator.management.metrics.distribution.maximum-expected-value[configuring distributions with application properties].
[[boot-graphql-metrics-error-counter]]
=== Error Counter