Add prometheus metric for active context queue sizes
What does this MR do and why?
Adds a prometheus metric to report ActiveContext queue sizes. It is one gauge with labels for every queue along with the count. I added it to the GlobalSearchSampler since the Global Search team will own the infrastructure of ActiveContext.
Also removes the Advanced Search metrics that were marked for deprecation while we're here.
Next: if the metric is reporting, we can add a tile to an existing or new dashboard similar to what we have for Advanced Search:
References
How to set up and validate locally
- Add some refs to the code queue
Ai::ActiveContext::Collections::Code.track!({id: "hash123", routing: 1}) ::Ai::ActiveContext::MetricsUpdateService.new.execute- Get the values of the metric:
Prometheus::Client.registry.get(:active_context_queue_size).values - Clear the queues
Ai::ActiveContext::Queues::Code.clear_tracking! ::Ai::ActiveContext::MetricsUpdateService.new.execute- Get the values of the metric:
Prometheus::Client.registry.get(:active_context_queue_size).values
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.
