486523 - Troubleshoot Job Tracking
What does this MR do and why?
This change helps collecting usage data about the troubleshooting feature. Gitlab::Tracking::AiTracking.track_event adds that said event to both PostgreSQL and Clickhouse where we will be using in analytics.
How to set up and validate locally
- Open Rails console:
gdk rails console
job = Ci::Build.last
user = job.user
context = Gitlab::Llm::Chain::GitlabContext.new(current_user: user, container: nil, resource: job,
ai_request: 'user input')
tool = Gitlab::Llm::Chain::Tools::TroubleshootJob::Executor.new(
context: context, options: 'user input')
tool.execute
ClickHouse::DumpWriteBufferWorker.new.perform(Ai::TroubleshootJobEvent.clickhouse_table_name);
UsageEvents::DumpWriteBufferCronWorker.new.perform;
Ai::TroubleshootJobEvent.last # Should return the build troubleshoot data
ClickHouse::Client.select("select * from #{Ai::TroubleshootJobEvent.clickhouse_table_name} ORDER BY timestamp DESC LIMIT 1", :main) # Should return the build troubleshoot data
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.
Related to #486523 (closed)
Edited by Amr Taha