Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Azure Functions Java: Duplicate log entries in Portal Log Stream since agent 3.7.0

Open
#4,698 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
azure, java
Domain
observability

Research direction

Review the agent 3.7.0 dependency change in PR #3962 and compare OpenTelemetry Instrumentation 2.9.0 with 2.10.0, focusing on JUL handling and the Portal Log Stream path. Reproduce with APPLICATIONINSIGHTS_ENABLE_AGENT=true and context.getLogger().info(), then compare behavior with agent 3.6.2. Done means the log appears once in App Insights traces without an [undefined] duplicate in Portal Log Stream.

Written by the indexing model from the issue text.

Description

Description

When APPLICATIONINSIGHTS_ENABLE_AGENT=true (the default), calls to context.getLogger().info() produce duplicate entries in the Azure Portal Log Stream:

  • [Information] from the host RPC log pipeline
  • [undefined] from the AI agent's JUL auto-instrumentation

The duplication only appears in the Portal Log Stream. In the App Insights traces table, the user log message appears once (from the agent only). The entries stored in App Insights are identical in structure between the working and broken agent versions.

Image Image

Regression

Introduced in agent 3.7.0, which upgraded OpenTelemetry Java Instrumentation from 2.9.0 to 2.10.0 (PR #3962). No AI agent code changes were made between 3.6.2 and 3.7.0 regarding JUL handling. The behavioral change comes from the upstream OTel dependency bump.

With 3.6.2, the agent captures JUL logs and sends them to App Insights without producing a duplicate in the log stream. Starting with 3.7.0, the same capture also produces an [undefined] entry in the log stream.

Agent OTel Instrumentation User log in AI traces Duplicate in Log Stream
3.6.2 2.9.0 Yes No
3.7.0+ 2.10.0+ Yes Yes

Affects all Java versions (8, 11, 17, 21, 25) on Linux Dedicated.

Workarounds

Workaround Tradeoff
APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_ENABLED=false Eliminates duplication but user logs from context.getLogger() no longer appear in App Insights traces
APPLICATIONINSIGHTS_ENABLE_AGENT=false Eliminates duplication but disables all AI agent functionality
Downgrade to agent 3.6.2 via languageWorkers__java__arguments Not viable for managed identity users (azure-functions-java-worker#820)

No workaround fully restores the 3.6.2 behavior (user logs in AI traces without log stream duplication).

Expected behavior

The agent should capture JUL logs for App Insights without producing a duplicate [undefined] entry in the log stream, as it did in 3.6.2.

Dominant language
Java
Stars
327
Forks
222
Avg merge
22h 34m
Merged PRs (30d)
14

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/ApplicationInsights-Java

All issues in microsoft/ApplicationInsights-Java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.