Skip to content

perp-fees: delete gauges on asset_not_found (Lighter ghost metrics) - #1621

Merged
Flotapponnier merged 2 commits into
devfrom
fix/lighter-ghost-metrics-v2
Jul 28, 2026
Merged

perp-fees: delete gauges on asset_not_found (Lighter ghost metrics)#1621
Flotapponnier merged 2 commits into
devfrom
fix/lighter-ghost-metrics-v2

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Problem

Lighter removed BTC, ETH, and SOL from their perp markets. Their live /orderBookDetails API returns 89 markets, none of which are BTC/ETH/SOL. The harness returns asset_not_found on every 5-minute tick but recordSample() returned early without clearing the gauge — so the Go Prom client kept the last .Set() value in memory as a ghost metric. Lighter showed as #1 all-in cost indefinitely.

Fix

  • Added not_found error class to classifyErr() (matches asset_not_found and unsupported_venue)
  • On not_found, delete all gauge series before returning: allInBps, spread, takerFee, funding, fetchLatency, lastRefresh, and all four tier gauges
  • Transient failures still keep the last value (intentional)

Deploy after merge

Rebuild perp-fees on VPS so the fix takes effect on the next tick.

@Flotapponnier
Flotapponnier merged commit edaa04b into dev Jul 28, 2026
1 check failed
Flotapponnier added a commit that referenced this pull request Jul 28, 2026
* perp-fees: delete gauges on asset_not_found (Lighter ghost metrics) (#1621)

* perp-fees: delete gauges on asset_not_found to prevent ghost metrics

* add mayan/squid/socket/across to provider registry and logo manifest

* perp-fees: fix GMX subsquid schema + edgeX depth level (#1622)

GMX: Subsquid removed positionFeeFactor field; query was 400ing on
every tick. Remove the dropped field and its Go fallback.

edgeX: depth endpoint only accepts level=15 or 200, not 100.
The invalid level returned empty_orderbook on every tick.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant