1
votes

I am developing a Spring Boot 2 Application with Micrometer for reporting Metrics. One of the functionality is sending large amounts of Data to a Restful Web Service.

I would like to measure the amount of data sent and the time taken to complete the request. Using the Timer metric gives me the time as well as the number of times the request is made. But how can I include the bytes transferred also in the same metric? My Grafana dashboard is supposed to plat the amount of data transferred and the time is taken to accomplish it.

I looked at Counter and Gauges but they don't look like the right fit for what I am trying to do. Is there a way to add a custom field to the Grafana metric?

1
For duration you don't need to setup your own Timer, spring-boot-actuator already provides a MetricsRestTemplateCustomizer that adds a Timer to your RestTemplates. - Erik P

1 Answers

0
votes

You'd use a DistributionSummaryfor that. See here and here.

Regarding instrumentation, you'd have to currently instrument your Controllers manually or wire an Aspect around them.

IIRC at least the Tomcat metrics provide some data-in and data-out metrics, but not down to the path level.