Skip to content

Add zoekt_nodes online status monitoring to gitlab-exporter

Closes #117

Description

This change adds monitoring for the health status of Zoekt search nodes in GitLab. The code introduces a new database query that checks if each search node has been active within the last minute - nodes that haven't been seen recently are marked as offline (0), while active nodes are marked as online (1). This status information is then collected and exposed as a metric that can be monitored, allowing administrators to track which search nodes are working properly and which ones might have issues. The change also includes tests to ensure the new functionality works correctly.

Screenshots

Before After
Screenshot_2025-10-23_at_17.50.56 Screenshot_2025-10-23_at_17.49.46

Test locally

  • Switch to the MR branch.
  • Start the server
bin/gitlab-exporter web -c config/gitlab-exporter.yml

Query reports

SELECT
    id,
    CASE WHEN last_seen_at < NOW() - INTERVAL '1 minute' THEN
        0
    ELSE
        1
    END AS status
FROM
    zoekt_nodes;

Currently there are 36 zoekt_nodes. This table will always be very small.

Edited by Ravi Kumar

Merge request reports

Loading