Remove Prometheus metrics from indexer and docs (no /metrics) #200

Closed
opened 2026-05-26 08:00:40 +00:00 by PlasticDigits · 10 comments
PlasticDigits commented 2026-05-26 08:00:40 +00:00 (Migrated from gitlab.com)

Problem statement

The project will not ship Prometheus. The indexer currently includes optional GET /metrics on a dedicated listener (METRICS_BIND), prometheus crate usage, tests, and operator docs — this should be removed to reduce ops surface and dependency weight. Supersedes backlog #89 / DEX-P2-024 (do not implement metrics export).

Evidence / context

Proposed solution

  1. Delete metrics module, dedicated listener, env vars (METRICS_BIND, related DEPLOY_ENV bind rules).
  2. Remove prometheus from Cargo.toml; drop api_metrics tests.
  3. Scrub docs/skills/runbooks; use tracing-only observability note.
  4. Close/won't-do #89 when merged.

Acceptance criteria

  • No /metrics route or prometheus dependency in indexer.
  • Config validation and tests updated; docker/compose samples unchanged except removed env.
  • Operator docs no longer mention Prometheus; reorg runbook points to logs/tracing only.

Priority

P2

## Problem statement The project will **not** ship Prometheus. The indexer currently includes optional `GET /metrics` on a dedicated listener (`METRICS_BIND`), `prometheus` crate usage, tests, and operator docs — this should be **removed** to reduce ops surface and dependency weight. Supersedes backlog **#89** / DEX-P2-024 (do not implement metrics export). ## Evidence / context - [`indexer/src/metrics.rs`](indexer/src/metrics.rs), [`indexer/Cargo.toml`](indexer/Cargo.toml) `prometheus` dependency. - [`indexer/src/config.rs`](indexer/src/config.rs) — `metrics_listen`, `METRICS_BIND`, deploy env bind policy. - [`indexer/tests/api_metrics.rs`](indexer/tests/api_metrics.rs). - Docs: [`docs/operator-secrets.md`](docs/operator-secrets.md), [`docs/environment-matrix.md`](docs/environment-matrix.md), GitLab **#125** references. ## Proposed solution 1. Delete metrics module, dedicated listener, env vars (`METRICS_BIND`, related `DEPLOY_ENV` bind rules). 2. Remove `prometheus` from `Cargo.toml`; drop `api_metrics` tests. 3. Scrub docs/skills/runbooks; use **tracing-only** observability note. 4. Close/won't-do **#89** when merged. ## Acceptance criteria - [ ] No `/metrics` route or `prometheus` dependency in indexer. - [ ] Config validation and tests updated; docker/compose samples unchanged except removed env. - [ ] Operator docs no longer mention Prometheus; reorg runbook points to logs/tracing only. ## Priority **P2**
PlasticDigits commented 2026-05-26 10:09:15 +00:00 (Migrated from gitlab.com)

mentioned in commit 9b709014df

mentioned in commit 9b709014dfd6f970fa2d1a0a74dc1c7423ebdf1d
PlasticDigits commented 2026-05-26 10:09:33 +00:00 (Migrated from gitlab.com)

Implementation complete (pushed to main)

Removed optional Prometheus metrics from the indexer per acceptance criteria. Supersedes #89 / #125 observability model — tracing-only going forward.

Code changes

  • Deleted indexer/src/metrics.rs, indexer/tests/api_metrics.rs, and the prometheus crate dependency
  • Removed METRICS_BIND / METRICS_PORT, DeployEnv, dedicated metrics listener, and GET /metrics route
  • Simplified api::serve to a single API listener; block processing relies on existing tracing warnings/errors in poller.rs

Docs / invariants / agent skills

  • Updated docs/indexer-invariants.md (observability row + block-time fallback section)
  • Updated docs/operator-secrets.md, docs/environment-matrix.md, reorg runbook, incident template
  • Cross-linked in docs/README.md and skills/AGENTS_LOCALNET_TRADING_SWARM.md

Commit: 9b70901 on main

Verification checklist

  • cd indexer && cargo test --lib — 38 unit tests pass; no prometheus in Cargo.lock
  • grep -rE 'METRICS_BIND|/metrics|prometheus' indexer/ — no matches in source
  • Indexer starts without METRICS_BIND / DEPLOY_ENV env vars
  • GET /metrics on API port returns 404
  • Block timestamp fallback still logs warnings (Invalid block timestamp / Missing block timestamp)
  • Operator docs no longer mention Prometheus scrape endpoints

@brouie — please verify when you have a moment. Leaving this issue open until sign-off.

