Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding 'mean', 'min' or 'percentiles' to Spring Boot 2 metrics?

I am using the new MicroMeter metrics in Spring Boot 2 version 2.0.0-RELEASE.

When publishing metrics over the /actuator/metrics/{metric.name} endpoint, i get the following:

For a DistributionSummary :

"name": "sources.ingestion.rate",
    "measurements": [
        {
           "statistic": "COUNT",
            "value": 5
        },
        {
            "statistic": "TOTAL",
            "value": 72169.44162067816
        },
        {
            "statistic": "MAX",
            "value": 17870.68010661754
        }
    ],
    "availableTags": []
}

For a Timer :

{
    "name": "sources.ingestion",
    "measurements": [
        {
            "statistic": "COUNT",
            "value": 5
        },
        {
            "statistic": "TOTAL_TIME",
            "value": 65.700878648
        },
        {
            "statistic": "MAX",
            "value": 22.661545322
        }
    ],
    "availableTags": []
}

Is it possible to enrich the measurements to add measures like mean, min, or percentiles ?

For percentiles i tried using .publishPercentiles(0.5, 0.95), but that doesn't reflect on the actuator endpoint.

like image 913
gotson Avatar asked Mar 08 '18 05:03

gotson


People also ask

What is Jvm_gc_memory_allocated_bytes_total?

The jvm_gc_memory_allocated_bytes_total metrics tells us about size increases of the young generation memory pool, whereas the jvm_gc_memory_promoted_bytes_total metric is for the old generation.

What is Http_server_requests_seconds_count?

For example, let's look at the metric http_server_requests_seconds_count , that defines the total number of requests received by an endpoint: # HELP http_server_requests_seconds.

What is MeterRegistry?

MeterRegistry In Micrometer, a MeterRegistry is the core component used for registering meters. We can iterate over the registry and further each meter's metrics to generate a time series in the backend with combinations of metrics and their dimension values. The simplest form of the registry is SimpleMeterRegistry.

Does spring boot provide Metrix?

Spring Boot provides a metrics endpoint that can be used diagnostically to examine the metrics collected by an application.


1 Answers

After discussions on Github, this is not currently implemented in Micrometer. More details directly on the Github Issues:

  • https://github.com/micrometer-metrics/micrometer/issues/488#issuecomment-373249656

  • https://github.com/spring-projects/spring-boot/issues/12433

  • https://github.com/micrometer-metrics/micrometer/issues/457

like image 142
gotson Avatar answered Oct 28 '22 01:10

gotson