Add flag for disabling 1.9 metrics backwards compatibility and warnings when set to default #8877
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a follow up to #8271 to enable
consul.api.http
by default and give users a flag to disable metrics underconsul.http...
. We provide a deprecation warning if users are emitting the deprecated metrics.Adding a Consul Config Field
This is a checklist of all the places you need to update when adding a new field
to config. There may be a few other special cases not included but this covers
the majority of configs.
We suggest you copy the raw markdown into a gist or local file and check them
off as you go (you can mark them as done by replace
[ ]
with[x]
so githubrenders them as checked). Then please include the completed lists you worked
through in your PR description.
Examples of special cases this doesn't cover are:
-dev
modeor differences between OSS and Enterprise.
syntax or semantics of anything
There are four specific cases covered with increasing complexity:
Adding a Simple Config Field for Client Agents
agent/config/config.go
.agent/config/runtime.go
.agent/config/builder.go
totranslate.
TestFullConfig
inagent/config/runtime_test.go
, it should fail now, thenadd the same random value to the expected struct in that test so it passes
again.
TestSanitize
in the samefile. (Running the test first gives you a nice diff which can save working
out where etc.)
some cases or with some values (often true).
agent/config/builder.go
.TestConfigFlagsAndEdgeCases
inagent/config/runtime_test.go
.DefaultSource
inagent/config/defaults.go
.TestConfigFlagsAndEdgeCases
inagent/config/runtime_test.go
.any state the feature needs changing. This needs to be added to one or
more of the following places:
ReloadConfig
inagent/agent.go
if it needs to affect the localclient state or another client agent component.
ReloadConfig
inagent/consul/client.go
if it needs to affectstate for client agent's RPC client.
agent/agent_test.go
similar to others with prefixTestAgent_reloadConfig*
.website/source/docs/agent/options.html.md
.Done! You can now use your new field in a client agent by accessing
s.agent.Config.<FieldName>
.