Normalize source fetch instrumentation for /api/metrics #22

Closed
opened 2026-05-17 12:11:49 +00:00 by MrSphay · 2 comments
Owner

Created from local scan plus Gitea runner follow-up after reviewing existing issues #1-#21.

Current status: /api/metrics exposes fetch metrics by host and by source, but many source modules either call safeFetch() without a source option or bypass safeFetch() with raw etch(). That makes network health attribution incomplete: failures cluster under unknown, and raw provider calls are invisible to metrics, retry, and shared timeout behavior.

Code references:

  • pis/sources/bls.mjs, luesky.mjs, eia.mjs, gdelt.mjs, red.mjs, safecast.mjs, reasury.mjs, who.mjs, and others call safeFetch() without a source name.
  • pis/sources/acled.mjs, irms.mjs, gscpi.mjs, kiwisdr.mjs,
    eliefweb.mjs, usaspending.mjs,
    eddit.mjs, and alert/LLM integrations use raw etch() for provider calls.

Acceptance criteria:

  • Every intelligence source fetch is attributed with a stable source name in fetch metrics.
  • Raw etch() usage is either migrated to shared helpers or explicitly documented when a helper cannot be used.
  • /api/metrics can answer which source/provider is failing without grouping normal source traffic under unknown.
  • Add regression coverage for source attribution and raw-fetch exceptions.
Created from local scan plus Gitea runner follow-up after reviewing existing issues #1-#21. Current status: /api/metrics exposes fetch metrics by host and by source, but many source modules either call safeFetch() without a source option or bypass safeFetch() with raw etch(). That makes network health attribution incomplete: failures cluster under unknown, and raw provider calls are invisible to metrics, retry, and shared timeout behavior. Code references: - pis/sources/bls.mjs, luesky.mjs, eia.mjs, gdelt.mjs, red.mjs, safecast.mjs, reasury.mjs, who.mjs, and others call safeFetch() without a source name. - pis/sources/acled.mjs, irms.mjs, gscpi.mjs, kiwisdr.mjs, eliefweb.mjs, usaspending.mjs, eddit.mjs, and alert/LLM integrations use raw etch() for provider calls. Acceptance criteria: - Every intelligence source fetch is attributed with a stable source name in fetch metrics. - Raw etch() usage is either migrated to shared helpers or explicitly documented when a helper cannot be used. - /api/metrics can answer which source/provider is failing without grouping normal source traffic under unknown. - Add regression coverage for source attribution and raw-fetch exceptions.
Author
Owner

In Bearbeitung durch Codex auf Branch codex/issue-22-source-fetch-instrumentation. Scope: Fetch-Instrumentation normalisieren: stabile source attribution in Quellen, raw-fetch Ausnahmen dokumentieren, Regression. Runner-only: keine lokalen npm/node Laeufe.

In Bearbeitung durch Codex auf Branch codex/issue-22-source-fetch-instrumentation. Scope: Fetch-Instrumentation normalisieren: stabile source attribution in Quellen, raw-fetch Ausnahmen dokumentieren, Regression. Runner-only: keine lokalen npm/node Laeufe.
Author
Owner

PR geoeffnet: #35\n\nStatus: mergeable. Scope: safeFetch/safeFetchText inferieren stabile Provider-Buckets, wenn source fehlt; unbekannte Hosts fallen auf Hostnamen statt unknown zurueck. Raw-fetch-Ausnahmen und Instrumentierungsregeln dokumentiert. Runner-only: keine lokalen npm/node Tests.

PR geoeffnet: https://git.wilkensxl.de/MrSphay/intelligence-terminal/pulls/35\n\nStatus: mergeable. Scope: safeFetch/safeFetchText inferieren stabile Provider-Buckets, wenn source fehlt; unbekannte Hosts fallen auf Hostnamen statt unknown zurueck. Raw-fetch-Ausnahmen und Instrumentierungsregeln dokumentiert. Runner-only: keine lokalen npm/node Tests.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MrSphay/intelligence-terminal#22