-
Notifications
You must be signed in to change notification settings - Fork 208
Description
Expected behavior
Exceptions are recorded regardless of what level is specified by the APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL variable.
Actual behavior
When the APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL variable is set to OFF, exceptions are filtered out.
Auto-collected exceptions or those recorded with recordException() are exported since there is an AgentSpanExporter log, but they do not appear in the App Insights UI.
UPD: checked with FATAL level, also doesn't work, but it works with ERROR.
References
-
On the "Configuration options: Azure Monitor Application Insights for Java" page, it says:
Log4j, Logback, JBoss Logging, and java.util.logging are autoinstrumented. Logging performed via these logging frameworks is autocollected.
and the variable can be used to set the level.
-
On the "Exceptions | OpenTelemetry" page, it says:
An exception SHOULD be recorded as an Event on the span during which it occurred if and only if it remains unhandled when the span ends and causes the span status to be set to ERROR.
-
I can see a reason why disabled logging filters exceptions (because exceptions are actually events), but I don't think it's a clear behavior.
-
On the "Sampling overrides - Azure Monitor Application Insights for Java" page, it says:
telemetryType (telemetryKind in Application Insights 3.4.0) must be one of request, dependency, trace (log), or exception.
where the exception is of a different type from
trace(log; events) and therefore must be recorded in a different way.
To Reproduce
- Exceptions appear when
slf4jis not used -issue-4095/exceptions-without-slf4j/. - Exceptions disappear when
slf4jis used -issue-4095/no-exceptions-with-slf4j/.
System information
- SDK Version: 3.7.0
- OS type and version: Linux
- Using spring-boot? No
- Additional relevant libraries (with version, if applicable):
org.slf4j:slf4j-api,io.opentelemetry:opentelemetry-api,io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations.

