tutorial

Monitoring ZincSearch with Vigilmon: Health API Checks, Index Status, and Uptime Alerting

How to monitor ZincSearch (Zinc) with Vigilmon — REST API health checks, index availability, built-in healthcheck endpoint monitoring, and alerting for this lightweight Elasticsearch alternative.

ZincSearch (formerly Zinc) is a lightweight, single-binary full-text search engine designed as a simpler, lower-resource alternative to Elasticsearch. It is widely used for log search, application telemetry, and small-to-medium search workloads. Because ZincSearch runs as a single process with no cluster coordination overhead, outages tend to be all-or-nothing — when it goes down, every search query fails. Vigilmon gives you external visibility into ZincSearch availability through its built-in health endpoint and REST API.

What You'll Build

  • A monitor on ZincSearch's /healthz endpoint
  • An index-level availability check using the ZincSearch REST API
  • A heartbeat monitor for document ingestion pipelines
  • Alerting with appropriate thresholds for a search engine

Prerequisites

  • A running ZincSearch instance accessible over HTTP or HTTPS
  • ZincSearch API accessible at http://zinc.example.com:4080 (default port)
  • A free account at vigilmon.online

Step 1: Verify the ZincSearch Health Endpoint

ZincSearch ships with a built-in health check endpoint at /healthz:

curl -s http://zinc.example.com:4080/healthz

A healthy instance returns:

{"status":"ok"}

This endpoint requires no authentication and is purpose-built for monitoring probes. Confirm it responds before setting up Vigilmon:

curl -i http://zinc.example.com:4080/healthz
# HTTP/1.1 200 OK
# Content-Type: application/json; charset=utf-8
# {"status":"ok"}

If ZincSearch is behind a reverse proxy (Nginx, Caddy, Traefik), verify the health endpoint is accessible through the proxy and not blocked by authentication middleware:

# nginx.conf — allow /healthz without auth
location /healthz {
    proxy_pass http://localhost:4080;
    # No auth_basic here
}

location / {
    proxy_pass http://localhost:4080;
    auth_basic "ZincSearch";
    auth_basic_user_file /etc/nginx/.htpasswd;
}

Step 2: Create a Vigilmon HTTP Monitor for ZincSearch

  1. Log in to VigilmonAdd Monitor → HTTP.
  2. URL: http://zinc.example.com:4080/healthz.
  3. Check interval: 60 seconds.
  4. Response timeout: 10 seconds.
  5. Expected status: 200.
  6. Keyword: "status":"ok".
  7. Click Save.

Vigilmon probes this endpoint from multiple geographic locations simultaneously. A single-region probe failure will not trigger an alert — Vigilmon requires multi-region consensus before opening an incident, which prevents alert fatigue from transient network issues.

What This Catches

| Failure Mode | Process Monitor | Vigilmon | |---|---|---| | ZincSearch process crash | ✓ | ✓ | | Port 4080 not accessible | ✗ | ✓ | | Reverse proxy misconfiguration blocking requests | ✗ | ✓ | | Network partition between clients and ZincSearch | ✗ | ✓ | | ZincSearch returning non-OK health status | ✗ | ✓ |


Step 3: Monitor Index Availability via the REST API

ZincSearch provides a REST API for listing and querying indices. Monitor your critical indices to detect accidental deletion or indexing failures:

curl -u admin:password http://zinc.example.com:4080/api/index

This returns a list of all indices. You can check that a specific index exists by looking for it in the response:

curl -u admin:password http://zinc.example.com:4080/api/index | grep '"name":"my-logs"'

Build a lightweight health wrapper to expose an index check as a simple HTTP GET:

// zinc-health.js — index availability wrapper
const express = require('express');
const axios = require('axios');

const app = express();
const ZINC_URL = process.env.ZINC_URL || 'http://localhost:4080';
const ZINC_USER = process.env.ZINC_USER || 'admin';
const ZINC_PASS = process.env.ZINC_PASS || 'password';

app.get('/health/zinc/index/:name', async (req, res) => {
  try {
    const response = await axios.get(`${ZINC_URL}/api/index`, {
      auth: { username: ZINC_USER, password: ZINC_PASS },
      timeout: 5000,
    });

    const indices = response.data?.list || [];
    const found = indices.some(idx => idx.name === req.params.name);

    if (!found) {
      return res.status(503).json({ status: 'missing', index: req.params.name });
    }

    return res.status(200).json({ status: 'ok', index: req.params.name });
  } catch (err) {
    return res.status(503).json({ status: 'down', error: err.message });
  }
});

app.listen(3001);

Deploy this wrapper alongside ZincSearch and add an index monitor in Vigilmon:

  1. Add Monitor → HTTP.
  2. URL: http://your-app.example.com:3001/health/zinc/index/my-logs.
  3. Check interval: 2 minutes.
  4. Expected status: 200.
  5. Keyword: "status":"ok".

Step 4: Monitor Search Query Availability

For production systems, a healthy process that cannot serve queries is still an outage. Add a monitor that actually runs a lightweight search query:

# zinc_query_health.py — verifies search queries work end-to-end
import os, requests
from fastapi import FastAPI
from fastapi.responses import JSONResponse

app = FastAPI()
ZINC_URL = os.environ.get("ZINC_URL", "http://localhost:4080")
ZINC_USER = os.environ.get("ZINC_USER", "admin")
ZINC_PASS = os.environ.get("ZINC_PASS", "password")
PROBE_INDEX = os.environ.get("ZINC_PROBE_INDEX", "my-logs")

