fix: intermittent app insights event loss in serverless env#1371
Merged
cristian-groza merged 2 commits intomainfrom Feb 26, 2026
Merged
fix: intermittent app insights event loss in serverless env#1371cristian-groza merged 2 commits intomainfrom
cristian-groza merged 2 commits intomainfrom
Conversation
cristipufu
reviewed
Feb 25, 2026
AAgnihotry
approved these changes
Feb 25, 2026
c16900b to
3045931
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
track_eventcall (not just CLI), so buffered events are sent on graceful shutdown even if the caller never explicitly flushesIngestionEndpointfrom the connection string instead of always hitting the global default endpointSynchronousSenderwith_DiagnosticSenderthat logs HTTP 400 (silently discarded by SDK), network timeouts, and other failures at WARNING levelContext
AgentRun.Startcustom events were intermittently missing from App Insights despite serverless logs confirming the SDKtrack_eventcall completed. Root causes:finallyblock, the in-memory queue was lostSenderBase.send()swallows 400 responses without logging, making schema/ikey rejections invisible_parse_connection_string()only extractedInstrumentationKey, ignoringIngestionEndpoint, causing events to route to the global endpoint instead of the regional one