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

xds: improve how envoy metrics are emitted #6312

Merged
merged 4 commits into from Aug 16, 2019
Merged

Conversation

rboyer
Copy link
Member

@rboyer rboyer commented Aug 12, 2019

Since generated envoy clusters all are named using (mostly) SNI syntax
we can have envoy read the various fields out of that structure and emit
it as stats labels to the various telemetry backends.

I changed the delimiter for the 'customization hash' from ':' to '~'
because ':' is always reencoded by envoy as '_' when generating metrics
keys.

Fixes #6227

An updated grafana/prometheus dashboard for connect is available here: https://gist.github.com/rboyer/f8a3a35feec3a27010192bda5796769e

@rboyer rboyer added the theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies label Aug 12, 2019
@rboyer rboyer added this to the 1.6.0-final milestone Aug 12, 2019
@rboyer rboyer requested a review from a team August 12, 2019 20:22
@rboyer rboyer self-assigned this Aug 12, 2019
Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

One bikeshed on label name but not a big deal.

It would be awesome if you have this running locally if you could paste some sample metrics from the prometheus output so we can get a feel for the way the labelling comes out (I looked at the grafana dash so I have a good idea but would be nice to see the real thing as a sanity check).

Also, did you look at what happens to statsd metrics with this config? I'm not super clear on that but maybe could use the existing statsd integration test and make it fail and dump the raw statsd metrics sent or something?

command/connect/envoy/testdata/defaults.golden Outdated Show resolved Hide resolved
Since generated envoy clusters all are named using (mostly) SNI syntax
we can have envoy read the various fields out of that structure and emit
it as stats labels to the various telemetry backends.

I changed the delimiter for the 'customization hash' from ':' to '~'
because ':' is always reencoded by envoy as '_' when generating metrics
keys.
@rboyer
Copy link
Member Author

rboyer commented Aug 14, 2019

I scraped the /metrics endpoints on a sidecar proxy and a mesh gateway proxy. I also force crashed the dogstatsd-udp and statsd-udp integration tests to extract their logs:

https://gist.github.com/rboyer/9b880e0fb29c5f2f215741bb9fddc707

The stats extraction, understandably, does nothing to the plain statsd output because there's no place in the protocol IIRC to send tags. The dogstatsd one however does what you'd expect.

@banks
Copy link
Member

banks commented Aug 14, 2019

envoy.cluster.membership_change:1|c|#foo:bar,local_cluster:s1,envoy.cluster_name:1a47f6e1~s2,consul.custom_hash:1a47f6e1,consul.service_subset:,consul.service:s2,consul.namespace:default,consul.datacenter:primary,consul.routing_type:internal,consul.trust_domain:d245a980-5b33-d9ee-839a-2c9860a74e62,consul.target:1a47f6e1~s2.default.primary,consul.full_target:1a47f6e1~s2.default.primary.internal.d245a980-5b33-d9ee-839a-2c9860a74e62

I assume it's intentional that envoy.cluster_name:1a47f6e1~s2 remains the prefixed name? It think this is reasonable as it allows distinguishing the cluster name if you care while using consul.service_name if you'd really just want to see which Consul service is being addressed.

👍 Thanks RB this looks great to me.

Copy link
Member

@mkeeler mkeeler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I just have the one question about some regexes.

command/connect/envoy/bootstrap_config.go Outdated Show resolved Hide resolved
@rboyer rboyer requested a review from mkeeler August 15, 2019 01:34
Copy link
Member

@mkeeler mkeeler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

@rboyer rboyer merged commit 7220725 into release/1-6 Aug 16, 2019
@banks banks deleted the improve-envoy-stats branch August 16, 2019 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants