Skip to content

fix(logging): prevent duplicate Application Insights traces#749

Merged
qtomlinson merged 3 commits intoclearlydefined:masterfrom
qtomlinson:qt/fix-dup-logging
Mar 25, 2026
Merged

fix(logging): prevent duplicate Application Insights traces#749
qtomlinson merged 3 commits intoclearlydefined:masterfrom
qtomlinson:qt/fix-dup-logging

Conversation

@qtomlinson
Copy link
Copy Markdown
Collaborator

@qtomlinson qtomlinson commented Mar 25, 2026

Problem:
Duplicate trace rows were appearing in Application Insights for the same log event, often with different customProperties payloads.

Root cause:
Two telemetry paths were active at the same time:

  • Explicit trace emission through the custom Winston to Application Insights transport.
  • SDK auto-collection of logger/console output.

This caused the same logical log to be ingested twice with different property envelopes.

Fix:
Disable SDK console/logger auto-collection explicitly with setAutoCollectConsole(false, false), keeping a single, intentional telemetry path through the custom transport.

Problem:
Duplicate trace rows were appearing in Application Insights for the same log event, often with different customProperties payloads.

Root cause:
Two telemetry paths were active at the same time:
- Explicit trace emission through the custom Winston to Application Insights transport.
- SDK auto-collection of logger/console output.
This caused the same logical log to be ingested twice with different property envelopes.
Fix:
Disable SDK console/logger auto-collection explicitly with setAutoCollectConsole(false, false), keeping a single, intentional telemetry path through the custom transport.
@qtomlinson qtomlinson requested a review from JamieMagee March 25, 2026 04:06
@qtomlinson qtomlinson marked this pull request as ready for review March 25, 2026 04:09
@qtomlinson qtomlinson merged commit bd3be97 into clearlydefined:master Mar 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants