micrometer-metrics / micrometer

An application observability facade for the most popular observability tools. Think SLF4J, but for observability.
https://micrometer.io
Apache License 2.0
4.46k stars 986 forks source link

Improvements to LongTaskTimer (max, percentiles, histograms) #2005

Closed jkschneider closed 4 years ago

jkschneider commented 4 years ago

Currently a LongTaskTimer just ships two statistics: active task count and total duration of all active tasks. So when there is more than on active task, you can get an average of the durations of all active tasks, but there is no way to tell that one has been running for a really long time and others just started.

This improves LongTaskTimer to include:

LongTaskTimer.Builder will start with a minimum expected value of 2 minutes and maximum expected value of 2 hours, both configurable as for Timer.

MeterRegistry now defines a method for creating new long task timers that registry implementations should implement instead of newLongTaskTimer(Meter.Id id) (which has been deprecated):

LongTaskTimer newLongTaskTimer(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig)

Existing registries implementing the old method will be backwards compatible, albeit without supporting percentiles, histograms, and service level objective boundaries. Any such configuration to LongTaskTimer.Builder will be a no-op against such registries.

jkschneider commented 4 years ago

@mattiasflodin Can you point out where the missing Javadoc is so it can be corrected?

image

mattiasflodin commented 4 years ago

I apologize for the noise. I realized after making this comment that IntelliJ had served me an auto-decompiled class file that doesn't contain the javadoc. Went here and deleted my comment but after updating the page I found you had already responded.

jkschneider commented 4 years ago

@mattiasflodin No worries! I do tend to be a bit sloppy about Javadocs from time to time as @izeye well knows ;)