Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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.15.

🚨

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: unable to process merge commit: "0f4c45088c68c448905dca4e8463bf23f3c4f39b", automatic backport requires rebase workflow

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/publicly-fine-tuna branch from 315d6a1 to 016b680 Compare June 5, 2023 23:47
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/gh-17320-update-metrics-doc/publicly-fine-tuna branch from 6e78138 to 0edc8fa Compare June 5, 2023 23:47
@github-actions github-actions bot added the type/docs Documentation needs to be created/updated/clarified label Jun 5, 2023
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:57 Inactive
@huikang huikang marked this pull request as ready for review June 7, 2023 02:59
@huikang huikang requested a review from a team as a code owner June 7, 2023 02:59
@huikang huikang merged commit 104100d into release/1.15.x Jun 7, 2023
@huikang huikang deleted the backport/gh-17320-update-metrics-doc/publicly-fine-tuna branch June 7, 2023 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants