Add telemetry events to mount initialization phases#2033
Open
tyrielv wants to merge 1 commit into
Open
Conversation
Emit Keywords.Telemetry events at each phase transition during mount so that slow or hung mounts can be diagnosed from server-side telemetry. Previously, there was a telemetry gap between VFS.EnlistmentInfo and VFS.Mount 'Virtual repo is ready' — if any intermediate phase stalled, no Application Insights events were recorded. New MountPhase events with elapsed-since-mount-start timestamps: - ParallelMountStarted: parallel auth+local validation begins - NetworkValidationComplete: auth + /gvfs/config query done (duration) - LocalValidationComplete: git/hooks/fs validation + config done (duration) - ParallelMountComplete: both parallel tasks finished - CacheServerResolved: cache server URL resolved - LocalCacheHealthy: local object cache validated - ContextCreated: GVFSContext initialized - HooksUpdated: hook binaries installed (or skipped for worktrees) - VirtualizationStarting: about to start ProjFS callbacks Note: RetryConfig defaults are 6 retries x 30s timeout = 210s worst case for the network task. When auth is expired/stuck, the mount can block for up to 210s in TryInitializeAndQueryGVFSConfig with no telemetry — these new events make that visible. Assisted-by: Claude Opus 4.6 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
47f7fd6 to
403dc23
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.
Problem
When the GVFS mount process hangs during initialization, there is NO telemetry in Application Insights between the
VFS.EnlistmentInfoevent andVFS.Mount 'Virtual repo is ready'. This makes it impossible to diagnose which phase is stuck from server-side telemetry.A user experienced a mount that took 136 seconds to initialize (normally <1s), and we could only see a 60-second gap in telemetry with no events. The mount was stuck in the auth/network validation phase.
Solution
Add
Keywords.Telemetryevents at each phase transition duringMountWithLockAcquired. Each event uses a consistentMountPhaseevent name with aPhasefield and anElapsedMsfield measuring time since mount start.New MountPhase events
ParallelMountStartedNetworkValidationCompleteLocalValidationCompleteParallelMountCompleteCacheServerResolvedLocalCacheHealthyContextCreatedHooksUpdatedVirtualizationStartingThe existing
VFS.Mount 'Virtual repo is ready'event serves as the final phase.Analysis: Network timeout budget
RetryConfigdefaults: 6 retries x 30s timeout = 210s worst case forTryInitializeAndQueryGVFSConfig. When auth is expired or network is unreachable, the mount can block for up to 210s in the network task with no telemetry — these new events make that gap visible and pinpoint exactly which phase is stuck.Testing
dotnet build GVFS.Mount.csproj)Keywords.Telemetryso they flow to Application Insights