feat(analytics): extract coding agent from client User-Agent header

What does this MR do and why?

Extract the coding agent identifier from the x-client-user-agent gRPC header and send it in Snowplow gkg_query_executed events. This lets us tell apart queries from coding agents (e.g. Claude Code via glab) and regular tool calls in analytics.

  • Parse Coding-Agent/<name> token from the user-agent string (e.g. glab/1.50.0 Coding-Agent/claude-code yields claude-code)
  • Add coding_agent as a tracing span field on all gRPC handlers
  • Pass the value into the orbit_query Snowplow context via AnalyticsObserver
  • Bump labkit-rs to 0cb89c1 which adds coding_agent to OrbitQueryContext (schema 2-0-1, iglu!191)

Relates to https://gitlab.com/gitlab-org/iglu/-/merge_requests/191 Relates to gitlab-org/rust/labkit-rs!69 (merged)

Testing

Unit tests cover parsing (present, absent, no header) and the analytics path (field serialized when set, omitted when None). Integration test updated for schema 2-0-1.

Performance Analysis

  • This merge request does not introduce any performance regression. If a performance regression is expected, explain why.
Edited by Jean-Gabriel Doyon

Merge request reports

Loading