From a3e9ac58402dc484970b9e3bd1e36d2ec0a2797c Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Wed, 4 Oct 2017 17:27:57 -0700 Subject: [PATCH] Add a test for legacy metrics with a whitelist filter --- agent/config/runtime_test.go | 22 +++++++++++++++++++-- website/source/docs/agent/telemetry.html.md | 18 ----------------- 2 files changed, 20 insertions(+), 20 deletions(-) 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. events / interval counter - - `consul.dns.domain_query.` - This tracks how long it takes to service forward DNS lookups on the given Consul agent. - ms - timer - - - `consul.dns.ptr_query.` - This tracks how long it takes to service reverse DNS lookups on the given Consul agent. - ms - timer - - - `consul.dns.stale_queries` - Available in Consul 0.7.1 and later, this increments when an agent serves a DNS query based on information from a server that is more than 5 seconds out of date. - queries - counter - `consul.http..` This tracks how long it takes to service the given HTTP request for the given verb and path. Paths do not include details like service or key names, for these an underscore will be present as a placeholder (eg. `consul.http.GET.v1.kv._`)