Skip to content

Commit

Permalink
Remove the exporter Debug configuration flag and just use the informa…
Browse files Browse the repository at this point in the history
…tion available in the zap.Logger
  • Loading branch information
pcwiese committed Dec 2, 2019
1 parent 3bdc21a commit 3493c62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion exporter/azuremonitorexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ type Config struct {
InstrumentationKey string `mapstructure:"instrumentation_key"`
MaxBatchSize int `mapstructure:"maxbatchsize"`
MaxBatchIntervalInSeconds int `mapstructure:"maxbatchinterval_sec"`
Debug bool `mapstructure:"debug"`
}
3 changes: 2 additions & 1 deletion exporter/azuremonitorexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ func (f *Factory) getTransportChannel(exporterConfig *Config, logger *zap.Logger

f.TransportChannel = telemetryClient.Channel()

if exporterConfig.Debug {
// Don't even bother enabling the AppInsights diagnostics listener unless debug logging is enabled
if checkedEntry := logger.Check(zap.DebugLevel, ""); checkedEntry != nil {
appinsights.NewDiagnosticsMessageListener(func(msg string) error {
logger.Debug(msg)
return nil
Expand Down

0 comments on commit 3493c62

Please sign in to comment.