Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics #12

Closed
spencergibb opened this issue Jan 21, 2017 · 5 comments
Closed

Metrics #12

spencergibb opened this issue Jan 21, 2017 · 5 comments

Comments

@spencergibb
Copy link
Member

Determine what metrics could be useful and define a strategy for exporting them using boots metrics apis

@mathieufortin01
Copy link
Contributor

As long as a MeterRegistry is available I guess the process of exporting the metrics is delegated to micrometer ?, so no problem there.

Since a filter has access to both request and response, I constructed a simple metrics gateway filter which counts/clocks the requests and exports to Cloudwatch. I dont know if it is the way to go but this works well.

It would be nice to have a configurable metrics filter where different metrics could be added (along with tags/dimensions) mostly from the configuration file only.

One thing I'm struggling with though, is how to handle metrics for "Variable Subsitution" URLs, without duplicating all URLs definitions of the underlying services in the gateway ? I would like 1 metric for GET /users/{id}, not 1 for each user id received (/users/1, /users/2, etc).

@spencergibb
Copy link
Member Author

@mathieufortin01 url's are not a good thing to use since routes can be matched by anything in the request, such as headers, host, & parameters, not just path. The only thing I can think of that would be useful is the route id. This use case calls for descriptive route id's. /cc @jkschneider

@spencergibb
Copy link
Member Author

@mathieufortin01 mind sharing the filter you came up with?

@spencergibb spencergibb added this to To do in Finchley.RELEASE via automation May 31, 2018
@spencergibb
Copy link
Member Author

By default, we get normal webflux metrics.

For this route I get the following

spencer@:~% http ":8080/actuator/metrics/http.server.requests?tag=uri:/get"
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/vnd.spring-boot.actuator.v2+json;charset=UTF-8
Expires: 0
Pragma: no-cache
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1 ; mode=block
transfer-encoding: chunked

{
    "availableTags": [
        {
            "tag": "exception",
            "values": [
                "none"
            ]
        },
        {
            "tag": "method",
            "values": [
                "GET"
            ]
        },
        {
            "tag": "status",
            "values": [
                "200"
            ]
        }
    ],
    "measurements": [
        {
            "statistic": "COUNT",
            "value": 2.0
        },
        {
            "statistic": "TOTAL_TIME",
            "value": 5.001693461
        },
        {
            "statistic": "MAX",
            "value": 4.94594301
        }
    ],
    "name": "http.server.requests"
}

If we want more specific metrics, we can address those in a future release.

@ryanjbaxter
Copy link
Contributor

Closed via 972c371

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants