Skip to content

Backport of docs: clarify the behavior of prepending hostname to metrics into release/1.14.x#17579

Closed
hc-github-team-consul-core wants to merge 2 commits intorelease/1.14.xfrom
backport/gh-17320-update-metrics-doc/probably-promoted-lynx
Closed

Backport of docs: clarify the behavior of prepending hostname to metrics into release/1.14.x#17579
hc-github-team-consul-core wants to merge 2 commits intorelease/1.14.xfrom
backport/gh-17320-update-metrics-doc/probably-promoted-lynx

Conversation

@hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #17521 to be assessed for backporting due to the inclusion of the label backport/1.14.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@huikang
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: POST https://api.github.com/repos/hashicorp/consul/merges: 409 Merge conflict []

The below text is copied from the body of the original PR.


Description

The prepended name to the gauge metrics causes some confusion on how to query the metrics. According to the go-metrics' godoc, EnableHostname is only applicable to gauge metrics:

EnableHostname   	bool // Enable prefixing gauge values with hostname”

Consul initializes the metrics.config with the agent configuration value “telemetry.disable_hostname”.

consul/lib/telemetry.go

Lines 327 to 329 in 720dda7

func configureSinks(cfg TelemetryConfig, memSink metrics.MetricSink) (metrics.FanoutSink, error) {
metricsConf := metrics.DefaultConfig(cfg.MetricsPrefix)
metricsConf.EnableHostname = !cfg.DisableHostname

Therefore, if disable_hostname is false, hostname will be added to gauge metric names (the default behavior); otherwise, no hostname will be prepended to the metrics name of gauge type. That said, disable_hostname has no impact on other types of metrics.

This PR clarifies this behavior in consul's doc.

Links

fix #17320

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/gh-17320-update-metrics-doc/probably-promoted-lynx branch from edc9478 to 17ef0ef Compare June 5, 2023 23:47
@hashicorp-cla
Copy link

hashicorp-cla commented Jun 5, 2023

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


1 out of 2 committers have signed the CLA.

  • huikang
  • temp

temp seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA. If you already have a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved Consul Bot automated PR

@vercel vercel bot temporarily deployed to Preview – consul-ui-staging June 5, 2023 23:51 Inactive
@vercel vercel bot temporarily deployed to Preview – consul June 5, 2023 23:52 Inactive
@huikang
Copy link
Collaborator

huikang commented Jun 22, 2023

not applicable to 1.14 since the file doesn't exit, so closing

@huikang huikang closed this Jun 22, 2023
@github-actions github-actions bot deleted the backport/gh-17320-update-metrics-doc/probably-promoted-lynx branch August 29, 2025 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants