5. prometheus metrics types explained | 4 types - Counter Gauge Summary Histogram

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey hello welcome back as in last video we saw how to expose matrix using spring boot activator and as you can see pro prometheus matrix is a human readable you can able to read it right it's okay let us try to understand what is in it it has a type and help attribute so help is like a description which gives you a hint about what is the matrix about and type is actually matrix type which can one of the counter gauge or summary or a histogram now you may be thinking what to use when let's discuss this also so counter if you want how many times x happened but that value can only increase in your application meaning counter is useful when something increased and not decrease like number of requests served task completed or errors like in this exposed matrix we will see the counter as you can see here it is how many times error level event made it to the locks as we know this value can only increase in your application that it will not go down right one warn or debug error trace info it will go only up in our application so you can use a counter this is one of example when to use counter now let's check gauche so gauge if you want what is the current value of x now it is like a single numerical value that can arbitrarily go up or a down at a certain moment of the time so let's check for the gauge so let's try to understand with the example so here you can see this is of a type gauge and in the description it is saying the current number of live demand threads so here you can see the in our application this demand thread will go up and down meaning increase or a decrease based on our request right so that's the reason we can use gauge here we cannot use counter because in counter it can only be increased not decrease okay now let's take example of a summary where to use summary if you want to know how long something took or how big something was then use summary usually it is thing like a request duration or a response size it's difficult to digest no problem let's take example here so this is a summary example here you can see in the help it's http server request seconds and if offer type summary so this is the best name so here you can see it has a many lines you can see it's a base name count base name sum this is the best name so you can see base name count and base name sum so the count is the count of event that has been observed and this is exposed as a base name count and total sum or sum is observed value and it is exposed as a base name underscore sum so what is this so this is like a get request it we are getting success 200 for this uri hello we exposed in last video hello endpoint so hello it's it's called three times so this is count is the count of how many times this uri called so it's a three and it's a per seconds it's a sum of how much time it took so it's a sum of all so it's 0.02 seconds so that means count shows the number of time event observed and sum shows some of the times taken by that event and the last one last one is a histogram it is the same as a summary only thing is it count observation in a bucket we will see histogram in a future videos so keep watching and in next video we will expose a prometheus matrix without activator in last video we use actuator and next video we can use uh we can expose a promises matrix without activator meaning we will see if there is problem in activator then what is the another way to expose from this matrix so see you in next video
Info
Channel: Namaste Java
Views: 9,021
Rating: undefined out of 5
Keywords: The 4 types of Prometheus Metrics, Types of Prometheus metrics explained, 4 types - Counter Gauge Summary Histogram, prometheus metrics tutorial, prometheus metrics, prometheus metric types, prometheus metrics types, prometheus metrics explained, Prometheus metrics example, prometheus metrics spring boot, namaste java, prometheus custom metrics, prometheus custom metrics spring boot, prometheus metrics documentation
Id: SI9kBf_03gk
Channel Id: undefined
Length: 4min 12sec (252 seconds)
Published: Tue Nov 10 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.