File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,29 +62,36 @@ func applyEnvVars(cfg *Config) {
6262 if host := os .Getenv ("BROTHER_EXPORTER_SERVER_HOST" ); host != "" {
6363 cfg .Server .Host = host
6464 }
65+
6566 if portStr := os .Getenv ("BROTHER_EXPORTER_SERVER_PORT" ); portStr != "" {
6667 if port , err := parseInt (portStr ); err == nil {
6768 cfg .Server .Port = port
6869 }
6970 }
71+
7072 if level := os .Getenv ("BROTHER_EXPORTER_LOG_LEVEL" ); level != "" {
7173 cfg .Logging .Level = level
7274 }
75+
7376 if format := os .Getenv ("BROTHER_EXPORTER_LOG_FORMAT" ); format != "" {
7477 cfg .Logging .Format = format
7578 }
79+
7680 if intervalStr := os .Getenv ("BROTHER_EXPORTER_METRICS_DEFAULT_INTERVAL" ); intervalStr != "" {
7781 if interval , err := time .ParseDuration (intervalStr ); err == nil {
7882 cfg .Metrics .Collection .DefaultInterval = promexporter_config.Duration {Duration : interval }
7983 cfg .Metrics .Collection .DefaultIntervalSet = true
8084 }
8185 }
86+
8287 if host := os .Getenv ("BROTHER_EXPORTER_PRINTER_HOST" ); host != "" {
8388 cfg .Printer .Host = host
8489 }
90+
8591 if community := os .Getenv ("BROTHER_EXPORTER_PRINTER_COMMUNITY" ); community != "" {
8692 cfg .Printer .Community = community
8793 }
94+
8895 if printerType := os .Getenv ("BROTHER_EXPORTER_PRINTER_TYPE" ); printerType != "" {
8996 cfg .Printer .Type = printerType
9097 }
You can’t perform that action at this time.
0 commit comments