Expose the GitLab Exporter Zoekt probe so search_zoekt_* metrics are available on GitLab Self-Managed
Problem to solve
The 13 database-derived search_zoekt_* gauges are documented for GitLab Self-Managed in
the Prometheus metrics reference,
but no GitLab Self-Managed installation can emit them, because the GitLab Exporter Zoekt probe
is never referenced in the generated exporter configuration.
Administrators setting up exact code search have no Prometheus signal for Zoekt node health, index state, or indexing task backlog.
Reported by a customer running GitLab 19.4.3 on the Helm chart (internal ticket, Ultimate).
Verified findings
The probe code ships in the image. Database::ZoektProber and ZoektCollector are defined in
lib/gitlab_exporter/database/zoekt.rb
and are present at gem tag 17.0.2, which is the appVersion pinned by
charts/gitlab/charts/gitlab-exporter/Chart.yaml at chart v10.4.3 (GitLab 19.4.3).
The chart configuration never references it.
charts/gitlab/charts/gitlab-exporter/templates/configmap.yaml
renders the database, database_bloat, sidekiq, ruby and metrics probe groups, covering
ci_builds, tuple_stats, rows_count, pg_sequences and optionally geo_node_status. There is
no zoekt entry in either the database or the metrics group, and values.yaml exposes no key
to add one. Because the config is mounted from the ConfigMap with subPath, extraVolumeMounts
cannot substitute a replacement file.
The Linux package has the same gap.
files/gitlab-cookbooks/monitoring/templates/gitlab-exporter.yml.erb omits the probe at tag
19.4.3+ee.0, so this is not specific to the chart.
Probe group names become URL paths. WebExporter.mount_probes calls
@server.mount_proc("/#{probe_name}"), so a probe placed in the database group is served on
/database, while the chart's ServiceMonitor scrapes metrics.path: /metrics. Placement therefore
determines whether a default scrape picks the metrics up.
Proposal
-
Add the Zoekt probe to the rendered exporter configuration:
zoekt: class_name: Database::ZoektProber <<: *db_common -
Gate it behind a values key, mirroring the existing
probeGeopattern, so installations without Zoekt do not pay for the queries. For exampleprobeZoekt, defaultfalse. -
Place it in the
metricsprobe group, or document the extra/databasescrape target, so that a default Prometheus configuration collects the metrics. -
Mirror the change in
gitlab-org/omnibus-gitlabso both install methods behave the same. -
Update the documentation note added by gitlab-org/gitlab#603839 (closed) once the probe is available.
Notes
The probe queries zoekt_nodes, zoekt_indices, zoekt_repositories and zoekt_tasks. Worth
checking the cost of ZOEKT_INDICES_STORAGE_QUERY and ZOEKT_NODE_TASKS_QUERY on large instances
before enabling by default, which is a further argument for an opt-in value.
GitLab.com appears to configure this probe through its own infrastructure configuration rather than through these templates, which would explain why the gap went unnoticed. See the rollout checklist in gitlab-org/gitlab#507875 (closed).
References
- Exporter source:
lib/gitlab_exporter/database/zoekt.rb - Docs enumerating the metrics: gitlab-org/gitlab#603839 (closed)
- Parent epic: Zoekt - monitoring and alerting