1

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.

  1. How can I provide the agent configuration applicationinsights.json within the Azure Functions environment?
  2. Which property needs to be set to disable the additional Logger entries?

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.

sschmeck
  • 7,233
  • 4
  • 40
  • 67
  • This [table](https://learn.microsoft.com/en-us/azure/azure-monitor/app/codeless-overview#supported-environments-languages-and-resource-providers) indicate that azure function seems not support app insights agent yet. – Tiny Wang Jul 06 '21 at 07:04
  • And I think you can enable function's application insights when you creating the instance, but not through agent. See this:https://learn.microsoft.com/en-us/azure/azure-functions/configure-monitoring?tabs=v2#enable-application-insights-integration – Tiny Wang Jul 06 '21 at 07:07
  • @TinyWang, thanks for your comments. The agent is already in place and collects telementry data, but the feature is currently in preview. My question is about the configuration of the agent. – sschmeck Jul 06 '21 at 08:46
  • Seems a known bug, [Distributed Tracing enabled - logs are duplicated](https://github.com/Azure/azure-functions-java-worker/issues/385). :/ – sschmeck Jul 06 '21 at 11:54
  • Thanks for your response sir, and I always enable app insights in the function by 'click the enable button'. And your finding is very helpful, sorry for not offering help... – Tiny Wang Jul 07 '21 at 01:17

0 Answers0