Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Add ParseHost() for parsing configured hosts in the Module #2958
Add HostParser function that can be registered with MetricSetFactories
The ParseHost() function will combine configuration data with the raw host values to produce a value appropriate for use by the MetricSet to make a connection.
Currently the HostParser parameter is optional when registering a MetricSetFactory, but it will become required once all MetricSets are updated to have a HostParser.
updated: Monday, Nov 21
I like that it is BC compatible as currently the module file normally does not exist. I would not necessarely tie it to 6.0 to make it mandatory, but only make it mandatory when we got some more experience with it to make sure external developers only need to change it once.
For the generator we should provide also an empty method which potentially logs an error, that it is not implemented.
In the future we should offer "generic" ParseHost() methods for example for Http so these can be reused.
I changed my approach on this because providing the parsing functionality at the module level wasn't sufficient. Individual MetricSets within the same module can have unique host parsing requirements. For example, nginx MetricSets for stub-status and plus-status might take the same
So my approach is to allow (require in the future) registering a
As for not breaking BWC, it looks like there's only one external MetricSet at the moment. So we won't break much when we require the