Skip to content

Commit 3493c62

Browse files
committed
Remove the exporter Debug configuration flag and just use the information available in the zap.Logger
1 parent 3bdc21a commit 3493c62

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

exporter/azuremonitorexporter/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ type Config struct {
2626
InstrumentationKey string `mapstructure:"instrumentation_key"`
2727
MaxBatchSize int `mapstructure:"maxbatchsize"`
2828
MaxBatchIntervalInSeconds int `mapstructure:"maxbatchinterval_sec"`
29-
Debug bool `mapstructure:"debug"`
3029
}

exporter/azuremonitorexporter/factory.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ func (f *Factory) getTransportChannel(exporterConfig *Config, logger *zap.Logger
9494

9595
f.TransportChannel = telemetryClient.Channel()
9696

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

0 commit comments

Comments
 (0)