Repository navigation
Add hourly Tenderly usage spike alerts - #470
Merged
Merged
Conversation
spalen0
marked this pull request as ready for review
November 10, 2026 17:23
- P2: persist the next pending hour before fetching usage, process pending hours chronologically, and advance only after evaluation and delivery. - P3: normalize whole-valued numeric timestamps without accepting invalid, fractional, non-finite, or misaligned values. - Cover hour rollovers, API/data/delivery failures, catch-up progress, and invalid state. Document retry and retained-history behavior. Validation: 2236 tests and 117 subtests passed, with 4 skips; lint, formatting, types, hooks, dependency audit, and live dry-run passed. The existing hourly schedule is unchanged.
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.
Checks organization-wide Tenderly TU usage in the existing hourly profile. A Telegram alert fires when a settled hour consumes at least 3x the busiest hour in the preceding 24 hours and at least 100,000 additional TUs. Complete hourly buckets and the prior peak tolerate normal hourly and daily cron bursts.
The monitor checkpoints its first pending hour before fetching data and processes missed hours chronologically. Normal hours and successfully delivered spikes advance the checkpoint; API failures, missing data, and skipped or failed delivery retain it for a later run. Whole-valued float timestamps are normalized without rounding, while malformed timestamps and values are rejected.
Messages go to Yearn maintenance with the existing Yearn fallback and are stored under
yearn-internal.--dry-runevaluates the latest settled hour without reading or writing monitor state or sending messages. The hourly schedule, monitoring metadata, and Tenderly README are included.Uses the existing Tenderly credential and the dashboard's undocumented usage endpoint. Catch-up uses one weekly history response; if required history is unavailable, the monitor reports an error and retains the checkpoint for investigation. Small leaks can be hidden by normal organization traffic, and sustained high usage enters subsequent baselines.
Validation:
prek run --all-filespassed; full Ruff lint/format and type checks passed.