这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Conversation

@tdinucci
Copy link
Member

@tdinucci tdinucci commented Dec 12, 2019

Description

Resolves #2438

Type of change

From the following, please check the options that are relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

See linked ticket for details on breaking change

How has this been tested?

  • Unit tests
  • Manual testing of Bosun and SCollector (with OpenTSDB and Redis)

Checklist:

  • This contribution follows the project's code of conduct
  • This contribution follows the project's contributing guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@tdinucci tdinucci force-pushed the configurable-hostname branch from bd2efc4 to 96288b3 Compare December 12, 2019 12:07
// Data for Hosts (Hypervisors)
for _, host := range hostSystems {
name := util.Clean(host.Name)
name, err := util.GetHostManager().GetNameProcessor().FormatName(host.Name)
Copy link
Member

Choose a reason for hiding this comment

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

Is this change in behaviour intended? The previous version didn't perform a validity check on the host name. The name is only used in an OpenTSDB tag, which allows more characters than the RFC for host names: http://opentsdb.net/docs/build/html/user_guide/writing/index.html#metrics-and-tags

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes this was intended and the reason I oddly chose to tick both breaking and non-breaking change in PR message.

Prior to now the Bosun hostname always comes from a call to os.Hostname() and this should always be valid.

It has been possible to override the hostname with SCollector however I can't imagine why anyone would have wanted to specify an invalid (according to IETF rules) hostname and if an invalid name were provided then it could end up causing problems elsewhere which would be much harder to debug than if a clear error was raised if an invalid hostname was provided.

@muffix
Copy link
Member

muffix commented Dec 12, 2019

If you replace Addresses #2438 with Resolves #2438 in the PR description, the issue will automatically closed when this is merged.

Copy link
Member

@muffix muffix left a comment

Choose a reason for hiding this comment

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

This is loooking great, thanks. 👍

@muffix muffix merged commit e0547ae into bosun-monitor:master Feb 10, 2020
muffix added a commit to muffix/bosun that referenced this pull request May 11, 2020
Fixes a bug that was introduced with bosun-monitor#2439 which now requires the
initialisation of the HostManager on startup. That was forgotten to add
to the tsdbrelay command, causing it to panic on startup.

Fixes: 2475
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Configurable Bosun Hostname

2 participants