0

I am implementing micrometer for our GraphQL service. One thing I am noticing is for @BatchMapping methods we are getting a DataFetcherObservationContext for each index in the incoming list.

Example: I am looking up a group of skus and on each of those skus I am looking up the brand information using a @BatchMapping so that I am making only 1 webservice call to our Brand microservice. However when I look at the observability trace metrics in grafana I am seeing an entry for each index(sku) in the list that I am giving to the @BatchMapping. Is there a way to combine these into a single DataFetcherObservationContext so I am not getting 1 for each Sku that I am ultimately returning?

See attached screenshot for what I see in grafana

I am using all of the OOB Observation contexts for graphql and have just started to dabble into creating my own custom implementation but hoping there is an easier way.

I am expecting this to be one single observation for the entire @BatchMapping not individual for each index of the parent list coming in.

Edit: One other thing I am seeing is stackOverFlowErrors if I try to look at the graphQLContext for the Observation object for all of the parentObservations. It seems to be doing so many that it overflows the buffer.

BWoz3288
  • 1
  • 1

0 Answers0