Skip to content

Add new metric for advanced search limited indexing setting

What does this MR do and why?

Background

Related to #214601 (closed) and #413855

Index integrity is currently tied to search results, but it would be nice to move to a CronWorker. That CronWorker needs the ability to query all indexed projects which isn't possible due to the use of indexing limiting and allowing any namespace/group/subgroup to be limited. The queries just time out. It would be a lot easier to iterate through projects if top level namespaces were the only types allowed for indexing limiting.

I'd like to learn how customers are using limited indexing to determine if limiting could change to only top level namespaces. Currently any group (including subgroups) can used. On GitLab.com, we use it at the top level namespace only.

The what

This MR introduces a service ping metric to see how many customers are using indexing limiting for Advanced Search.

Screenshots or screen recordings

N/A

How to set up and validate locally

  1. setup GDK for elasticsearch, enable indexing

image

  1. enable index limiting in the Admin UI - Settings - Advanced Search (add any namespace or project)

image

  1. test that elastic_search_limited_indexing_enabled is true (might need to wait for cache to expire)

    sp = Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values)
    sp['elasticsearch_limited_indexing_enabled'] # should be true
  2. disable index limiting in the Admin UI - Settings - Advanced Search

  3. test that elastic_search_limited_indexing_enabled is true

    sp = Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values)
    sp['elasticsearch_limited_indexing_enabled'] # should be false
  4. disable Advanced Search indexing

  5. verify that elastic_search_limited_indexing_enabled does not get populated

    sp = Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values)
    sp['elasticsearch_limited_indexing_enabled'] # should be nil

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Terri Chu

Merge request reports