micrometer icon indicating copy to clipboard operation
micrometer copied to clipboard

Allow Timer implementation to provide their Histogram to AbstractTimer

Open bogdandrutu opened this issue 3 years ago • 1 comments

This PR adds a new protected constructor to AbstractTimer that accepts an externally created Histogram. The usefulness of this API is proven by changing 2 implementation Prometheus and OTLP to use the new API.

For OtlpTimer to benefit more would require a change to CumulativeTimer as well (not sure if it is worth it since OtlpTimer will need to support delta, so will most likely needs it's own count/total/max), which I did not want to do in this PR, since the benefit of providing the Histogram is already visible.

This simplifies a lot the logic of overwriting what implementation of the Histogram to use in different implementations, and removes duplicate logic of replacing the fixed bucket histogram implementation.

Signed-off-by: Bogdan Drutu [email protected]

bogdandrutu avatar Aug 10 '22 17:08 bogdandrutu

Wrong japicmp report??? The super class still has it:

Comparing binary compatibility of  against 
***! MODIFIED CLASS: PUBLIC io.micrometer.prometheus.PrometheusTimer  (not serializable)
	===  CLASS FILE FORMAT VERSION: 52.0 <- 52.0
	===  UNCHANGED SUPERCLASS: n.a.
	---! REMOVED METHOD: PUBLIC(-) io.micrometer.core.instrument.distribution.HistogramSnapshot takeSnapshot()

bogdandrutu avatar Aug 10 '22 22:08 bogdandrutu

There were a few changes around this since this PR was opened: AbstractTimer now has the same ctor that can accept a Histogram (also the OTLP registry now supports delta not only cumulative). Can this be closed?

jonatan-ivanov avatar Dec 13 '23 12:12 jonatan-ivanov

If you would like us to look at this PR, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

github-actions[bot] avatar Dec 21 '23 01:12 github-actions[bot]

Closing due to lack of requested feedback. If you would like us to look at this, please provide the requested information and we will re-open.

github-actions[bot] avatar Jan 02 '24 10:01 github-actions[bot]