Skip to content

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

Closed
Flotapponnier wants to merge 1 commit into
mainfrom
hotfix/lighter-ghost-metrics-main
Closed

perp-fees: delete gauges on asset_not_found (Lighter ghost metrics)#1620
Flotapponnier wants to merge 1 commit into
mainfrom
hotfix/lighter-ghost-metrics-main

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Cherry-pick of #1619 → main.

Lighter removed BTC/ETH/SOL from their perp markets. The harness returned asset_not_found on every tick but never cleared the gauge, so the Go Prom client kept the last known value in memory as a ghost metric. Lighter was showing as #1 for BTC all-in cost indefinitely.

Fix: classify asset_not_found as not_found and call DeleteLabelValues on all gauge series (allInBps, spread, takerFee, funding, and all tier gauges) when that error type fires.

After merging, rebuild the perp-fees Docker image on the VPS to deploy the fix.

Lighter removed BTC/ETH/SOL from their perp markets. The harness was
returning asset_not_found on every tick but recordSample() returned
early without deleting the gauge, so the Go Prom client kept the last
set value in memory forever. Classifying asset_not_found as not_found
and calling DeleteLabelValues clears all gauge series (allInBps,
spread, takerFee, funding, tiers) so Lighter/BTC etc. drops off the
rankings instead of carrying stale top-ranked values indefinitely.
@Flotapponnier

Copy link
Copy Markdown
Collaborator Author

Superseded by #1621 + will cherry-pick to main after that merges

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