diff --git a/agent/config/builder.go b/agent/config/builder.go index efd8aa42f8..644bd0583a 100644 --- a/agent/config/builder.go +++ b/agent/config/builder.go @@ -514,9 +514,9 @@ func (b *Builder) Build() (rt RuntimeConfig, err error) { // Add a filter rule if needed for enabling the deprecated metric names enableDeprecatedNames := b.boolVal(c.Telemetry.EnableDeprecatedNames) if enableDeprecatedNames { - telemetryAllowedPrefixes = append(telemetryAllowedPrefixes, "consul.consul") + telemetryAllowedPrefixes = append(telemetryAllowedPrefixes, "consul.consul.") } else { - telemetryBlockedPrefixes = append(telemetryBlockedPrefixes, "consul.consul") + telemetryBlockedPrefixes = append(telemetryBlockedPrefixes, "consul.consul.") } // raft performance scaling diff --git a/agent/config/runtime_test.go b/agent/config/runtime_test.go index f1fdf1a158..78e7d577b1 100644 --- a/agent/config/runtime_test.go +++ b/agent/config/runtime_test.go @@ -1811,7 +1811,7 @@ func TestConfigFlagsAndEdgecases(t *testing.T) { patch: func(rt *RuntimeConfig) { rt.DataDir = dataDir rt.TelemetryAllowedPrefixes = []string{"foo"} - rt.TelemetryBlockedPrefixes = []string{"bar", "consul.consul"} + rt.TelemetryBlockedPrefixes = []string{"bar", "consul.consul."} }, warns: []string{`Filter rule must begin with either '+' or '-': "nix"`}, }, @@ -1829,7 +1829,7 @@ func TestConfigFlagsAndEdgecases(t *testing.T) { patch: func(rt *RuntimeConfig) { rt.DataDir = dataDir rt.TelemetryFilterDefault = false - rt.TelemetryAllowedPrefixes = []string{"consul.consul"} + rt.TelemetryAllowedPrefixes = []string{"consul.consul."} rt.TelemetryBlockedPrefixes = []string{} }, }, @@ -3633,7 +3633,7 @@ func TestFullConfig(t *testing.T) { TelemetryDogstatsdAddr: "0wSndumK", TelemetryDogstatsdTags: []string{"3N81zSUB", "Xtj8AnXZ"}, TelemetryFilterDefault: true, - TelemetryAllowedPrefixes: []string{"oJotS8XJ", "consul.consul"}, + TelemetryAllowedPrefixes: []string{"oJotS8XJ", "consul.consul."}, TelemetryBlockedPrefixes: []string{"cazlEhGn"}, TelemetryMetricsPrefix: "ftO6DySn", TelemetryPrometheusRetentionTime: 15 * time.Second,