I enabled the Application Insights agent for my Java Function App as described at How to enable distributed tracing for Java Function apps?
XDT_MicrosoftApplicationInsights_Java="1"
ApplicationInsightsAgent_EXTENSION_VERSION="~2"
While it collects a lot of useful telemetry data, it creates traces of the ExecutionContext#getLogger() twice. The duplicated entries contain different customDimensions (e.g. {"LoggingLevel":"INFO","SourceType":"Logger"}) and are create just before the regular entries.
In addition, the sdkVersion property of the trace entry contains awr_java:3.0.2 instead of azurefunctions: 3.0.15733.0.
I would like to disable the Auto collected Logger messages, but I have 2 issues.
- How can I provide the agent configuration
applicationinsights.jsonwithin the Azure Functions environment? - Which property needs to be set to disable the additional
Loggerentries?
Configuration options - Azure Monitor Application Insights for Java suggests to put the applicationinsights.json next to the agent or set path via APPLICATIONINSIGHTS_CONFIGURATION_FILE. Since the agent and also the destination of the deployed Function App is managed by the runtime, it isn't obvious, how to setup the agent appropriately.