I have a use case where we have to monitor the various stats of service where we are using Dropwizard metrics and pushing them to a server. But the metrics are reset if the service goes down and is restarted. The counters are reset to 0 which will affect monitoring since the values like percentiles or averages are affected.
How to deal with such a situation or use case?
What you are looking for is a data aggregator like Graphite or something similar. You would periodically post the metrics to Graphite. Dropwizard has a plug in for that https://dropwizard.github.io/metrics/3.1.0/manual/graphite/