diff --git a/exporter/azuremonitorexporter/trace_to_envelope.go b/exporter/azuremonitorexporter/trace_to_envelope.go index f9ca56035026d..eb5d454d2f716 100644 --- a/exporter/azuremonitorexporter/trace_to_envelope.go +++ b/exporter/azuremonitorexporter/trace_to_envelope.go @@ -106,7 +106,7 @@ func spanToTelemetryTraces( spanEvent := span.Events().At(i) // Skip non-exception events if configured - if spanEvent.Name() != exceptionSpanEventName && !spanEventsEnabled { + if !spanEventsEnabled && spanEvent.Name() != exceptionSpanEventName { continue } diff --git a/exporter/azuremonitorexporter/traceexporter_test.go b/exporter/azuremonitorexporter/traceexporter_test.go index 6dae67f72de64..ad6a7e2427ecd 100644 --- a/exporter/azuremonitorexporter/traceexporter_test.go +++ b/exporter/azuremonitorexporter/traceexporter_test.go @@ -91,7 +91,7 @@ func TestExporterTraceDataCallbackSingleSpanWithSpanEvents(t *testing.T) { } // Tests the export onTraceData callback with a single Span that fails to produce an envelope -// TODO: Depercate this test when transport channel is removed as we will not be using envelopes anymore +// TODO: Deprecate this test when transport channel is removed as we will not be using envelopes anymore func TestExporterTraceDataCallbackSingleSpanNoEnvelope(t *testing.T) { mockTransportChannel := getMockTransportChannel() mockTelemetryClient := getMockTelemetryClient() @@ -144,4 +144,4 @@ func getExporter(config *Config, transportChannel transportChannel, telemetryCli telemetryClient: telemetryClient, logger: zap.NewNop(), } -} \ No newline at end of file +}