From 6461087c25525a304a3d40a1a59552c8a65d981a Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Mon, 7 May 2018 15:51:05 -0700 Subject: [PATCH 1/7] Remove support for CheckID field in service check definitions --- agent/config/config.go | 12 +++++------- agent/config/runtime_test.go | 12 ++++++------ website/source/docs/agent/checks.html.md | 5 ----- website/source/docs/agent/services.html.md | 5 ----- 4 files changed, 11 insertions(+), 23 deletions(-) diff --git a/agent/config/config.go b/agent/config/config.go index 20db0cd282..8d4aa62552 100644 --- a/agent/config/config.go +++ b/agent/config/config.go @@ -94,14 +94,12 @@ func Parse(data string, format string) (c Config, err error) { // CamelCase and snake_case. Since changing either format would break // existing setups we have to support both and slowly transition to one of // the formats. Also, there is at least one case where we use the "wrong" - // key and want to map that to the new key to support deprecation - // (`check.id` vs `service.check.CheckID`) See [GH-3179]. TranslateKeys - // maps potentially CamelCased values to the snake_case that is used in the - // config file parser. If both the CamelCase and snake_case values are set, - // the snake_case value is used and the other value is discarded. + // key and want to map that to the new key to support deprecation - + // see [GH-3179]. TranslateKeys maps potentially CamelCased values to the + // snake_case that is used in the config file parser. If both the CamelCase + // and snake_case values are set the snake_case value is used and the other + // value is discarded. TranslateKeys(m, map[string]string{ - "check_id": "id", - "checkid": "id", "deregistercriticalserviceafter": "deregister_critical_service_after", "dockercontainerid": "docker_container_id", "enabletagoverride": "enable_tag_override", diff --git a/agent/config/runtime_test.go b/agent/config/runtime_test.go index 78e7d577b1..9e7463a759 100644 --- a/agent/config/runtime_test.go +++ b/agent/config/runtime_test.go @@ -1988,7 +1988,7 @@ func TestConfigFlagsAndEdgecases(t *testing.T) { "port": 80, "EnableTagOverride": true, "check": { - "CheckID": "x", + "id": "x", "name": "y", "DockerContainerID": "z", "DeregisterCriticalServiceAfter": "10s", @@ -2003,7 +2003,7 @@ func TestConfigFlagsAndEdgecases(t *testing.T) { port = 80 EnableTagOverride = true check = { - CheckID = "x" + id = "x" name = "y" DockerContainerID = "z" DeregisterCriticalServiceAfter = "10s" @@ -2445,7 +2445,7 @@ func TestFullConfig(t *testing.T) { "port": 24237, "enable_tag_override": true, "check": { - "check_id": "RMi85Dv8", + "id": "RMi85Dv8", "name": "iehanzuq", "status": "rCvn53TH", "notes": "fti5lfF3", @@ -2523,7 +2523,7 @@ func TestFullConfig(t *testing.T) { "port": 72219, "enable_tag_override": true, "check": { - "check_id": "qmfeO5if", + "id": "qmfeO5if", "name": "atDGP7n5", "status": "pDQKEhWL", "notes": "Yt8EDLev", @@ -2886,7 +2886,7 @@ func TestFullConfig(t *testing.T) { port = 24237 enable_tag_override = true check = { - check_id = "RMi85Dv8" + id = "RMi85Dv8" name = "iehanzuq" status = "rCvn53TH" notes = "fti5lfF3" @@ -2964,7 +2964,7 @@ func TestFullConfig(t *testing.T) { port = 72219 enable_tag_override = true check = { - check_id = "qmfeO5if" + id = "qmfeO5if" name = "atDGP7n5" status = "pDQKEhWL" notes = "Yt8EDLev" diff --git a/website/source/docs/agent/checks.html.md b/website/source/docs/agent/checks.html.md index a612d8a92a..42065e2799 100644 --- a/website/source/docs/agent/checks.html.md +++ b/website/source/docs/agent/checks.html.md @@ -197,11 +197,6 @@ and the check is embedded within a service definition a unique check id is generated. Otherwise, `id` will be set to `name`. If names might conflict, unique IDs should be provided. --> **Note:** Consul 0.9.3 and before require the optional check ID for a check - that is embedded in a service definition to be configured via the `CheckID` - field. Consul 1.0 accepts both `id` and `CheckID` but the latter is - deprecated and will be removed in Consul 1.1. - The `notes` field is opaque to Consul but can be used to provide a human-readable description of the current state of the check. With a script check, the field is set to any output generated by the script. Similarly, an external process updating diff --git a/website/source/docs/agent/services.html.md b/website/source/docs/agent/services.html.md index d01b85a0bf..0cd13740e1 100644 --- a/website/source/docs/agent/services.html.md +++ b/website/source/docs/agent/services.html.md @@ -90,11 +90,6 @@ from `1`. -> **Note:** There is more information about [checks here](/docs/agent/checks.html). --> **Note:** Consul 0.9.3 and before require the optional check ID for a check - that is embedded in a service definition to be configured via the `CheckID` - field. Consul 1.0 accepts both `id` and `CheckID` but the latter is - deprecated and will be removed in Consul 1.1. - The `enable_tag_override` can optionally be specified to disable the anti-entropy feature for this service. If `enable_tag_override` is set to `TRUE` then external agents can update this service in the From cc214d45b653e0e3e04830531d170483956dbb02 Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Mon, 7 May 2018 16:19:13 -0700 Subject: [PATCH 2/7] Remove support for EnableTagOverride in config files --- agent/config/config.go | 1 - agent/config/runtime_test.go | 4 ++-- website/source/docs/agent/services.html.md | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/agent/config/config.go b/agent/config/config.go index 8d4aa62552..5447f95c4a 100644 --- a/agent/config/config.go +++ b/agent/config/config.go @@ -102,7 +102,6 @@ func Parse(data string, format string) (c Config, err error) { TranslateKeys(m, map[string]string{ "deregistercriticalserviceafter": "deregister_critical_service_after", "dockercontainerid": "docker_container_id", - "enabletagoverride": "enable_tag_override", "scriptargs": "args", "serviceid": "service_id", "tlsskipverify": "tls_skip_verify", diff --git a/agent/config/runtime_test.go b/agent/config/runtime_test.go index 9e7463a759..55a3c4d504 100644 --- a/agent/config/runtime_test.go +++ b/agent/config/runtime_test.go @@ -1986,7 +1986,7 @@ func TestConfigFlagsAndEdgecases(t *testing.T) { "service": { "name": "a", "port": 80, - "EnableTagOverride": true, + "enable_tag_override": true, "check": { "id": "x", "name": "y", @@ -2001,7 +2001,7 @@ func TestConfigFlagsAndEdgecases(t *testing.T) { `service = { name = "a" port = 80 - EnableTagOverride = true + enable_tag_override = true check = { id = "x" name = "y" diff --git a/website/source/docs/agent/services.html.md b/website/source/docs/agent/services.html.md index 0cd13740e1..4cb6873a09 100644 --- a/website/source/docs/agent/services.html.md +++ b/website/source/docs/agent/services.html.md @@ -48,7 +48,7 @@ unique IDs should be provided. For Consul 0.9.3 and earlier you need to use `enableTagOverride`. Consul 1.0 supports both `enable_tag_override` and `enableTagOverride` but the latter is -deprecated and will be removed in Consul 1.1. +deprecated and has been removed in Consul 1.1. The `tags` property is a list of values that are opaque to Consul but can be used to distinguish between `primary` or `secondary` nodes, @@ -115,7 +115,7 @@ syncs](/docs/internals/anti-entropy.html) for more info. For Consul 0.9.3 and earlier you need to use `enableTagOverride`. Consul 1.0 supports both `enable_tag_override` and `enableTagOverride` but the latter is -deprecated and will be removed in Consul 1.1. +deprecated and has been removed as of Consul 1.1. To configure a service, either provide it as a `-config-file` option to the agent or place it inside the `-config-dir` of the agent. The file From b73323aa429f6edcfdff3b951774ca6f296f2bc5 Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Tue, 8 May 2018 15:31:53 -0700 Subject: [PATCH 3/7] Remove the script field from checks in favor of args --- agent/agent.go | 12 ------- agent/agent_endpoint_test.go | 8 ----- agent/agent_test.go | 30 ++++++++-------- agent/config/builder.go | 1 - agent/config/config.go | 1 - agent/config/runtime_test.go | 41 ++++------------------ agent/structs/check_definition.go | 2 -- agent/structs/check_definition_test.go | 4 +-- agent/structs/check_type.go | 3 +- agent/structs/service_definition_test.go | 8 ++--- api/agent.go | 1 - api/agent_test.go | 2 +- website/source/docs/agent/checks.html.md | 5 --- website/source/docs/agent/services.html.md | 8 ++--- 14 files changed, 33 insertions(+), 93 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 800302c1ae..5da86230f2 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -1823,11 +1823,6 @@ func (a *Agent) AddCheck(check *structs.HealthCheck, chkType *structs.CheckType, check.CheckID, checks.MinInterval)) chkType.Interval = checks.MinInterval } - if chkType.Script != "" { - a.logger.Printf("[WARN] agent: check %q has the 'script' field, which has been deprecated "+ - "and replaced with the 'args' field. See https://www.consul.io/docs/agent/checks.html", - check.CheckID) - } if a.dockerClient == nil { dc, err := checks.NewDockerClient(os.Getenv("DOCKER_HOST"), checks.BufSize) @@ -1844,7 +1839,6 @@ func (a *Agent) AddCheck(check *structs.HealthCheck, chkType *structs.CheckType, CheckID: check.CheckID, DockerContainerID: chkType.DockerContainerID, Shell: chkType.Shell, - Script: chkType.Script, ScriptArgs: chkType.ScriptArgs, Interval: chkType.Interval, Logger: a.logger, @@ -1866,16 +1860,10 @@ func (a *Agent) AddCheck(check *structs.HealthCheck, chkType *structs.CheckType, check.CheckID, checks.MinInterval) chkType.Interval = checks.MinInterval } - if chkType.Script != "" { - a.logger.Printf("[WARN] agent: check %q has the 'script' field, which has been deprecated "+ - "and replaced with the 'args' field. See https://www.consul.io/docs/agent/checks.html", - check.CheckID) - } monitor := &checks.CheckMonitor{ Notify: a.State, CheckID: check.CheckID, - Script: chkType.Script, ScriptArgs: chkType.ScriptArgs, Interval: chkType.Interval, Timeout: chkType.Timeout, diff --git a/agent/agent_endpoint_test.go b/agent/agent_endpoint_test.go index c6e4f05324..1a62a84279 100644 --- a/agent/agent_endpoint_test.go +++ b/agent/agent_endpoint_test.go @@ -716,14 +716,6 @@ func TestAgent_RegisterCheck_Scripts(t *testing.T) { name string check map[string]interface{} }{ - { - "< Consul 1.0.0", - map[string]interface{}{ - "Name": "test", - "Interval": "2s", - "Script": "true", - }, - }, { "== Consul 1.0.0", map[string]interface{}{ diff --git a/agent/agent_test.go b/agent/agent_test.go index 69a7d124a6..b4989de662 100644 --- a/agent/agent_test.go +++ b/agent/agent_test.go @@ -651,8 +651,8 @@ func TestAgent_AddCheck(t *testing.T) { Status: api.HealthCritical, } chk := &structs.CheckType{ - Script: "exit 0", - Interval: 15 * time.Second, + ScriptArgs: []string{"exit", "0"}, + Interval: 15 * time.Second, } err := a.AddCheck(health, chk, false, "") if err != nil { @@ -690,8 +690,8 @@ func TestAgent_AddCheck_StartPassing(t *testing.T) { Status: api.HealthPassing, } chk := &structs.CheckType{ - Script: "exit 0", - Interval: 15 * time.Second, + ScriptArgs: []string{"exit", "0"}, + Interval: 15 * time.Second, } err := a.AddCheck(health, chk, false, "") if err != nil { @@ -729,8 +729,8 @@ func TestAgent_AddCheck_MinInterval(t *testing.T) { Status: api.HealthCritical, } chk := &structs.CheckType{ - Script: "exit 0", - Interval: time.Microsecond, + ScriptArgs: []string{"exit", "0"}, + Interval: time.Microsecond, } err := a.AddCheck(health, chk, false, "") if err != nil { @@ -764,8 +764,8 @@ func TestAgent_AddCheck_MissingService(t *testing.T) { ServiceID: "baz", } chk := &structs.CheckType{ - Script: "exit 0", - Interval: time.Microsecond, + ScriptArgs: []string{"exit", "0"}, + Interval: time.Microsecond, } err := a.AddCheck(health, chk, false, "") if err == nil || err.Error() != `ServiceID "baz" does not exist` { @@ -829,8 +829,8 @@ func TestAgent_AddCheck_ExecDisable(t *testing.T) { Status: api.HealthCritical, } chk := &structs.CheckType{ - Script: "exit 0", - Interval: 15 * time.Second, + ScriptArgs: []string{"exit", "0"}, + Interval: 15 * time.Second, } err := a.AddCheck(health, chk, false, "") if err == nil || !strings.Contains(err.Error(), "Scripts are disabled on this agent") { @@ -904,8 +904,8 @@ func TestAgent_RemoveCheck(t *testing.T) { Status: api.HealthCritical, } chk := &structs.CheckType{ - Script: "exit 0", - Interval: 15 * time.Second, + ScriptArgs: []string{"exit", "0"}, + Interval: 15 * time.Second, } err := a.AddCheck(health, chk, false, "") if err != nil { @@ -1315,8 +1315,8 @@ func TestAgent_PersistCheck(t *testing.T) { Status: api.HealthPassing, } chkType := &structs.CheckType{ - Script: "/bin/true", - Interval: 10 * time.Second, + ScriptArgs: []string{"/bin/true"}, + Interval: 10 * time.Second, } file := filepath.Join(a.Config.DataDir, checksDir, checkIDHash(check.CheckID)) @@ -1473,7 +1473,7 @@ func TestAgent_PurgeCheckOnDuplicate(t *testing.T) { id = "mem" name = "memory check" notes = "my cool notes" - script = "/bin/check-redis.py" + args = ["/bin/check-redis.py"] interval = "30s" } `) diff --git a/agent/config/builder.go b/agent/config/builder.go index 644bd0583a..7318e7ab32 100644 --- a/agent/config/builder.go +++ b/agent/config/builder.go @@ -967,7 +967,6 @@ func (b *Builder) checkVal(v *CheckDefinition) *structs.CheckDefinition { ServiceID: b.stringVal(v.ServiceID), Token: b.stringVal(v.Token), Status: b.stringVal(v.Status), - Script: b.stringVal(v.Script), ScriptArgs: v.ScriptArgs, HTTP: b.stringVal(v.HTTP), Header: v.Header, diff --git a/agent/config/config.go b/agent/config/config.go index 5447f95c4a..e92b76a453 100644 --- a/agent/config/config.go +++ b/agent/config/config.go @@ -331,7 +331,6 @@ type CheckDefinition struct { ServiceID *string `json:"service_id,omitempty" hcl:"service_id" mapstructure:"service_id"` Token *string `json:"token,omitempty" hcl:"token" mapstructure:"token"` Status *string `json:"status,omitempty" hcl:"status" mapstructure:"status"` - Script *string `json:"script,omitempty" hcl:"script" mapstructure:"script"` ScriptArgs []string `json:"args,omitempty" hcl:"args" mapstructure:"args"` HTTP *string `json:"http,omitempty" hcl:"http" mapstructure:"http"` Header map[string][]string `json:"header,omitempty" hcl:"header" mapstructure:"header"` diff --git a/agent/config/runtime_test.go b/agent/config/runtime_test.go index 55a3c4d504..cc8deca9ba 100644 --- a/agent/config/runtime_test.go +++ b/agent/config/runtime_test.go @@ -1883,17 +1883,17 @@ func TestConfigFlagsAndEdgecases(t *testing.T) { `-data-dir=` + dataDir, }, json: []string{ - `{ "check": { "name": "a", "script": "/bin/true" } }`, - `{ "check": { "name": "b", "script": "/bin/false" } }`, + `{ "check": { "name": "a", "args": ["/bin/true"] } }`, + `{ "check": { "name": "b", "args": ["/bin/false"] } }`, }, hcl: []string{ - `check = { name = "a" script = "/bin/true" }`, - `check = { name = "b" script = "/bin/false" }`, + `check = { name = "a" args = ["/bin/true"] }`, + `check = { name = "b" args = ["/bin/false"] }`, }, patch: func(rt *RuntimeConfig) { rt.Checks = []*structs.CheckDefinition{ - &structs.CheckDefinition{Name: "a", Script: "/bin/true"}, - &structs.CheckDefinition{Name: "b", Script: "/bin/false"}, + &structs.CheckDefinition{Name: "a", ScriptArgs: []string{"/bin/true"}}, + &structs.CheckDefinition{Name: "b", ScriptArgs: []string{"/bin/false"}}, } rt.DataDir = dataDir }, @@ -2265,7 +2265,6 @@ func TestFullConfig(t *testing.T) { "service_id": "L8G0QNmR", "token": "oo4BCTgJ", "status": "qLykAl5u", - "script": "dhGfIF8n", "args": ["f3BemRjy", "e5zgpef7"], "http": "29B93haH", "header": { @@ -2290,7 +2289,6 @@ func TestFullConfig(t *testing.T) { "service_id": "lSulPcyz", "token": "toO59sh8", "status": "9RlWsXMV", - "script": "8qbd8tWw", "args": ["4BAJttck", "4D2NPtTQ"], "http": "dohLcyQ2", "header": { @@ -2314,7 +2312,6 @@ func TestFullConfig(t *testing.T) { "service_id": "CmUUcRna", "token": "a3nQzHuy", "status": "irj26nf3", - "script": "FJsI1oXt", "args": ["9s526ogY", "gSlOHj1w"], "http": "yzhgsQ7Y", "header": { @@ -2449,7 +2446,6 @@ func TestFullConfig(t *testing.T) { "name": "iehanzuq", "status": "rCvn53TH", "notes": "fti5lfF3", - "script": "rtj34nfd", "args": ["16WRUmwS", "QWk7j7ae"], "http": "dl3Fgme3", "header": { @@ -2472,7 +2468,6 @@ func TestFullConfig(t *testing.T) { "name": "sgV4F7Pk", "notes": "yP5nKbW0", "status": "7oLMEyfu", - "script": "NlUQ3nTE", "args": ["5wEZtZpv", "0Ihyk8cS"], "http": "KyDjGY9H", "header": { @@ -2494,7 +2489,6 @@ func TestFullConfig(t *testing.T) { "name": "IEqrzrsd", "notes": "SVqApqeM", "status": "XXkVoZXt", - "script": "IXLZTM6E", "args": ["wD05Bvao", "rLYB7kQC"], "http": "kyICZsn8", "header": { @@ -2527,7 +2521,6 @@ func TestFullConfig(t *testing.T) { "name": "atDGP7n5", "status": "pDQKEhWL", "notes": "Yt8EDLev", - "script": "MDu7wjlD", "args": ["81EDZLPa", "bPY5X8xd"], "http": "qzHYvmJO", "header": { @@ -2559,7 +2552,6 @@ func TestFullConfig(t *testing.T) { "name": "9OOS93ne", "notes": "CQy86DH0", "status": "P0SWDvrk", - "script": "6BhLJ7R9", "args": ["EXvkYIuG", "BATOyt6h"], "http": "u97ByEiW", "header": { @@ -2581,7 +2573,6 @@ func TestFullConfig(t *testing.T) { "name": "PQSaPWlT", "notes": "jKChDOdl", "status": "5qFz6OZn", - "script": "PbdxFZ3K", "args": ["NMtYWlT9", "vj74JXsm"], "http": "1LBDJhw4", "header": { @@ -2706,7 +2697,6 @@ func TestFullConfig(t *testing.T) { service_id = "L8G0QNmR" token = "oo4BCTgJ" status = "qLykAl5u" - script = "dhGfIF8n" args = ["f3BemRjy", "e5zgpef7"] http = "29B93haH" header = { @@ -2731,7 +2721,6 @@ func TestFullConfig(t *testing.T) { service_id = "lSulPcyz" token = "toO59sh8" status = "9RlWsXMV" - script = "8qbd8tWw" args = ["4BAJttck", "4D2NPtTQ"] http = "dohLcyQ2" header = { @@ -2755,7 +2744,6 @@ func TestFullConfig(t *testing.T) { service_id = "CmUUcRna" token = "a3nQzHuy" status = "irj26nf3" - script = "FJsI1oXt" args = ["9s526ogY", "gSlOHj1w"] http = "yzhgsQ7Y" header = { @@ -2890,7 +2878,6 @@ func TestFullConfig(t *testing.T) { name = "iehanzuq" status = "rCvn53TH" notes = "fti5lfF3" - script = "rtj34nfd" args = ["16WRUmwS", "QWk7j7ae"] http = "dl3Fgme3" header = { @@ -2913,7 +2900,6 @@ func TestFullConfig(t *testing.T) { name = "sgV4F7Pk" notes = "yP5nKbW0" status = "7oLMEyfu" - script = "NlUQ3nTE" args = ["5wEZtZpv", "0Ihyk8cS"] http = "KyDjGY9H" header = { @@ -2935,7 +2921,6 @@ func TestFullConfig(t *testing.T) { name = "IEqrzrsd" notes = "SVqApqeM" status = "XXkVoZXt" - script = "IXLZTM6E" args = ["wD05Bvao", "rLYB7kQC"] http = "kyICZsn8" header = { @@ -2968,7 +2953,6 @@ func TestFullConfig(t *testing.T) { name = "atDGP7n5" status = "pDQKEhWL" notes = "Yt8EDLev" - script = "MDu7wjlD" args = ["81EDZLPa", "bPY5X8xd"] http = "qzHYvmJO" header = { @@ -3000,7 +2984,6 @@ func TestFullConfig(t *testing.T) { name = "9OOS93ne" notes = "CQy86DH0" status = "P0SWDvrk" - script = "6BhLJ7R9" args = ["EXvkYIuG", "BATOyt6h"] http = "u97ByEiW" header = { @@ -3022,7 +3005,6 @@ func TestFullConfig(t *testing.T) { name = "PQSaPWlT" notes = "jKChDOdl" status = "5qFz6OZn" - script = "PbdxFZ3K" args = ["NMtYWlT9", "vj74JXsm"] http = "1LBDJhw4" header = { @@ -3286,7 +3268,6 @@ func TestFullConfig(t *testing.T) { ServiceID: "lSulPcyz", Token: "toO59sh8", Status: "9RlWsXMV", - Script: "8qbd8tWw", ScriptArgs: []string{"4BAJttck", "4D2NPtTQ"}, HTTP: "dohLcyQ2", Header: map[string][]string{ @@ -3310,7 +3291,6 @@ func TestFullConfig(t *testing.T) { ServiceID: "CmUUcRna", Token: "a3nQzHuy", Status: "irj26nf3", - Script: "FJsI1oXt", ScriptArgs: []string{"9s526ogY", "gSlOHj1w"}, HTTP: "yzhgsQ7Y", Header: map[string][]string{ @@ -3334,7 +3314,6 @@ func TestFullConfig(t *testing.T) { ServiceID: "L8G0QNmR", Token: "oo4BCTgJ", Status: "qLykAl5u", - Script: "dhGfIF8n", ScriptArgs: []string{"f3BemRjy", "e5zgpef7"}, HTTP: "29B93haH", Header: map[string][]string{ @@ -3454,7 +3433,6 @@ func TestFullConfig(t *testing.T) { Name: "atDGP7n5", Status: "pDQKEhWL", Notes: "Yt8EDLev", - Script: "MDu7wjlD", ScriptArgs: []string{"81EDZLPa", "bPY5X8xd"}, HTTP: "qzHYvmJO", Header: map[string][]string{ @@ -3487,7 +3465,6 @@ func TestFullConfig(t *testing.T) { Name: "9OOS93ne", Notes: "CQy86DH0", Status: "P0SWDvrk", - Script: "6BhLJ7R9", ScriptArgs: []string{"EXvkYIuG", "BATOyt6h"}, HTTP: "u97ByEiW", Header: map[string][]string{ @@ -3509,7 +3486,6 @@ func TestFullConfig(t *testing.T) { Name: "PQSaPWlT", Notes: "jKChDOdl", Status: "5qFz6OZn", - Script: "PbdxFZ3K", ScriptArgs: []string{"NMtYWlT9", "vj74JXsm"}, HTTP: "1LBDJhw4", Header: map[string][]string{ @@ -3543,7 +3519,6 @@ func TestFullConfig(t *testing.T) { Name: "sgV4F7Pk", Notes: "yP5nKbW0", Status: "7oLMEyfu", - Script: "NlUQ3nTE", ScriptArgs: []string{"5wEZtZpv", "0Ihyk8cS"}, HTTP: "KyDjGY9H", Header: map[string][]string{ @@ -3565,7 +3540,6 @@ func TestFullConfig(t *testing.T) { Name: "IEqrzrsd", Notes: "SVqApqeM", Status: "XXkVoZXt", - Script: "IXLZTM6E", ScriptArgs: []string{"wD05Bvao", "rLYB7kQC"}, HTTP: "kyICZsn8", Header: map[string][]string{ @@ -3587,7 +3561,6 @@ func TestFullConfig(t *testing.T) { Name: "iehanzuq", Status: "rCvn53TH", Notes: "fti5lfF3", - Script: "rtj34nfd", ScriptArgs: []string{"16WRUmwS", "QWk7j7ae"}, HTTP: "dl3Fgme3", Header: map[string][]string{ @@ -4007,7 +3980,6 @@ func TestSanitize(t *testing.T) { "Method": "", "Name": "zoo", "Notes": "", - "Script": "", "ScriptArgs": [], "ServiceID": "", "Shell": "", @@ -4139,7 +4111,6 @@ func TestSanitize(t *testing.T) { "Method": "", "Name": "blurb", "Notes": "", - "Script": "", "ScriptArgs": [], "Shell": "", "Status": "", diff --git a/agent/structs/check_definition.go b/agent/structs/check_definition.go index 364c6b3d68..0ee6c20495 100644 --- a/agent/structs/check_definition.go +++ b/agent/structs/check_definition.go @@ -21,7 +21,6 @@ type CheckDefinition struct { // // ID (CheckID), Name, Status, Notes // - Script string ScriptArgs []string HTTP string Header map[string][]string @@ -63,7 +62,6 @@ func (c *CheckDefinition) CheckType() *CheckType { Status: c.Status, Notes: c.Notes, - Script: c.Script, ScriptArgs: c.ScriptArgs, HTTP: c.HTTP, GRPC: c.GRPC, diff --git a/agent/structs/check_definition_test.go b/agent/structs/check_definition_test.go index c7fdae81ca..af240aa956 100644 --- a/agent/structs/check_definition_test.go +++ b/agent/structs/check_definition_test.go @@ -83,7 +83,7 @@ func TestCheckDefinitionToCheckType(t *testing.T) { ServiceID: "svcid", Token: "tok", - Script: "/bin/foo", + ScriptArgs: []string{"/bin/foo"}, HTTP: "someurl", TCP: "host:port", Interval: 1 * time.Second, @@ -100,7 +100,7 @@ func TestCheckDefinitionToCheckType(t *testing.T) { Status: "green", Notes: "notes", - Script: "/bin/foo", + ScriptArgs: []string{"/bin/foo"}, HTTP: "someurl", TCP: "host:port", Interval: 1 * time.Second, diff --git a/agent/structs/check_type.go b/agent/structs/check_type.go index ea5b10aa00..23a6830777 100644 --- a/agent/structs/check_type.go +++ b/agent/structs/check_type.go @@ -25,7 +25,6 @@ type CheckType struct { // fields copied to CheckDefinition // Update CheckDefinition when adding fields here - Script string ScriptArgs []string HTTP string Header map[string][]string @@ -70,7 +69,7 @@ func (c *CheckType) Empty() bool { // IsScript checks if this is a check that execs some kind of script. func (c *CheckType) IsScript() bool { - return c.Script != "" || len(c.ScriptArgs) > 0 + return len(c.ScriptArgs) > 0 } // IsTTL checks if this is a TTL type diff --git a/agent/structs/service_definition_test.go b/agent/structs/service_definition_test.go index 12a9ef99af..d3bab4a08f 100644 --- a/agent/structs/service_definition_test.go +++ b/agent/structs/service_definition_test.go @@ -14,8 +14,8 @@ func TestAgentStructs_CheckTypes(t *testing.T) { // Singular Check field works svc.Check = CheckType{ - Script: "/foo/bar", - Interval: 10 * time.Second, + ScriptArgs: []string{"/foo/bar"}, + Interval: 10 * time.Second, } // Returns HTTP checks @@ -26,8 +26,8 @@ func TestAgentStructs_CheckTypes(t *testing.T) { // Returns Script checks svc.Checks = append(svc.Checks, &CheckType{ - Script: "/foo/bar", - Interval: 10 * time.Second, + ScriptArgs: []string{"/foo/bar"}, + Interval: 10 * time.Second, }) // Returns TTL checks diff --git a/api/agent.go b/api/agent.go index 772948ad1e..23690d48a4 100644 --- a/api/agent.go +++ b/api/agent.go @@ -86,7 +86,6 @@ type AgentServiceCheck struct { CheckID string `json:",omitempty"` Name string `json:",omitempty"` Args []string `json:"ScriptArgs,omitempty"` - Script string `json:",omitempty"` // Deprecated, use Args. DockerContainerID string `json:",omitempty"` Shell string `json:",omitempty"` // Only supported for Docker. Interval string `json:",omitempty"` diff --git a/api/agent_test.go b/api/agent_test.go index a05c4faf1a..b195fed293 100644 --- a/api/agent_test.go +++ b/api/agent_test.go @@ -694,7 +694,7 @@ func TestAPI_AgentChecks_Docker(t *testing.T) { ServiceID: "redis", AgentServiceCheck: AgentServiceCheck{ DockerContainerID: "f972c95ebf0e", - Script: "/bin/true", + Args: []string{"/bin/true"}, Shell: "/bin/bash", Interval: "10s", }, diff --git a/website/source/docs/agent/checks.html.md b/website/source/docs/agent/checks.html.md index 42065e2799..a563de5778 100644 --- a/website/source/docs/agent/checks.html.md +++ b/website/source/docs/agent/checks.html.md @@ -247,11 +247,6 @@ In Consul 0.9.0 and later, the agent must be configured with [`enable_script_checks`](/docs/agent/options.html#_enable_script_checks) set to `true` in order to enable script checks. -Prior to Consul 1.0, checks used a single `script` field to define the command to run, and -would always run in a shell. In Consul 1.0, the `args` array was added so that checks can be -run without a shell. The `script` field is deprecated, and you should include the shell in -the `args` to run under a shell, eg. `"args": ["sh", "-c", "..."]`. - ## Initial Health Check Status By default, when checks are registered against a Consul agent, the state is set diff --git a/website/source/docs/agent/services.html.md b/website/source/docs/agent/services.html.md index 4cb6873a09..bfac46d4d7 100644 --- a/website/source/docs/agent/services.html.md +++ b/website/source/docs/agent/services.html.md @@ -32,7 +32,7 @@ A service definition is a script that looks like: "enable_tag_override": false, "checks": [ { - "script": "/usr/local/bin/check_redis.py", + "args": ["/usr/local/bin/check_redis.py"], "interval": "10s" } ] @@ -80,7 +80,7 @@ node has any failing system-level check, the DNS interface will omit that node from any service query. The check must be of the script, HTTP, TCP or TTL type. If it is a script type, -`script` and `interval` must be provided. If it is a HTTP type, `http` and +`args` and `interval` must be provided. If it is a HTTP type, `http` and `interval` must be provided. If it is a TCP type, `tcp` and `interval` must be provided. If it is a TTL type, then only `ttl` must be provided. The check name is automatically generated as `service:`. If there are multiple @@ -142,7 +142,7 @@ Multiple services definitions can be provided at once using the plural "port": 6000, "checks": [ { - "script": "/bin/check_redis -p 6000", + "args": ["/bin/check_redis", "-p", "6000"], "interval": "5s", "ttl": "20s" } @@ -159,7 +159,7 @@ Multiple services definitions can be provided at once using the plural "port": 7000, "checks": [ { - "script": "/bin/check_redis -p 7000", + "args": ["/bin/check_redis", "-p", "7000"], "interval": "30s", "ttl": "60s" } From ba3971d2c12de9d52f16a3b5d299a8e08d8c2dd2 Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Tue, 8 May 2018 16:23:15 -0700 Subject: [PATCH 4/7] Remove deprecated metric names --- agent/acl.go | 2 -- agent/config/builder.go | 8 -------- agent/config/config.go | 1 - agent/config/runtime_test.go | 24 ++--------------------- agent/consul/acl.go | 5 ----- agent/consul/acl_endpoint.go | 1 - agent/consul/acl_replication.go | 3 --- agent/consul/autopilot.go | 3 --- agent/consul/catalog_endpoint.go | 8 -------- agent/consul/client.go | 4 ---- agent/consul/fsm/commands_oss.go | 15 -------------- agent/consul/fsm/snapshot.go | 1 - agent/consul/health_endpoint.go | 6 ------ agent/consul/kvs_endpoint.go | 1 - agent/consul/leader.go | 5 ----- agent/consul/prepared_query_endpoint.go | 4 ---- agent/consul/rpc.go | 8 -------- agent/consul/segment_oss.go | 1 - agent/consul/session_endpoint.go | 2 -- agent/consul/session_ttl.go | 2 -- agent/consul/txn_endpoint.go | 2 -- agent/dns.go | 7 ------- agent/http.go | 1 - website/source/docs/agent/options.html.md | 4 ---- 24 files changed, 2 insertions(+), 116 deletions(-) diff --git a/agent/acl.go b/agent/acl.go index 4245c53a05..0bf4180eb4 100644 --- a/agent/acl.go +++ b/agent/acl.go @@ -143,11 +143,9 @@ func (m *aclManager) lookupACL(a *Agent, id string) (acl.ACL, error) { cached = raw.(*aclCacheEntry) } if cached != nil && time.Now().Before(cached.Expires) { - metrics.IncrCounter([]string{"consul", "acl", "cache_hit"}, 1) metrics.IncrCounter([]string{"acl", "cache_hit"}, 1) return cached.ACL, nil } - metrics.IncrCounter([]string{"consul", "acl", "cache_miss"}, 1) metrics.IncrCounter([]string{"acl", "cache_miss"}, 1) // At this point we might have a stale cached ACL, or none at all, so diff --git a/agent/config/builder.go b/agent/config/builder.go index 7318e7ab32..43f3a141d2 100644 --- a/agent/config/builder.go +++ b/agent/config/builder.go @@ -511,14 +511,6 @@ 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.") - } else { - telemetryBlockedPrefixes = append(telemetryBlockedPrefixes, "consul.consul.") - } - // raft performance scaling performanceRaftMultiplier := b.intVal(c.Performance.RaftMultiplier) if performanceRaftMultiplier < 1 || uint(performanceRaftMultiplier) > consul.MaxRaftMultiplier { diff --git a/agent/config/config.go b/agent/config/config.go index e92b76a453..cd06235ae7 100644 --- a/agent/config/config.go +++ b/agent/config/config.go @@ -394,7 +394,6 @@ type Telemetry struct { PrometheusRetentionTime *string `json:"prometheus_retention_time,omitempty" hcl:"prometheus_retention_time" mapstructure:"prometheus_retention_time"` StatsdAddr *string `json:"statsd_address,omitempty" hcl:"statsd_address" mapstructure:"statsd_address"` StatsiteAddr *string `json:"statsite_address,omitempty" hcl:"statsite_address" mapstructure:"statsite_address"` - EnableDeprecatedNames *bool `json:"enable_deprecated_names" hcl:"enable_deprecated_names" mapstructure:"enable_deprecated_names"` } type Ports struct { diff --git a/agent/config/runtime_test.go b/agent/config/runtime_test.go index cc8deca9ba..f7e304141f 100644 --- a/agent/config/runtime_test.go +++ b/agent/config/runtime_test.go @@ -1811,28 +1811,10 @@ 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"} }, warns: []string{`Filter rule must begin with either '+' or '-': "nix"`}, }, - { - desc: "telemetry.enable_deprecated_names adds allow rule for whitelist", - args: []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", args: []string{ @@ -2620,7 +2602,6 @@ func TestFullConfig(t *testing.T) { "dogstatsd_tags": [ "3N81zSUB","Xtj8AnXZ" ], "filter_default": true, "prefix_filter": [ "+oJotS8XJ","-cazlEhGn" ], - "enable_deprecated_names": true, "metrics_prefix": "ftO6DySn", "prometheus_retention_time": "15s", "statsd_address": "drce87cy", @@ -3052,7 +3033,6 @@ func TestFullConfig(t *testing.T) { dogstatsd_tags = [ "3N81zSUB","Xtj8AnXZ" ] filter_default = true prefix_filter = [ "+oJotS8XJ","-cazlEhGn" ] - enable_deprecated_names = true metrics_prefix = "ftO6DySn" prometheus_retention_time = "15s" statsd_address = "drce87cy" @@ -3606,7 +3586,7 @@ func TestFullConfig(t *testing.T) { TelemetryDogstatsdAddr: "0wSndumK", TelemetryDogstatsdTags: []string{"3N81zSUB", "Xtj8AnXZ"}, TelemetryFilterDefault: true, - TelemetryAllowedPrefixes: []string{"oJotS8XJ", "consul.consul."}, + TelemetryAllowedPrefixes: []string{"oJotS8XJ"}, TelemetryBlockedPrefixes: []string{"cazlEhGn"}, TelemetryMetricsPrefix: "ftO6DySn", TelemetryPrometheusRetentionTime: 15 * time.Second, diff --git a/agent/consul/acl.go b/agent/consul/acl.go index eb14e1dabc..1e95e62e44 100644 --- a/agent/consul/acl.go +++ b/agent/consul/acl.go @@ -41,7 +41,6 @@ type aclCacheEntry struct { // assumes its running in the ACL datacenter, or in a non-ACL datacenter when // using its replicated ACLs during an outage. func (s *Server) aclLocalFault(id string) (string, string, error) { - defer metrics.MeasureSince([]string{"consul", "acl", "fault"}, time.Now()) defer metrics.MeasureSince([]string{"acl", "fault"}, time.Now()) // Query the state store. @@ -75,7 +74,6 @@ func (s *Server) resolveToken(id string) (acl.ACL, error) { if len(authDC) == 0 { return nil, nil } - defer metrics.MeasureSince([]string{"consul", "acl", "resolveToken"}, time.Now()) defer metrics.MeasureSince([]string{"acl", "resolveToken"}, time.Now()) // Handle the anonymous token @@ -159,11 +157,9 @@ func (c *aclCache) lookupACL(id, authDC string) (acl.ACL, error) { // Check for live cache. if cached != nil && time.Now().Before(cached.Expires) { - metrics.IncrCounter([]string{"consul", "acl", "cache_hit"}, 1) metrics.IncrCounter([]string{"acl", "cache_hit"}, 1) return cached.ACL, nil } - metrics.IncrCounter([]string{"consul", "acl", "cache_miss"}, 1) metrics.IncrCounter([]string{"acl", "cache_miss"}, 1) // Attempt to refresh the policy from the ACL datacenter via an RPC. @@ -226,7 +222,6 @@ func (c *aclCache) lookupACL(id, authDC string) (acl.ACL, error) { // Fake up an ACL datacenter reply and inject it into the cache. // Note we use the local TTL here, so this'll be used for that // amount of time even once the ACL datacenter becomes available. - metrics.IncrCounter([]string{"consul", "acl", "replication_hit"}, 1) metrics.IncrCounter([]string{"acl", "replication_hit"}, 1) reply.ETag = makeACLETag(parent, policy) reply.TTL = c.config.ACLTTL diff --git a/agent/consul/acl_endpoint.go b/agent/consul/acl_endpoint.go index 2a8b4b2340..c4f1d07a70 100644 --- a/agent/consul/acl_endpoint.go +++ b/agent/consul/acl_endpoint.go @@ -145,7 +145,6 @@ func (a *ACL) Apply(args *structs.ACLRequest, reply *string) error { if done, err := a.srv.forward("ACL.Apply", args, args, reply); done { return err } - defer metrics.MeasureSince([]string{"consul", "acl", "apply"}, time.Now()) defer metrics.MeasureSince([]string{"acl", "apply"}, time.Now()) // Verify we are allowed to serve this request diff --git a/agent/consul/acl_replication.go b/agent/consul/acl_replication.go index 38d5f25fc5..b008aa87ac 100644 --- a/agent/consul/acl_replication.go +++ b/agent/consul/acl_replication.go @@ -149,7 +149,6 @@ func (s *Server) fetchLocalACLs() (structs.ACLs, error) { // datacenter. The lastIndex parameter is a hint about which remote index we // have replicated to, so this is expected to block until something changes. func (s *Server) fetchRemoteACLs(lastRemoteIndex uint64) (*structs.IndexedACLs, error) { - defer metrics.MeasureSince([]string{"consul", "leader", "fetchRemoteACLs"}, time.Now()) defer metrics.MeasureSince([]string{"leader", "fetchRemoteACLs"}, time.Now()) args := structs.DCSpecificRequest{ @@ -170,7 +169,6 @@ func (s *Server) fetchRemoteACLs(lastRemoteIndex uint64) (*structs.IndexedACLs, // UpdateLocalACLs is given a list of changes to apply in order to bring the // local ACLs in-line with the remote ACLs from the ACL datacenter. func (s *Server) updateLocalACLs(changes structs.ACLRequests) error { - defer metrics.MeasureSince([]string{"consul", "leader", "updateLocalACLs"}, time.Now()) defer metrics.MeasureSince([]string{"leader", "updateLocalACLs"}, time.Now()) minTimePerOp := time.Second / time.Duration(s.config.ACLReplicationApplyLimit) @@ -218,7 +216,6 @@ func (s *Server) replicateACLs(lastRemoteIndex uint64) (uint64, error) { // Measure everything after the remote query, which can block for long // periods of time. This metric is a good measure of how expensive the // replication process is. - defer metrics.MeasureSince([]string{"consul", "leader", "replicateACLs"}, time.Now()) defer metrics.MeasureSince([]string{"leader", "replicateACLs"}, time.Now()) local, err := s.fetchLocalACLs() diff --git a/agent/consul/autopilot.go b/agent/consul/autopilot.go index 5c5cf6ffed..59741efc91 100644 --- a/agent/consul/autopilot.go +++ b/agent/consul/autopilot.go @@ -55,13 +55,10 @@ func (d *AutopilotDelegate) IsServer(m serf.Member) (*autopilot.ServerInfo, erro // Heartbeat a metric for monitoring if we're the leader func (d *AutopilotDelegate) NotifyHealth(health autopilot.OperatorHealthReply) { if d.server.raft.State() == raft.Leader { - metrics.SetGauge([]string{"consul", "autopilot", "failure_tolerance"}, float32(health.FailureTolerance)) metrics.SetGauge([]string{"autopilot", "failure_tolerance"}, float32(health.FailureTolerance)) if health.Healthy { - metrics.SetGauge([]string{"consul", "autopilot", "healthy"}, 1) metrics.SetGauge([]string{"autopilot", "healthy"}, 1) } else { - metrics.SetGauge([]string{"consul", "autopilot", "healthy"}, 0) metrics.SetGauge([]string{"autopilot", "healthy"}, 0) } } diff --git a/agent/consul/catalog_endpoint.go b/agent/consul/catalog_endpoint.go index 5cfb3ff513..52ba5fb1b7 100644 --- a/agent/consul/catalog_endpoint.go +++ b/agent/consul/catalog_endpoint.go @@ -24,7 +24,6 @@ func (c *Catalog) Register(args *structs.RegisterRequest, reply *struct{}) error if done, err := c.srv.forward("Catalog.Register", args, args, reply); done { return err } - defer metrics.MeasureSince([]string{"consul", "catalog", "register"}, time.Now()) defer metrics.MeasureSince([]string{"catalog", "register"}, time.Now()) // Verify the args. @@ -117,7 +116,6 @@ func (c *Catalog) Deregister(args *structs.DeregisterRequest, reply *struct{}) e if done, err := c.srv.forward("Catalog.Deregister", args, args, reply); done { return err } - defer metrics.MeasureSince([]string{"consul", "catalog", "deregister"}, time.Now()) defer metrics.MeasureSince([]string{"catalog", "deregister"}, time.Now()) // Verify the args @@ -279,19 +277,13 @@ func (c *Catalog) ServiceNodes(args *structs.ServiceSpecificRequest, reply *stru // Provide some metrics if err == nil { - metrics.IncrCounterWithLabels([]string{"consul", "catalog", "service", "query"}, 1, - []metrics.Label{{Name: "service", Value: args.ServiceName}}) metrics.IncrCounterWithLabels([]string{"catalog", "service", "query"}, 1, []metrics.Label{{Name: "service", Value: args.ServiceName}}) if args.ServiceTag != "" { - metrics.IncrCounterWithLabels([]string{"consul", "catalog", "service", "query-tag"}, 1, - []metrics.Label{{Name: "service", Value: args.ServiceName}, {Name: "tag", Value: args.ServiceTag}}) metrics.IncrCounterWithLabels([]string{"catalog", "service", "query-tag"}, 1, []metrics.Label{{Name: "service", Value: args.ServiceName}, {Name: "tag", Value: args.ServiceTag}}) } if len(reply.ServiceNodes) == 0 { - metrics.IncrCounterWithLabels([]string{"consul", "catalog", "service", "not-found"}, 1, - []metrics.Label{{Name: "service", Value: args.ServiceName}}) metrics.IncrCounterWithLabels([]string{"catalog", "service", "not-found"}, 1, []metrics.Label{{Name: "service", Value: args.ServiceName}}) } diff --git a/agent/consul/client.go b/agent/consul/client.go index 96baeb1748..f3d5fc6bbb 100644 --- a/agent/consul/client.go +++ b/agent/consul/client.go @@ -249,10 +249,8 @@ TRY: } // Enforce the RPC limit. - metrics.IncrCounter([]string{"consul", "client", "rpc"}, 1) metrics.IncrCounter([]string{"client", "rpc"}, 1) if !c.rpcLimiter.Allow() { - metrics.IncrCounter([]string{"consul", "client", "rpc", "exceeded"}, 1) metrics.IncrCounter([]string{"client", "rpc", "exceeded"}, 1) return structs.ErrRPCRateExceeded } @@ -293,10 +291,8 @@ func (c *Client) SnapshotRPC(args *structs.SnapshotRequest, in io.Reader, out io } // Enforce the RPC limit. - metrics.IncrCounter([]string{"consul", "client", "rpc"}, 1) metrics.IncrCounter([]string{"client", "rpc"}, 1) if !c.rpcLimiter.Allow() { - metrics.IncrCounter([]string{"consul", "client", "rpc", "exceeded"}, 1) metrics.IncrCounter([]string{"client", "rpc", "exceeded"}, 1) return structs.ErrRPCRateExceeded } diff --git a/agent/consul/fsm/commands_oss.go b/agent/consul/fsm/commands_oss.go index 2029f1723e..ede04eef6a 100644 --- a/agent/consul/fsm/commands_oss.go +++ b/agent/consul/fsm/commands_oss.go @@ -23,7 +23,6 @@ func init() { } func (c *FSM) applyRegister(buf []byte, index uint64) interface{} { - defer metrics.MeasureSince([]string{"consul", "fsm", "register"}, time.Now()) defer metrics.MeasureSince([]string{"fsm", "register"}, time.Now()) var req structs.RegisterRequest if err := structs.Decode(buf, &req); err != nil { @@ -39,7 +38,6 @@ func (c *FSM) applyRegister(buf []byte, index uint64) interface{} { } func (c *FSM) applyDeregister(buf []byte, index uint64) interface{} { - defer metrics.MeasureSince([]string{"consul", "fsm", "deregister"}, time.Now()) defer metrics.MeasureSince([]string{"fsm", "deregister"}, time.Now()) var req structs.DeregisterRequest if err := structs.Decode(buf, &req); err != nil { @@ -73,8 +71,6 @@ func (c *FSM) applyKVSOperation(buf []byte, index uint64) interface{} { if err := structs.Decode(buf, &req); err != nil { panic(fmt.Errorf("failed to decode request: %v", err)) } - defer metrics.MeasureSinceWithLabels([]string{"consul", "fsm", "kvs"}, time.Now(), - []metrics.Label{{Name: "op", Value: string(req.Op)}}) defer metrics.MeasureSinceWithLabels([]string{"fsm", "kvs"}, time.Now(), []metrics.Label{{Name: "op", Value: string(req.Op)}}) switch req.Op { @@ -120,8 +116,6 @@ func (c *FSM) applySessionOperation(buf []byte, index uint64) interface{} { if err := structs.Decode(buf, &req); err != nil { panic(fmt.Errorf("failed to decode request: %v", err)) } - defer metrics.MeasureSinceWithLabels([]string{"consul", "fsm", "session"}, time.Now(), - []metrics.Label{{Name: "op", Value: string(req.Op)}}) defer metrics.MeasureSinceWithLabels([]string{"fsm", "session"}, time.Now(), []metrics.Label{{Name: "op", Value: string(req.Op)}}) switch req.Op { @@ -143,8 +137,6 @@ func (c *FSM) applyACLOperation(buf []byte, index uint64) interface{} { if err := structs.Decode(buf, &req); err != nil { panic(fmt.Errorf("failed to decode request: %v", err)) } - defer metrics.MeasureSinceWithLabels([]string{"consul", "fsm", "acl"}, time.Now(), - []metrics.Label{{Name: "op", Value: string(req.Op)}}) defer metrics.MeasureSinceWithLabels([]string{"fsm", "acl"}, time.Now(), []metrics.Label{{Name: "op", Value: string(req.Op)}}) switch req.Op { @@ -177,8 +169,6 @@ func (c *FSM) applyTombstoneOperation(buf []byte, index uint64) interface{} { if err := structs.Decode(buf, &req); err != nil { panic(fmt.Errorf("failed to decode request: %v", err)) } - defer metrics.MeasureSinceWithLabels([]string{"consul", "fsm", "tombstone"}, time.Now(), - []metrics.Label{{Name: "op", Value: string(req.Op)}}) defer metrics.MeasureSinceWithLabels([]string{"fsm", "tombstone"}, time.Now(), []metrics.Label{{Name: "op", Value: string(req.Op)}}) switch req.Op { @@ -199,7 +189,6 @@ func (c *FSM) applyCoordinateBatchUpdate(buf []byte, index uint64) interface{} { if err := structs.Decode(buf, &updates); err != nil { panic(fmt.Errorf("failed to decode batch updates: %v", err)) } - defer metrics.MeasureSince([]string{"consul", "fsm", "coordinate", "batch-update"}, time.Now()) defer metrics.MeasureSince([]string{"fsm", "coordinate", "batch-update"}, time.Now()) if err := c.state.CoordinateBatchUpdate(index, updates); err != nil { return err @@ -215,8 +204,6 @@ func (c *FSM) applyPreparedQueryOperation(buf []byte, index uint64) interface{} panic(fmt.Errorf("failed to decode request: %v", err)) } - defer metrics.MeasureSinceWithLabels([]string{"consul", "fsm", "prepared-query"}, time.Now(), - []metrics.Label{{Name: "op", Value: string(req.Op)}}) defer metrics.MeasureSinceWithLabels([]string{"fsm", "prepared-query"}, time.Now(), []metrics.Label{{Name: "op", Value: string(req.Op)}}) switch req.Op { @@ -235,7 +222,6 @@ func (c *FSM) applyTxn(buf []byte, index uint64) interface{} { if err := structs.Decode(buf, &req); err != nil { panic(fmt.Errorf("failed to decode request: %v", err)) } - defer metrics.MeasureSince([]string{"consul", "fsm", "txn"}, time.Now()) defer metrics.MeasureSince([]string{"fsm", "txn"}, time.Now()) results, errors := c.state.TxnRW(index, req.Ops) return structs.TxnResponse{ @@ -249,7 +235,6 @@ func (c *FSM) applyAutopilotUpdate(buf []byte, index uint64) interface{} { if err := structs.Decode(buf, &req); err != nil { panic(fmt.Errorf("failed to decode request: %v", err)) } - defer metrics.MeasureSince([]string{"consul", "fsm", "autopilot"}, time.Now()) defer metrics.MeasureSince([]string{"fsm", "autopilot"}, time.Now()) if req.CAS { diff --git a/agent/consul/fsm/snapshot.go b/agent/consul/fsm/snapshot.go index 3721f07569..51b58d2906 100644 --- a/agent/consul/fsm/snapshot.go +++ b/agent/consul/fsm/snapshot.go @@ -57,7 +57,6 @@ func registerRestorer(msg structs.MessageType, fn restorer) { // Persist saves the FSM snapshot out to the given sink. func (s *snapshot) Persist(sink raft.SnapshotSink) error { - defer metrics.MeasureSince([]string{"consul", "fsm", "persist"}, time.Now()) defer metrics.MeasureSince([]string{"fsm", "persist"}, time.Now()) // Write the header diff --git a/agent/consul/health_endpoint.go b/agent/consul/health_endpoint.go index 1cf7460444..db59356c86 100644 --- a/agent/consul/health_endpoint.go +++ b/agent/consul/health_endpoint.go @@ -139,19 +139,13 @@ func (h *Health) ServiceNodes(args *structs.ServiceSpecificRequest, reply *struc // Provide some metrics if err == nil { - metrics.IncrCounterWithLabels([]string{"consul", "health", "service", "query"}, 1, - []metrics.Label{{Name: "service", Value: args.ServiceName}}) metrics.IncrCounterWithLabels([]string{"health", "service", "query"}, 1, []metrics.Label{{Name: "service", Value: args.ServiceName}}) if args.ServiceTag != "" { - metrics.IncrCounterWithLabels([]string{"consul", "health", "service", "query-tag"}, 1, - []metrics.Label{{Name: "service", Value: args.ServiceName}, {Name: "tag", Value: args.ServiceTag}}) metrics.IncrCounterWithLabels([]string{"health", "service", "query-tag"}, 1, []metrics.Label{{Name: "service", Value: args.ServiceName}, {Name: "tag", Value: args.ServiceTag}}) } if len(reply.Nodes) == 0 { - metrics.IncrCounterWithLabels([]string{"consul", "health", "service", "not-found"}, 1, - []metrics.Label{{Name: "service", Value: args.ServiceName}}) metrics.IncrCounterWithLabels([]string{"health", "service", "not-found"}, 1, []metrics.Label{{Name: "service", Value: args.ServiceName}}) } diff --git a/agent/consul/kvs_endpoint.go b/agent/consul/kvs_endpoint.go index ced5c4119b..b5f3fbb574 100644 --- a/agent/consul/kvs_endpoint.go +++ b/agent/consul/kvs_endpoint.go @@ -81,7 +81,6 @@ func (k *KVS) Apply(args *structs.KVSRequest, reply *bool) error { if done, err := k.srv.forward("KVS.Apply", args, args, reply); done { return err } - defer metrics.MeasureSince([]string{"consul", "kvs", "apply"}, time.Now()) defer metrics.MeasureSince([]string{"kvs", "apply"}, time.Now()) // Perform the pre-apply checks. diff --git a/agent/consul/leader.go b/agent/consul/leader.go index f5a1f237e9..d950d71bac 100644 --- a/agent/consul/leader.go +++ b/agent/consul/leader.go @@ -116,7 +116,6 @@ RECONCILE: s.logger.Printf("[ERR] consul: failed to wait for barrier: %v", err) goto WAIT } - metrics.MeasureSince([]string{"consul", "leader", "barrier"}, start) metrics.MeasureSince([]string{"leader", "barrier"}, start) // Check if we need to handle initial leadership actions @@ -183,7 +182,6 @@ WAIT: // previously inflight transactions have been committed and that our // state is up-to-date. func (s *Server) establishLeadership() error { - defer metrics.MeasureSince([]string{"consul", "leader", "establish_leadership"}, time.Now()) // This will create the anonymous token and master token (if that is // configured). if err := s.initializeACL(); err != nil { @@ -219,7 +217,6 @@ func (s *Server) establishLeadership() error { // revokeLeadership is invoked once we step down as leader. // This is used to cleanup any state that may be specific to a leader. func (s *Server) revokeLeadership() error { - defer metrics.MeasureSince([]string{"consul", "leader", "revoke_leadership"}, time.Now()) // Disable the tombstone GC, since it is only useful as a leader s.tombstoneGC.SetEnabled(false) @@ -444,7 +441,6 @@ func (s *Server) reconcileMember(member serf.Member) error { s.logger.Printf("[WARN] consul: skipping reconcile of node %v", member) return nil } - defer metrics.MeasureSince([]string{"consul", "leader", "reconcileMember"}, time.Now()) defer metrics.MeasureSince([]string{"leader", "reconcileMember"}, time.Now()) var err error switch member.Status { @@ -805,7 +801,6 @@ func (s *Server) removeConsulServer(m serf.Member, port int) error { // through Raft to ensure consistency. We do this outside the leader loop // to avoid blocking. func (s *Server) reapTombstones(index uint64) { - defer metrics.MeasureSince([]string{"consul", "leader", "reapTombstones"}, time.Now()) defer metrics.MeasureSince([]string{"leader", "reapTombstones"}, time.Now()) req := structs.TombstoneRequest{ Datacenter: s.config.Datacenter, diff --git a/agent/consul/prepared_query_endpoint.go b/agent/consul/prepared_query_endpoint.go index ee6061a84e..a56ddd35a7 100644 --- a/agent/consul/prepared_query_endpoint.go +++ b/agent/consul/prepared_query_endpoint.go @@ -32,7 +32,6 @@ func (p *PreparedQuery) Apply(args *structs.PreparedQueryRequest, reply *string) if done, err := p.srv.forward("PreparedQuery.Apply", args, args, reply); done { return err } - defer metrics.MeasureSince([]string{"consul", "prepared-query", "apply"}, time.Now()) defer metrics.MeasureSince([]string{"prepared-query", "apply"}, time.Now()) // Validate the ID. We must create new IDs before applying to the Raft @@ -287,7 +286,6 @@ func (p *PreparedQuery) Explain(args *structs.PreparedQueryExecuteRequest, if done, err := p.srv.forward("PreparedQuery.Explain", args, args, reply); done { return err } - defer metrics.MeasureSince([]string{"consul", "prepared-query", "explain"}, time.Now()) defer metrics.MeasureSince([]string{"prepared-query", "explain"}, time.Now()) // We have to do this ourselves since we are not doing a blocking RPC. @@ -335,7 +333,6 @@ func (p *PreparedQuery) Execute(args *structs.PreparedQueryExecuteRequest, if done, err := p.srv.forward("PreparedQuery.Execute", args, args, reply); done { return err } - defer metrics.MeasureSince([]string{"consul", "prepared-query", "execute"}, time.Now()) defer metrics.MeasureSince([]string{"prepared-query", "execute"}, time.Now()) // We have to do this ourselves since we are not doing a blocking RPC. @@ -471,7 +468,6 @@ func (p *PreparedQuery) ExecuteRemote(args *structs.PreparedQueryExecuteRemoteRe if done, err := p.srv.forward("PreparedQuery.ExecuteRemote", args, args, reply); done { return err } - defer metrics.MeasureSince([]string{"consul", "prepared-query", "execute_remote"}, time.Now()) defer metrics.MeasureSince([]string{"prepared-query", "execute_remote"}, time.Now()) // We have to do this ourselves since we are not doing a blocking RPC. diff --git a/agent/consul/rpc.go b/agent/consul/rpc.go index 678b805140..fcde830b0c 100644 --- a/agent/consul/rpc.go +++ b/agent/consul/rpc.go @@ -59,7 +59,6 @@ func (s *Server) listen(listener net.Listener) { } go s.handleConn(conn, false) - metrics.IncrCounter([]string{"consul", "rpc", "accept_conn"}, 1) metrics.IncrCounter([]string{"rpc", "accept_conn"}, 1) } } @@ -97,7 +96,6 @@ func (s *Server) handleConn(conn net.Conn, isTLS bool) { s.handleConsulConn(conn) case pool.RPCRaft: - metrics.IncrCounter([]string{"consul", "rpc", "raft_handoff"}, 1) metrics.IncrCounter([]string{"rpc", "raft_handoff"}, 1) s.raftLayer.Handoff(conn) @@ -156,12 +154,10 @@ func (s *Server) handleConsulConn(conn net.Conn) { if err := s.rpcServer.ServeRequest(rpcCodec); err != nil { if err != io.EOF && !strings.Contains(err.Error(), "closed") { s.logger.Printf("[ERR] consul.rpc: RPC error: %v %s", err, logConn(conn)) - metrics.IncrCounter([]string{"consul", "rpc", "request_error"}, 1) metrics.IncrCounter([]string{"rpc", "request_error"}, 1) } return } - metrics.IncrCounter([]string{"consul", "rpc", "request"}, 1) metrics.IncrCounter([]string{"rpc", "request"}, 1) } } @@ -288,8 +284,6 @@ func (s *Server) forwardDC(method, dc string, args interface{}, reply interface{ return structs.ErrNoDCPath } - metrics.IncrCounterWithLabels([]string{"consul", "rpc", "cross-dc"}, 1, - []metrics.Label{{Name: "datacenter", Value: dc}}) metrics.IncrCounterWithLabels([]string{"rpc", "cross-dc"}, 1, []metrics.Label{{Name: "datacenter", Value: dc}}) if err := s.connPool.RPC(dc, server.Addr, server.Version, method, server.UseTLS, args, reply); err != nil { @@ -401,7 +395,6 @@ RUN_QUERY: } // Run the query. - metrics.IncrCounter([]string{"consul", "rpc", "query"}, 1) metrics.IncrCounter([]string{"rpc", "query"}, 1) // Operate on a consistent set of state. This makes sure that the @@ -452,7 +445,6 @@ func (s *Server) setQueryMeta(m *structs.QueryMeta) { // consistentRead is used to ensure we do not perform a stale // read. This is done by verifying leadership before the read. func (s *Server) consistentRead() error { - defer metrics.MeasureSince([]string{"consul", "rpc", "consistentRead"}, time.Now()) defer metrics.MeasureSince([]string{"rpc", "consistentRead"}, time.Now()) future := s.raft.VerifyLeader() if err := future.Error(); err != nil { diff --git a/agent/consul/segment_oss.go b/agent/consul/segment_oss.go index 44f447124b..21a89e807b 100644 --- a/agent/consul/segment_oss.go +++ b/agent/consul/segment_oss.go @@ -59,7 +59,6 @@ func (s *Server) floodSegments(config *Config) { // all live nodes are registered, all failed nodes are marked as such, and all // left nodes are de-registered. func (s *Server) reconcile() (err error) { - defer metrics.MeasureSince([]string{"consul", "leader", "reconcile"}, time.Now()) defer metrics.MeasureSince([]string{"leader", "reconcile"}, time.Now()) members := s.serfLAN.Members() knownMembers := make(map[string]struct{}) diff --git a/agent/consul/session_endpoint.go b/agent/consul/session_endpoint.go index 54bb32f81a..3817460b25 100644 --- a/agent/consul/session_endpoint.go +++ b/agent/consul/session_endpoint.go @@ -23,7 +23,6 @@ func (s *Session) Apply(args *structs.SessionRequest, reply *string) error { if done, err := s.srv.forward("Session.Apply", args, args, reply); done { return err } - defer metrics.MeasureSince([]string{"consul", "session", "apply"}, time.Now()) defer metrics.MeasureSince([]string{"session", "apply"}, time.Now()) // Verify the args @@ -222,7 +221,6 @@ func (s *Session) Renew(args *structs.SessionSpecificRequest, if done, err := s.srv.forward("Session.Renew", args, args, reply); done { return err } - defer metrics.MeasureSince([]string{"consul", "session", "renew"}, time.Now()) defer metrics.MeasureSince([]string{"session", "renew"}, time.Now()) // Get the session, from local state. diff --git a/agent/consul/session_ttl.go b/agent/consul/session_ttl.go index 99247366f4..71265f0b1d 100644 --- a/agent/consul/session_ttl.go +++ b/agent/consul/session_ttl.go @@ -84,7 +84,6 @@ func (s *Server) createSessionTimer(id string, ttl time.Duration) { // invalidateSession is invoked when a session TTL is reached and we // need to invalidate the session. func (s *Server) invalidateSession(id string) { - defer metrics.MeasureSince([]string{"consul", "session_ttl", "invalidate"}, time.Now()) defer metrics.MeasureSince([]string{"session_ttl", "invalidate"}, time.Now()) // Clear the session timer @@ -134,7 +133,6 @@ func (s *Server) sessionStats() { for { select { case <-time.After(5 * time.Second): - metrics.SetGauge([]string{"consul", "session_ttl", "active"}, float32(s.sessionTimers.Len())) metrics.SetGauge([]string{"session_ttl", "active"}, float32(s.sessionTimers.Len())) case <-s.shutdownCh: diff --git a/agent/consul/txn_endpoint.go b/agent/consul/txn_endpoint.go index 7085548c8a..1822a74974 100644 --- a/agent/consul/txn_endpoint.go +++ b/agent/consul/txn_endpoint.go @@ -46,7 +46,6 @@ func (t *Txn) Apply(args *structs.TxnRequest, reply *structs.TxnResponse) error if done, err := t.srv.forward("Txn.Apply", args, args, reply); done { return err } - defer metrics.MeasureSince([]string{"consul", "txn", "apply"}, time.Now()) defer metrics.MeasureSince([]string{"txn", "apply"}, time.Now()) // Run the pre-checks before we send the transaction into Raft. @@ -90,7 +89,6 @@ func (t *Txn) Read(args *structs.TxnReadRequest, reply *structs.TxnReadResponse) if done, err := t.srv.forward("Txn.Read", args, args, reply); done { return err } - defer metrics.MeasureSince([]string{"consul", "txn", "read"}, time.Now()) defer metrics.MeasureSince([]string{"txn", "read"}, time.Now()) // We have to do this ourselves since we are not doing a blocking RPC. diff --git a/agent/dns.go b/agent/dns.go index 6211e71b95..f1c0d8bda7 100644 --- a/agent/dns.go +++ b/agent/dns.go @@ -158,8 +158,6 @@ START: func (d *DNSServer) handlePtr(resp dns.ResponseWriter, req *dns.Msg) { q := req.Question[0] defer func(s time.Time) { - metrics.MeasureSinceWithLabels([]string{"consul", "dns", "ptr_query"}, s, - []metrics.Label{{Name: "node", Value: d.agent.config.NodeName}}) metrics.MeasureSinceWithLabels([]string{"dns", "ptr_query"}, s, []metrics.Label{{Name: "node", Value: d.agent.config.NodeName}}) d.logger.Printf("[DEBUG] dns: request for %v (%v) from client %s (%s)", @@ -230,8 +228,6 @@ func (d *DNSServer) handlePtr(resp dns.ResponseWriter, req *dns.Msg) { func (d *DNSServer) handleQuery(resp dns.ResponseWriter, req *dns.Msg) { q := req.Question[0] defer func(s time.Time) { - metrics.MeasureSinceWithLabels([]string{"consul", "dns", "domain_query"}, s, - []metrics.Label{{Name: "node", Value: d.agent.config.NodeName}}) metrics.MeasureSinceWithLabels([]string{"dns", "domain_query"}, s, []metrics.Label{{Name: "node", Value: d.agent.config.NodeName}}) d.logger.Printf("[DEBUG] dns: request for name %v type %v class %v (took %v) from client %s (%s)", @@ -542,7 +538,6 @@ RPC: d.logger.Printf("[WARN] dns: Query results too stale, re-requesting") goto RPC } else if out.LastContact > staleCounterThreshold { - metrics.IncrCounter([]string{"consul", "dns", "stale_queries"}, 1) metrics.IncrCounter([]string{"dns", "stale_queries"}, 1) } } @@ -891,7 +886,6 @@ func (d *DNSServer) lookupServiceNodes(datacenter, service, tag string) (structs } if args.AllowStale && out.LastContact > staleCounterThreshold { - metrics.IncrCounter([]string{"consul", "dns", "stale_queries"}, 1) metrics.IncrCounter([]string{"dns", "stale_queries"}, 1) } @@ -1042,7 +1036,6 @@ RPC: d.logger.Printf("[WARN] dns: Query results too stale, re-requesting") goto RPC } else if out.LastContact > staleCounterThreshold { - metrics.IncrCounter([]string{"consul", "dns", "stale_queries"}, 1) metrics.IncrCounter([]string{"dns", "stale_queries"}, 1) } } diff --git a/agent/http.go b/agent/http.go index 9d331a034e..9ef9ab6b0b 100644 --- a/agent/http.go +++ b/agent/http.go @@ -110,7 +110,6 @@ func (s *HTTPServer) handler(enableDebug bool) http.Handler { start := time.Now() handler(resp, req) key := append([]string{"http", req.Method}, parts...) - metrics.MeasureSince(append([]string{"consul"}, key...), start) metrics.MeasureSince(key, start) } diff --git a/website/source/docs/agent/options.html.md b/website/source/docs/agent/options.html.md index 9ee1f5e0b6..56545d0eab 100644 --- a/website/source/docs/agent/options.html.md +++ b/website/source/docs/agent/options.html.md @@ -1340,10 +1340,6 @@ Consul will not enable TLS for the HTTP API unless the `https` port has been ass The format is compatible natively with prometheus. When running in this mode, it is recommended to also enable the option `disable_hostname` to avoid having prefixed metrics with hostname. - * `enable_deprecated_names` - Added in Consul 1.0, this enables old metric names of the format `consul.consul...` to be sent alongside - other metrics. Defaults to false. - * `statsd_address` This provides the address of a statsd instance in the format `host:port`. If provided, Consul will send various telemetry information to that instance for aggregation. This can be used to capture runtime information. This sends UDP packets only and can be used with From 75953273e21eef86544a44e27dc19be4a0819b31 Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Tue, 8 May 2018 16:25:34 -0700 Subject: [PATCH 5/7] Remove unused retry join structs from config --- agent/config/config.go | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/agent/config/config.go b/agent/config/config.go index cd06235ae7..3468eb5755 100644 --- a/agent/config/config.go +++ b/agent/config/config.go @@ -405,30 +405,6 @@ type Ports struct { Server *int `json:"server,omitempty" hcl:"server" mapstructure:"server"` } -type RetryJoinAzure struct { - ClientID *string `json:"client_id,omitempty" hcl:"client_id" mapstructure:"client_id"` - SecretAccessKey *string `json:"secret_access_key,omitempty" hcl:"secret_access_key" mapstructure:"secret_access_key"` - SubscriptionID *string `json:"subscription_id,omitempty" hcl:"subscription_id" mapstructure:"subscription_id"` - TagName *string `json:"tag_name,omitempty" hcl:"tag_name" mapstructure:"tag_name"` - TagValue *string `json:"tag_value,omitempty" hcl:"tag_value" mapstructure:"tag_value"` - TenantID *string `json:"tenant_id,omitempty" hcl:"tenant_id" mapstructure:"tenant_id"` -} - -type RetryJoinEC2 struct { - AccessKeyID *string `json:"access_key_id,omitempty" hcl:"access_key_id" mapstructure:"access_key_id"` - Region *string `json:"region,omitempty" hcl:"region" mapstructure:"region"` - SecretAccessKey *string `json:"secret_access_key,omitempty" hcl:"secret_access_key" mapstructure:"secret_access_key"` - TagKey *string `json:"tag_key,omitempty" hcl:"tag_key" mapstructure:"tag_key"` - TagValue *string `json:"tag_value,omitempty" hcl:"tag_value" mapstructure:"tag_value"` -} - -type RetryJoinGCE struct { - CredentialsFile *string `json:"credentials_file,omitempty" hcl:"credentials_file" mapstructure:"credentials_file"` - ProjectName *string `json:"project_name,omitempty" hcl:"project_name" mapstructure:"project_name"` - TagValue *string `json:"tag_value,omitempty" hcl:"tag_value" mapstructure:"tag_value"` - ZonePattern *string `json:"zone_pattern,omitempty" hcl:"zone_pattern" mapstructure:"zone_pattern"` -} - type UnixSocket struct { Group *string `json:"group,omitempty" hcl:"group" mapstructure:"group"` Mode *string `json:"mode,omitempty" hcl:"mode" mapstructure:"mode"` From 274e5a2c7ecbe17a4eb5ecd40b871c88640c0744 Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Wed, 9 May 2018 15:54:08 -0700 Subject: [PATCH 6/7] Add a note about removals to the version upgrade docs --- website/source/docs/upgrade-specific.html.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/website/source/docs/upgrade-specific.html.md b/website/source/docs/upgrade-specific.html.md index 06f2126ab4..261f63af84 100644 --- a/website/source/docs/upgrade-specific.html.md +++ b/website/source/docs/upgrade-specific.html.md @@ -14,6 +14,18 @@ details provided for their upgrades as a result of new features or changed behavior. This page is used to document those details separately from the standard upgrade flow. +## Consul 1.1.0 + +### Removal of deprecated features + +The following previously deprecated fields and config options have been removed: + + - `CheckID` has been removed from config file check definitions (use `id` instead). + - `script` has been removed from config file check definitions (use `args` instead). + - `enableTagOverride` is no longer valid in service definitions (use `enable_tag_override` instead). + - The deprecated set of metric names (beginning with `consul.consul.`) has been removed + along with the `enable_deprecated_names` option from the metrics configuration. + ## Consul 1.0.1 #### Carefully Check and Remove Stale Servers During Rolling Upgrades From a8208ec0629285d918fb8995a0f21fc3942b0537 Mon Sep 17 00:00:00 2001 From: Jack Pearkes Date: Thu, 10 May 2018 15:33:30 -0700 Subject: [PATCH 7/7] website: formatting and link to deprecation notice from 1.0 --- website/source/docs/upgrade-specific.html.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/source/docs/upgrade-specific.html.md b/website/source/docs/upgrade-specific.html.md index 261f63af84..e02eb0e742 100644 --- a/website/source/docs/upgrade-specific.html.md +++ b/website/source/docs/upgrade-specific.html.md @@ -16,14 +16,14 @@ standard upgrade flow. ## Consul 1.1.0 -### Removal of deprecated features +#### Removal of Deprecated Features The following previously deprecated fields and config options have been removed: - `CheckID` has been removed from config file check definitions (use `id` instead). - `script` has been removed from config file check definitions (use `args` instead). - `enableTagOverride` is no longer valid in service definitions (use `enable_tag_override` instead). - - The deprecated set of metric names (beginning with `consul.consul.`) has been removed + - The [deprecated set of metric names](/docs/upgrade-specific.html#metric-names-updated) (beginning with `consul.consul.`) has been removed along with the `enable_deprecated_names` option from the metrics configuration. ## Consul 1.0.1