Skip to content

/metrics endpoint reports NaN values for micrometer histogram #11393

@manderson23

Description

@manderson23

I'm using Spring Boot 2.0 M7 with the default Micrometer registry and actuator endpoint.

I've created a Timer to measure latency as follows

Timer.builder(name)
     .publishPercentiles(0.5, 0.75, 0.95, 0.99)
     .tags(Arrays.asList(tags))
     .register(registry);

When this time is reported via the /actuator/metrics endpoint I only see NaN values.

For example, calling localhost:8000/actuator/metrics/latency is see

{
    "availableTags": [
        {
            "tag": "percentile",
            "values": [
                "0.99",
                "0.95",
                "0.5",
                "0.75"
            ]
        }
    ],
    "measurements": [
        {
            "statistic": "Value",
            "value": "NaN"
        },
        {
            "statistic": "Count",
            "value": 301.0
        },
        {
            "statistic": "TotalTime",
            "value": 3027000000.0
        },
        {
            "statistic": "Max",
            "value": 3027000000.0
        }
    ],
    "name": "latency"
}

And calling localhost:8000/actuator/metrics/latency?tag=percentile:0.5 I see

{
    "availableTags": [],
    "measurements": [
        {
            "statistic": "Value",
            "value": "NaN"
        }
    ],
    "name": "latency"
}

If I call the Timer within my code I see that the values and percentiles are correctly recorded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions