Skip to content

gvfs-helper: emit X-Session-Id headers for requests#862

Merged
mjcheetham merged 2 commits intomicrosoft:vfs-2.53.0from
derrickstolee:session-id
Mar 27, 2026
Merged

gvfs-helper: emit X-Session-Id headers for requests#862
mjcheetham merged 2 commits intomicrosoft:vfs-2.53.0from
derrickstolee:session-id

Conversation

@derrickstolee
Copy link
Copy Markdown

A common problem when tracking GVFS Protocol queries is that we don't have a way to connect client and server interactions. This is especially true in the typical case where a cache server deployment is hidden behind a load balancer. We can't even determine which cache server was used for certain requests!

Add some client-identifying data to the HTTP queries using the X-Session-Id header. This will by default identify the helper process using its SID. If configured via the new gvfs.sessionKey config, it will prefix this SID with another config value.

For example, Office monorepo users have an 'otel.trace2.id' config value that is a pseudonymous identifier. This allows telemetry readers to group requests by enlistment without knowing the user's identity at all. Users could opt-in to provide this identifier for investigations around their long-term performance or issues. This change makes it possible to extend this to cache server interactions.

  • This change only applies to interactions with Azure DevOps and the
    GVFS Protocol.

mjcheetham
mjcheetham previously approved these changes Mar 27, 2026
@mjcheetham
Copy link
Copy Markdown
Member

@derrickstolee looks like only a whitespace issue is left. (We can ignore the CodeQL failure - this is a know issue with the setup.)

In order to assist with tracking user experience between the Git client
and the GVFS Protocol servers, start sending the SID for the client Git
process over the wire as the X-Session-Id header. Insert this header to
all curl requests for each protocol.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
In different engineering systems, there may already be pseudonymous
identifiers stored in the local Git config. For Office and 1JS, this is
present in the 'otel.trace2.id' config value.

We'd like to be able to collect server-side telemetry based on these
pseudonymous identifiers, so prefxing the X-Session-Id header with this
value is helpful.

We could create a single 'gvfs.sessionPrefix' config key that stores
this value, but then we'd need to duplicate the identifier and risk
drift in the value. For now, we create this indirection by saying "what
config _key_ should Git use to look up the value to add as a prefix?"

Signed-off-by: Derrick Stolee <stolee@gmail.com>
@mjcheetham mjcheetham merged commit e586f99 into microsoft:vfs-2.53.0 Mar 27, 2026
66 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