diff --git a/agent/config/runtime_test.go b/agent/config/runtime_test.go index 20fcd2a9d9..f8b2e2d406 100644 --- a/agent/config/runtime_test.go +++ b/agent/config/runtime_test.go @@ -1658,11 +1658,29 @@ func TestConfigFlagsAndEdgecases(t *testing.T) { `}, patch: func(rt *RuntimeConfig) { rt.DataDir = dataDir - rt.TelemetryAllowedPrefixes = append([]string{"foo"}, rt.TelemetryAllowedPrefixes...) - rt.TelemetryBlockedPrefixes = append([]string{"bar"}, rt.TelemetryBlockedPrefixes...) + rt.TelemetryAllowedPrefixes = []string{"foo"} + rt.TelemetryBlockedPrefixes = []string{"bar", "consul.consul"} }, warns: []string{`Filter rule must begin with either '+' or '-': "nix"`}, }, + { + desc: "telemetry.enable_deprecated_names adds allow rule for whitelist", + flags: []string{ + `-data-dir=` + dataDir, + }, + json: []string{`{ + "telemetry": { "enable_deprecated_names": true, "filter_default": false } + }`}, + hcl: []string{` + telemetry = { enable_deprecated_names = true filter_default = false } + `}, + patch: func(rt *RuntimeConfig) { + rt.DataDir = dataDir + rt.TelemetryFilterDefault = false + rt.TelemetryAllowedPrefixes = []string{"consul.consul"} + rt.TelemetryBlockedPrefixes = []string{} + }, + }, { desc: "encrypt has invalid key", flags: []string{ diff --git a/website/source/docs/agent/telemetry.html.md b/website/source/docs/agent/telemetry.html.md index a0ec38ad19..c3efadb749 100644 --- a/website/source/docs/agent/telemetry.html.md +++ b/website/source/docs/agent/telemetry.html.md @@ -447,24 +447,6 @@ These metrics give insight into the health of the cluster as a whole.