GithubHelp home page GithubHelp logo

Comments (4)

lenin-jaganathan avatar lenin-jaganathan commented on August 17, 2024

Can a MeterFilter be used for this purpose?

I guess so. Here is an example of that. Only downside I see is, is that if there is a meter filter configured after your meter filter and adds these percentiles, then you will still see the lower percentiles.

from micrometer.

jonatan-ivanov avatar jonatan-ivanov commented on August 17, 2024

You can also do two things:

  • Not register any client-side percentiles and let users set them up (if you are using Spring Boot, there is a property for that that creates a MeterFilter)
  • You can use histograms so everyone can calculate whatever percentiles they want on the Prometheus server side (more expensive though)

You might also want to watch this talk and learn about why it is usually not a good idea to look at avg, median, lower percentiles in terms of latency: https://www.youtube.com/watch?v=lJ8ydIuPFeU

from micrometer.

murphyzlaw avatar murphyzlaw commented on August 17, 2024

Thanks for your reply!
Can you let me know the MeterFilter assocated SB property you're talking about.
If you can humor one more question - Our current proposed approach for pure Spring Boot is to define a config class that does Metrics.globalRegistry.config().meterFilter(percentileGuardMeterFilter) (engaging our filter), and look for @SpringBootApplication annotated classes or classes with main(), and annotate to @import this class. Do you see any overall issues with this approach. We want to target both @Timed kinds of metrics, and those that are directly created as custom metrics into the global registry.

from micrometer.

jonatan-ivanov avatar jonatan-ivanov commented on August 17, 2024

Can you let me know the MeterFilter assocated SB property you're talking about.

Go to the Spring Boot docs, browse the Common Application Properties and search on the page for the word percentiles. Or you the search box in the top left corner.

Our current proposed approach for pure Spring Boot is to define a config class that does Metrics.globalRegistry.config().meterFilter(percentileGuardMeterFilter) (engaging our filter), and look for @SpringBootApplication annotated classes or classes with main(), and annotate to @import this class. Do you see any overall issues with this approach.

Multiple issues:

  1. Do not use the global (you don't need to with Spring and it can make your life hard especially for testing)
  2. Read the docs about how to create your own auto-configuration, if I understand it correctly, what you are about to do is very fragile (and sorry for the better word, it's a big hack). Instead of this you can write your own auto-configuration that Spring Boot will load for you without modifying any classes.

from micrometer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.