envoy icon indicating copy to clipboard operation
envoy copied to clipboard

Unexpected metric names when cluster name contains dot

Open yuan-stripe opened this issue 7 years ago • 11 comments

Title: Unexpected metric names when cluster name contains dot

Description:

When cluster name contains dot, cluster-specific metric names are unexpected.

Repro steps:

Create a cluster with dots in its name, e.g. foo.example.com, and then look for cluster metrics like envoy.cluster.upstream_rq_xx

Expected:

The metric should be named envoy.cluster.upstream_rq_xx with tag envoy_cluster_name=foo.example.com

Actual:

The metric is named envoy.cluster.example.com.upstream_rq_xx with tag envoy_cluster_name=foo

yuan-stripe avatar Dec 06 '18 23:12 yuan-stripe

cc @jmarantz

mattklein123 avatar Dec 07 '18 18:12 mattklein123

Any chance we could just make it illegal to have dots in cluster names?

jmarantz avatar Dec 07 '18 19:12 jmarantz

From my perspective that's fine, but any time we try to do anything like this, someone complains. Might be worth it to try to gauge some additional opinions on this.

mattklein123 avatar Dec 07 '18 19:12 mattklein123

Any chance we could just make it illegal to have dots in cluster names?

I wouldn't want to have dots either, until I had to workaround #5238

yuan-stripe avatar Dec 07 '18 19:12 yuan-stripe

@yuan-stripe #5238 would be pretty trivial to fix/add. Do you want to do that?

mattklein123 avatar Dec 07 '18 19:12 mattklein123

Sure, I will take it.

yuan-stripe avatar Dec 07 '18 19:12 yuan-stripe

@yuan-stripe please let me know when you have a PR for #5238 ready. I’ll try to review it. Thanks!

dio avatar Dec 07 '18 21:12 dio

@mattklein123 @dio PR #5275 is submitted to add support for #5238

yuan-stripe avatar Dec 12 '18 05:12 yuan-stripe

@yuan-stripe got it. Thanks! I'll take a look.

dio avatar Dec 12 '18 06:12 dio

This seems like a dupe of #4357

bplotnick avatar Feb 19 '19 22:02 bplotnick

Confirmed, still the case with ver. 1.29.2. E.g. for the routing cluster name www.foo1.com, only the first part until dot, i.e. www, is reported as envoy_cluster_name. Whereas the part after the first dot is becoming a part of the name of the given metric, e.g. envoy_cluster_foo1_com_upstream_rq_total. For another cluster, www.foo2.com, also only the www is reported as envoy_cluster_name, which is quite misleading, because now two different clusters were reporting the same name, www. A workaround for us was to replace dots with underscores, e.g. www_foo1_com. Then the metric name is always e.g. envoy_cluster_upstream_rq_total, and envoy_cluster_name indicates the full cluster name, e.g. www_foo1_com.

wsy-cloud avatar May 10 '24 14:05 wsy-cloud