feat(metrics): per-source ingest error counter (hotblocks_ingest_source_errors_total)#81
Draft
mo4islona wants to merge 1 commit into
Draft
feat(metrics): per-source ingest error counter (hotblocks_ingest_source_errors_total)#81mo4islona wants to merge 1 commit into
mo4islona wants to merge 1 commit into
Conversation
Add hotblocks_ingest_source_errors_total{source, kind} recording upstream
data-source ingestion errors (connect/dns/timeout/http/...), which were
previously only WARN logs and thus invisible on dashboards / unalertable.
- DataClient::error_kind() / source_label(): new trait methods with default
impls; the reqwest-specific classification stays in ReqwestDataClient
- recorded in StandardDataSource::on_error, registered in hotblocks metrics
- the `source` label separates a chronically-dead endpoint (constant error
spam, healthy fallback) from a real incident where many sources fail at once
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UBLDJBHu2zvs75C4XdDFrL
a197df6 to
88b8129
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
hotblocks_ingest_source_errors_total{source, kind}counter recording ingestion errors from upstream data sources.source— the upstream host (e.g.evm-uniblock-binance-mainnet-hotblocks-service.evm-hotblocks)kind— coarse class:connect/timeout/http/decode/io/otherpod/namespacefrom the scrape)Why
Ingest data-source errors (DNS/connect failures, upstream 5xx, timeouts) were only emitted as WARN logs — there was no metric, so a stalled ingest (all sources failing to connect/read) was invisible on dashboards and unalertable.
This came out of investigating the recurring post-deploy freshness freezes (NET-408): during those windows the pod's own logs weren't even shipped (fluent-bit gap), while Prometheus kept scraping — so a metric is the only reliable signal there.
The
sourcelabel lets a permanently-dead endpoint (which spams errors continuously behind a healthy fallback) be told apart from a fresh incident where many otherwise-healthy sources start failing at once:How
DataClient::error_kind()/source_label()— new trait methods with default impls ("other"/"unknown"); the reqwest-specific classification stays inReqwestDataClient.StandardDataSource::on_error(sqd-data-source), registered insqd-hotblocks::metrics::build_metrics_registry.Draft — the complementary portal-side fix (read/TTFB timeout on the hotblocks client, so a slow/starting pod can't hang
/stream) is tracked separately.🤖 Generated with Claude Code
https://claude.ai/code/session_01UBLDJBHu2zvs75C4XdDFrL