## Implementation complete (pushed to `main`) Removed optional Prometheus metrics from the indexer per acceptance criteria. Supersedes #89 / #125 observability model — **tracing-only** going forward. ### Code changes - Deleted `indexer/src/metrics.rs`, `indexer/tests/api_metrics.rs`, and the `prometheus` crate dependency - Removed `METRICS_BIND` / `METRICS_PORT`, `DeployEnv`, dedicated metrics listener, and `GET /metrics` route - Simplified `api::serve` to a single API listener; block processing relies on existing `tracing` warnings/errors in `poller.rs` ### Docs / invariants / agent skills - Updated `docs/indexer-invariants.md` (observability row + block-time fallback section) - Updated `docs/operator-secrets.md`, `docs/environment-matrix.md`, reorg runbook, incident template - Cross-linked in `docs/README.md` and `skills/AGENTS_LOCALNET_TRADING_SWARM.md` **Commit:** `9b70901` on `main` ### Verification checklist - [ ] `cd indexer && cargo test --lib` — 38 unit tests pass; no `prometheus` in `Cargo.lock` - [ ] `grep -rE 'METRICS_BIND|/metrics|prometheus' indexer/` — no matches in source - [ ] Indexer starts without `METRICS_BIND` / `DEPLOY_ENV` env vars - [ ] `GET /metrics` on API port returns **404** - [ ] Block timestamp fallback still logs warnings (`Invalid block timestamp` / `Missing block timestamp`) - [ ] Operator docs no longer mention Prometheus scrape endpoints @brouie — please verify when you have a moment. Leaving this issue **open** until sign-off.
PlasticDigits commented 2026-05-27 12:32:21 +00:00 (Migrated from gitlab.com)

Verification complete (agent sign-off)

Verified implementation on main (6278f3e) against all acceptance criteria and the verification checklist from the prior comment.

Checklist results

  • cd indexer && cargo test --lib — 39 unit tests pass; no prometheus in Cargo.lock
  • grep -rE 'METRICS_BIND|/metrics|prometheus' indexer/ — no matches in source
  • Indexer running at http://127.0.0.1:3001 without METRICS_BIND / DEPLOY_ENV
  • GET /metrics on API port returns 404; GET /health returns 200
  • Block timestamp fallback warnings present in poller.rs (Invalid block timestamp / Missing block timestamp)
  • Operator docs / reorg runbook point to tracing-only observability (no Prometheus scrape endpoints)
  • indexer/tests/api_metrics.rs and indexer/src/metrics.rs deleted; no METRICS_* in compose/env samples

Infra / visual verification

  • LocalTerra healthy; Postgres on host :5432; indexer healthy; bot swarm 30/30 workers
  • Frontend at http://127.0.0.1:5173 — Charts & Analytics loads overview metrics (45 pairs, 66k+ trades) from indexer API
  • #89 already closed (won't-do / superseded)

No additional code changes required. Closing.

## Verification complete (agent sign-off) Verified implementation on `main` (6278f3e) against all acceptance criteria and the verification checklist from the prior comment. ### Checklist results - [x] `cd indexer && cargo test --lib` — **39** unit tests pass; **no `prometheus` in `Cargo.lock`** - [x] `grep -rE 'METRICS_BIND|/metrics|prometheus' indexer/` — **no matches** in source - [x] Indexer running at `http://127.0.0.1:3001` without `METRICS_BIND` / `DEPLOY_ENV` - [x] `GET /metrics` on API port returns **404**; `GET /health` returns **200** - [x] Block timestamp fallback warnings present in `poller.rs` (`Invalid block timestamp` / `Missing block timestamp`) - [x] Operator docs / reorg runbook point to **tracing-only** observability (no Prometheus scrape endpoints) - [x] `indexer/tests/api_metrics.rs` and `indexer/src/metrics.rs` deleted; no `METRICS_*` in compose/env samples ### Infra / visual verification - LocalTerra healthy; Postgres on host `:5432`; indexer healthy; bot swarm **30/30** workers - Frontend at `http://127.0.0.1:5173` — Charts & Analytics loads overview metrics (45 pairs, 66k+ trades) from indexer API - #89 already closed (won't-do / superseded) No additional code changes required. Closing.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-05-27 12:32:21 +00:00
PlasticDigits commented 2026-05-29 03:09:58 +00:00 (Migrated from gitlab.com)

mentioned in issue #209

mentioned in issue #209
PlasticDigits commented 2026-05-29 03:11:33 +00:00 (Migrated from gitlab.com)

mentioned in issue #210

mentioned in issue #210
PlasticDigits commented 2026-05-29 05:37:30 +00:00 (Migrated from gitlab.com)

mentioned in issue #220

mentioned in issue #220
PlasticDigits commented 2026-06-07 12:14:12 +00:00 (Migrated from gitlab.com)

mentioned in issue #337

mentioned in issue #337
PlasticDigits commented 2026-06-12 04:46:03 +00:00 (Migrated from gitlab.com)

mentioned in issue #361

mentioned in issue #361
PlasticDigits commented 2026-06-13 02:49:42 +00:00 (Migrated from gitlab.com)

mentioned in issue #373

mentioned in issue #373
PlasticDigits commented 2026-06-13 02:56:17 +00:00 (Migrated from gitlab.com)

mentioned in issue #362

mentioned in issue #362
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#200
No description provided.