Move experimental warnings from init()

init() causes warnings to be emitted despite collectors not being enabled.

Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
Ben Reedy 2021-02-20 08:59:49 +10:00
parent ee146b3710
commit ce0513f69d
No known key found for this signature in database
GPG Key ID: 235C15B6086C9D7E
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,6 @@ import (
var dfsrEnabledCollectors = kingpin.Flag("collectors.dfsr.sources-enabled", "Comma-seperated list of DFSR Perflib sources to use.").Default("connection,folder,volume").String()
func init() {
log.Info("dfsr collector is in an experimental state! Metrics for this collector have not been tested.")
// Perflib sources are dynamic, depending on the enabled child collectors
var perflibDependencies []string
for _, source := range expandEnabledChildCollectors(*dfsrEnabledCollectors) {
@ -94,6 +93,7 @@ func dfsrGetPerfObjectName(collector string) string {
// NewDFSRCollector is registered
func NewDFSRCollector() (Collector, error) {
log.Info("dfsr collector is in an experimental state! Metrics for this collector have not been tested.")
const subsystem = "dfsr"
enabled := expandEnabledChildCollectors(*dfsrEnabledCollectors)

View File

@ -11,7 +11,6 @@ import (
)
func init() {
log.Info("smtp collector is in an experimental state! Metrics for this collector have not been tested.")
registerCollector("smtp", NewSMTPCollector, "SMTP Server")
}
@ -69,6 +68,7 @@ type SMTPCollector struct {
}
func NewSMTPCollector() (Collector, error) {
log.Info("smtp collector is in an experimental state! Metrics for this collector have not been tested.")
const subsystem = "smtp"
return &SMTPCollector{