FE: Add event tracking when Custom and Foundational Agents are chatted with
What does this MR do and why?
- Adds tracking for the
trigger_ai_catalog_itemevent when a chat is sent to a custom or foundational agent via Duo Chat's web UI - Adds
foundational_item_refas an additional property to thetrigger_ai_catalog_itemevent- Foundational agents don't have a numerical part to their id that can be extracted the same way custom agents do.
-
foundational_item_refidentifies the specific foundational agent being tracked - Discussion about this in this thread
- I previously added
foundationalas an additional property but decided it was redundant - relevant thread
- I previously added
References
Related issues
- FE: Add event tracking when Custom and Foundati... (#584184 - closed) • Allison Villa • 18.11
- Improve AI Catalog metrics: Where context is si... (#591972) • Unassigned
Relevant documentation
- https://docs.gitlab.com/development/internal_analytics/internal_event_instrumentation/quick_start/
- https://docs.gitlab.com/development/internal_analytics/internal_event_instrumentation/local_setup_and_debugging/
Screenshots or screen recordings
No UI changes
How to set up and validate locally
- Prerequisite: Have GitLab Duo set up in your GDK
- Have a Duo-enabled group and project in your GDK created by the Duo setup task above
- If you don’t see “AI Catalog” under Explore in your GDK, check that the
global_ai_catalogfeature flag is enabled - General DAP documentation: https://docs.gitlab.com/development/duo_agent_platform/
- Enter a project in your Duo-enabled group and create a custom agent, if you don't have one already
- In a terminal, run the internal events monitor with
rails runner scripts/internal_events/monitor.rb trigger_ai_catalog_item - Start a new chat from the DAP sidebar by clicking the "pencil" icon and selecting a foundational agent (one with the tanuki icon)
- Send a message and check the internal events monitor that the event was tracked
- Start another new chat with a custom agent (one you created or one that doesn't have the tanuki icon)
- Send a message and check the internal events monitor again
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 Allison Villa
