Provide histogram informations for base Feign metric
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.8k
- Forks
- 1.9k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 41
Description
In my current project, we use a filter to change the micrometer Meter to expose histogram information to be able to calculate percentiles easily. Usually, this is very helpful to get a better understanding of latency.
Currently, we "update" the meter like this using a custom MeterFitler:
val sloBoundariesInNanos = Arrays.stream(sloBoundaries)
.mapToDouble { obj -> obj.toNanos().toDouble() }
.toArray()
val builder = DistributionStatisticConfig.builder()
.percentilesHistogram(true)
.serviceLevelObjectives(*sloBoundariesInNanos)
return builder.build()
.merge(config)
Unfortunately, this leads to code duplication in projects and teams. Ideally, this should be either activated by default, or it should be easy to configure.
My proposal would be to expose it by default. There is not a huge performance impact, and the metrics will give engineers more insights into latencies.
I looked already into the current open-source implementation and located the timer of interest created in MeteredInvocationHandleFactory.
I am not sure how this should impact DropWizard metrics. There, maybe the histogram type can be useful.
Once this is done, this might be also interesting for other metrics like client metrics.
Looking forward to some feedback. I am also happy to contribute in case of no one started yet, but want to collect feedback before investing time.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the timer creation in MeteredInvocationHandleFactory and trace how the base Feign metric is configured. Compare the proposed histogram and percentile settings with the existing MeterFilter approach, and investigate how DropWizard metrics should be affected. Done means an agreed default or configuration path for histogram information, with the impact on related client metrics clarified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100