Skip to content

fix(selfhost): wire or remove the dead gittensory_jobs_deferred_total metric #2508

Description

@JSONbored

Parent: #1936

Problem

gittensory_jobs_deferred_total is registered as a persisted gauge in src/server.ts (reading backend.queue.stats()["gittensory_jobs_deferred_total"]) but no code path anywhere in sqlite-queue.ts or pg-queue.ts ever calls recordQueueMetric(driver, "gittensory_jobs_deferred_total", ...) — dead instrumentation that always reports 0.

A Grafana panel or alert built on gittensory_jobs_deferred_total_persisted_total will show a flat 0 forever, giving a false sense that no deferrals are happening. The similarly-named (and actually incremented) metrics gittensory_jobs_rate_limit_deferred_total / gittensory_jobs_rate_limit_admission_deferred_total / gittensory_jobs_rate_limit_budget_deferred_total exist and ARE recorded, so this looks like a leftover/renamed metric from an earlier iteration rather than something intentionally deferred.

Fix

Either:

  1. Wire recordQueueMetric(driver, "gittensory_jobs_deferred_total") at the actual deferral call sites it was meant to cover, OR
  2. Remove the dead gauge registration from src/server.ts (both the main registration loop and the pre-seed loop) so the metric list only reflects series that are actually written.

Verification

  • Confirm gittensory_jobs_deferred_total still has zero write call sites against current src/ (line numbers may have shifted).
  • Check whether any self-host Grafana dashboard JSON references this metric name before deciding between wire-vs-remove.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions