common
common copied to clipboard
Allow MetricFamilyToText to omit Type information if specified
Similar to HELP
, it would be nice to have the option to toggle TYPE
being included
// Comments, first HELP, then TYPE.
if in.Help != nil {
}
Some context: https://github.com/influxdata/telegraf/pull/11417
Note: I would like to make this contribution 🙂
Hmm ok, re-reading, MetricFamily.Type
cannot legitimately be nil. So far I see a few options (going to try to look for a better one)
- if
in.Help
is nil, we can also node show the Type comment... doesn't feel quite right - add a func parameter (but it would have to be a bool arg, we couldn't apply an Option func) but this method is exported and that's an annoying change for most downstream users
Each of those definitely requires some sign-off from maintainers (hi @roidelapluie)
E: I couldn't see a nice way to do it here.