From 244265ca19e6d8574e8d328080005294fb6a88fc Mon Sep 17 00:00:00 2001 From: josh Date: Tue, 27 Jun 2023 12:36:26 -0400 Subject: [PATCH 1/3] Add emit_tags_as_labels setting to envoy metrics service cfg Signed-off-by: josh --- internal/bootstrap/bootstrap_config.go | 3 ++- internal/bootstrap/bootstrap_config_test.go | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/bootstrap/bootstrap_config.go b/internal/bootstrap/bootstrap_config.go index faf7b404..abfcf1b7 100644 --- a/internal/bootstrap/bootstrap_config.go +++ b/internal/bootstrap/bootstrap_config.go @@ -846,7 +846,8 @@ func appendTelemetryCollectorConfig(args *BootstrapTplArgs, telemetryCollectorBi "envoy_grpc": { "cluster_name": "consul_telemetry_collector_loopback" } - } + }, + "emit_tags_as_labels": true } }` diff --git a/internal/bootstrap/bootstrap_config_test.go b/internal/bootstrap/bootstrap_config_test.go index 53582677..fb070c51 100644 --- a/internal/bootstrap/bootstrap_config_test.go +++ b/internal/bootstrap/bootstrap_config_test.go @@ -540,7 +540,8 @@ const ( "envoy_grpc": { "cluster_name": "consul_telemetry_collector_loopback" } - } + }, + "emit_tags_as_labels": true } }` @@ -639,7 +640,8 @@ func TestBootstrapConfig_ConfigureArgs(t *testing.T) { "envoy_grpc": { "cluster_name": "consul_telemetry_collector_loopback" } - } + }, + "emit_tags_as_labels": true } }`, StaticClustersJSON: `{ From 67aa49b7557008ebbbce406fde0b424a2913167d Mon Sep 17 00:00:00 2001 From: josh Date: Tue, 27 Jun 2023 12:37:43 -0400 Subject: [PATCH 2/3] Add changelog Signed-off-by: josh --- .changelog/184.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/184.txt diff --git a/.changelog/184.txt b/.changelog/184.txt new file mode 100644 index 00000000..f50fcae0 --- /dev/null +++ b/.changelog/184.txt @@ -0,0 +1,3 @@ +```release-note:improvement +connect: Add capture group labels from Envoy cluster FQDNs to Envoy exported metric labels +``` \ No newline at end of file From 955e2c65102ec1e7d567f6ade3835db31070bcfa Mon Sep 17 00:00:00 2001 From: josh Date: Tue, 27 Jun 2023 12:43:13 -0400 Subject: [PATCH 3/3] Fix golden Signed-off-by: josh --- pkg/consuldp/testdata/TestBootstrapConfig/hcp-metrics.golden | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/consuldp/testdata/TestBootstrapConfig/hcp-metrics.golden b/pkg/consuldp/testdata/TestBootstrapConfig/hcp-metrics.golden index 52f70457..c37671de 100644 --- a/pkg/consuldp/testdata/TestBootstrapConfig/hcp-metrics.golden +++ b/pkg/consuldp/testdata/TestBootstrapConfig/hcp-metrics.golden @@ -90,7 +90,8 @@ "envoy_grpc": { "cluster_name": "consul_telemetry_collector_loopback" } - } + }, + "emit_tags_as_labels": true } } ],