@app.get("/health/zinc/search")
def zinc_search_health():
    try:
        resp = requests.post(
            f"{ZINC_URL}/api/{PROBE_INDEX}/_search",
            json={"query": {"match_all": {}}, "size": 1},
            auth=(ZINC_USER, ZINC_PASS),
            timeout=5,
        )
        if resp.status_code == 200:
            return {"status": "ok", "hits": resp.json().get("hits", {}).get("total", {}).get("value", 0)}
        return JSONResponse(status_code=503, content={"status": "error", "code": resp.status_code})
    except Exception as e:
        return JSONResponse(status_code=503, content={"status": "down", "error": str(e)})

This query-level check catches issues that the /healthz endpoint cannot:

  • Corrupted index files that prevent queries from executing
  • Memory pressure causing query timeouts
  • Permission or configuration issues with specific indices

Step 5: Heartbeat Monitoring for Document Ingestion

ZincSearch is often fed by log shippers (Fluent Bit, Logstash, Vector) or application-level producers. If ingestion stalls, your index goes stale without any visible error.

Set Up the Heartbeat Monitor

  1. In Vigilmon → Add Monitor → Heartbeat.
  2. Name: zinc-log-ingester.
  3. Expected interval: Match your ingestion cadence (1 minute for real-time log shippers).
  4. Grace period: 5 minutes.
  5. Copy the heartbeat URL: https://vigilmon.online/heartbeat/your-unique-id.

Wire Into Your Ingestion Pipeline

Vector log shipper (with heartbeat):

# vector.yaml — add a sink that pings Vigilmon after each successful flush
sinks:
  zinc_search:
    type: elasticsearch
    inputs: ["parsed_logs"]
    endpoint: "http://zinc.example.com:4080"
    index: "my-logs"
    auth:
      strategy: basic
      user: "admin"
      password: "${ZINC_PASS}"

  vigilmon_heartbeat:
    type: http
    inputs: ["parsed_logs"]
    uri: "${VIGILMON_HEARTBEAT_URL}"
    method: GET
    batch:
      max_events: 1
      timeout_secs: 60  # ping once per minute

Python ingestion script:

import requests, os, time

VIGILMON_HB = os.environ["VIGILMON_HEARTBEAT_URL"]
ZINC_URL = os.environ.get("ZINC_URL", "http://localhost:4080")

def ingest_batch(docs):
    bulk_body = "\n".join(
        f'{{"index":{{"_index":"my-logs"}}}}\n{json.dumps(doc)}'
        for doc in docs
    )
    resp = requests.post(
        f"{ZINC_URL}/api/_bulk",
        data=bulk_body,
        headers={"Content-Type": "application/x-ndjson"},
        auth=("admin", os.environ["ZINC_PASS"]),
    )
    resp.raise_for_status()

    # Heartbeat after successful ingestion
    requests.get(VIGILMON_HB, timeout=5)

while True:
    docs = fetch_pending_documents()
    if docs:
        ingest_batch(docs)
    time.sleep(60)

Step 6: SSL Certificate Monitoring

If ZincSearch is accessible over HTTPS (recommended for production deployments behind a reverse proxy), add SSL certificate monitoring:

  1. Add Monitor → SSL Certificate.
  2. Domain: zinc.example.com.
  3. Alert when expiry is within: 30 days.
  4. Alert escalation: 14 days, 7 days, 3 days.
  5. Click Save.

ZincSearch itself does not handle TLS — your reverse proxy (Nginx, Caddy, Traefik) terminates TLS. Monitor the proxy's certificate, not the raw Zinc port.


Step 7: Configure Alerting

In Vigilmon under Settings → Notifications:

| Monitor | Trigger | Recommended Response | |---|---|---| | /healthz health check | 503 or keyword absent | Check ZincSearch process; review stderr logs | | Index availability | Index missing or 503 | Check if index was deleted; verify ingestion pipeline | | Search query health | 503 or slow response | Check index files; check memory pressure | | Ingestion heartbeat | Ping not received | Check log shipper; verify network path to ZincSearch | | SSL certificate | < 30 days | Renew via cert-manager or manual renewal |

Alert thresholds:

  • Confirmation: 2 consecutive failures for the health check (brief restarts complete in seconds; 2 failures = genuine outage)
  • Response time: Alert at 1000ms for /healthz (should respond in milliseconds; slow response indicates load)

Common ZincSearch Failure Modes

| Scenario | What Vigilmon Catches | |---|---| | Process crash or OOM kill | /healthz fails immediately | | Port not accessible (firewall change) | External probe catches it; internal checks miss it | | Reverse proxy misconfiguration | Probe fails from external regions | | Corrupted WAL prevents startup | Health check stays down after restart | | Log shipper connection broken | Heartbeat monitor fires | | Index accidentally deleted | Index availability monitor fires | | SSL certificate expires | SSL monitor alerts at 30-day threshold |


ZincSearch's simplicity is a strength for operations — but single-process simplicity means single point of failure. Vigilmon's external probes of the /healthz endpoint and your critical indices give you reliable, low-noise alerting that distinguishes a transient restart from a genuine outage.

Get started free at vigilmon.online — your ZincSearch monitor is running in under 5 minutes.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →