Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#4,698 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
azure, java
Lĩnh vực
observability

Hướng nghiên cứu

Xem xét thay đổi dependency của agent 3.7.0 trong PR #3962 và so sánh OpenTelemetry Instrumentation 2.9.0 với 2.10.0, tập trung vào việc xử lý JUL và đường dẫn Portal Log Stream. Tái hiện bằng APPLICATIONINSIGHTS_ENABLE_AGENT=true và context.getLogger().info(), sau đó so sánh hành vi với agent 3.6.2. Được xem là hoàn tất khi log xuất hiện một lần trong các trace của App Insights mà không có bản sao [undefined] trong Portal Log Stream.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
327
Fork
222
Merge trung bình
22 giờ 34 phút
Pull request đã merge (30 ngày)
14

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/ApplicationInsights-Java

Tất cả issue của microsoft/ApplicationInsights-Java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.