Spring Boot 2自定义指标http.server.requests,每秒请求数

时间:2019-06-20 16:10:54

标签: java spring-boot spring-mvc metrics

我正在使用Spring Boot 2,尤其是我需要在http://localhost:8080/actuator/metrics/http.server.requests下添加新的度量 现在只有默认测量值

{
"name": "http.server.requests",
"measurements": [
    {
        "statistic": "COUNT",
        "value": 96.0
    },
    {
        "statistic": "TOTAL_TIME",
        "value": 3.693920977
    },
    {
        "statistic": "MAX",
        "value": 0.0
    }
],
"availableTags": [
    {
        "tag": "exception",
        "values": [
            "None"
        ]
    },
    {
        "tag": "method",
        "values": [
            "DELETE",
            "GET"
        ]
    },
    {
        "tag": "uri",
        "values": [
            "root",
            "/swagger-resources/configuration/ui",
            "/swagger-resources/configuration/security",
            "/webjars/**",
            "/swagger-resources",
            "/myMicroservice/{appId}/delete/{operationId}/",
            "/**",
            "/"
        ]
    },
    {
        "tag": "status",
        "values": [
            "404",
            "200"
        ]
    }
]

}

我需要添加一个测量值(正在测量),该测量值计算每秒HTTP请求的数量,但是我在互联网上找不到类似的东西。

0 个答案:

没有答案