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

Installs a wrapper around HTTP endpoints that generate metrics. #2256

Merged
merged 1 commit into from
Aug 9, 2016

Conversation

slackpad
Copy link
Contributor

@slackpad slackpad commented Aug 9, 2016

This generates useful telemetry for assessing the health of clients talking to Consul over HTTP. It rolls up telemetry about endpoints by using this basic structure:

consul.consul.http.<verb>.<parts>

<verb> is the HTTP verb, and <parts> is based on the path that is registered for each endpoint. It won't contain any specific parts of the path like service names or key names. For paths that have a variable part, a _ placeholder will be added.

Here's some example telemetry with this patch active:

[2016-08-09 15:40:00 -0700 PDT][S] 'consul.consul.http.GET.v1.internal.ui.nodes': Count: 1 Sum: 0.562 LastUpdated: 2016-08-09 15:40:08.189480734 -0700 PDT
[2016-08-09 15:40:00 -0700 PDT][S] 'consul.consul.http.GET.v1.coordinate.nodes': Count: 1 Sum: 0.174 LastUpdated: 2016-08-09 15:40:08.191369142 -0700 PDT
[2016-08-09 15:40:00 -0700 PDT][S] 'consul.consul.http.GET.v1.internal.ui.services': Count: 1 Sum: 0.143 LastUpdated: 2016-08-09 15:40:08.210909642 -0700 PDT
[2016-08-09 15:40:00 -0700 PDT][S] 'consul.consul.http.GET.v1.agent.services': Count: 1 Sum: 0.121 LastUpdated: 2016-08-09 15:40:01.398246693 -0700 PDT
[2016-08-09 15:40:00 -0700 PDT][S] 'consul.consul.http.GET.v1.health.service._': Count: 1 Sum: 0.236 LastUpdated: 2016-08-09 15:40:09.441753193 -0700 PDT
[2016-08-09 15:40:10 -0700 PDT][S] '[2016-08-09 15:40:00 -0700 PDT][S] 'consul.consul.http.GET.v1.internal.ui.nodes': Count: 1 Sum: 0.562 LastUpdated: 2016-08-09 15:40:08.189480734 -0700 PDT
[2016-08-09 15:40:00 -0700 PDT][S] 'consul.consul.http.GET.v1.coordinate.nodes': Count: 1 Sum: 0.174 LastUpdated: 2016-08-09 15:40:08.191369142 -0700 PDT
[2016-08-09 15:40:00 -0700 PDT][S] 'consul.consul.http.GET.v1.internal.ui.services': Count: 1 Sum: 0.143 LastUpdated: 2016-08-09 15:40:08.210909642 -0700 PDT
[2016-08-09 15:40:00 -0700 PDT][S] 'consul.consul.http.GET.v1.agent.services': Count: 1 Sum: 0.121 LastUpdated: 2016-08-09 15:40:01.398246693 -0700 PDT
[2016-08-09 15:40:00 -0700 PDT][S] 'consul.consul.http.GET.v1.health.service._': Count: 1 Sum: 0.236 LastUpdated: 2016-08-09 15:40:09.441753193 -0700 PDT
[2016-08-09 15:40:10 -0700 PDT][S] 'consul.consul.http.GET.v1.kv._': Count: 3 Min: 0.114 Mean: 0.150 Max: 0.179 Stddev: 0.033 Sum: 0.450 LastUpdated: 2016-08-09 15:40:19.244495412 -0700 PDT': Count: 3 Min: 0.114 Mean: 0.150 Max: 0.179 Stddev: 0.033 Sum: 0.450 LastUpdated: 2016-08-09 15:40:19.244495412 -0700 PDT

You can see the KV example, where we have consul.consul.http.GET.v1.kv._. This prevents leaking sensitive information and also prevents an explosion of telemetry.

@slackpad slackpad merged commit 3ddeae9 into master Aug 9, 2016
@slackpad slackpad deleted the f-http-metrics branch August 9, 2016 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant