Add MCP telemetry tracking events
What does this MR do and why?
Creates two new events to track MCP related calls for tracking finish and start of mcp tool calls. The following adds these two events as internal tool calls and AI related event calls to track how often our mcp services is being used.
Relates to issue #574629
This MR was created by Duo in Session 1164223
Changes
- Add event definitions for
start_mcp_tool_callandfinish_mcp_tool_call - Implement telemetry tracking in MCP tool execution flow
- Capture contextual data including tool name, success/failure status, and error details
- Enable visibility into MCP server usage patterns and adoption blockers
References
Screenshots or screen recordings
How to set up and validate locally
Verify Internal Events are being called
- Run
rails runner scripts/internal_events/monitor.rb start_mcp_tool_call finish_mcp_tool_callin your terminal - Make a MCP related tool call by setting up your MCP Server
Verify AI Internal Events are added
- Go to postgres
gdk psql - Execute
select * from ai_usage_events order by id desc limit 1 - You should see an event record with filled
user_id,namespace_id, and extras includingproject_id,session_id,environment
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Nathan Weinshenker
