diff --git a/exporter/azuremonitorexporter/config.go b/exporter/azuremonitorexporter/config.go index 5b7a73d4f496..2471e0f68dd2 100644 --- a/exporter/azuremonitorexporter/config.go +++ b/exporter/azuremonitorexporter/config.go @@ -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"` } diff --git a/exporter/azuremonitorexporter/factory.go b/exporter/azuremonitorexporter/factory.go index f219b3543ecf..cb3249dfd73e 100644 --- a/exporter/azuremonitorexporter/factory.go +++ b/exporter/azuremonitorexporter/factory.go @@ -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