Conversation
Add recorded API lifetimes and estimated lifetimes for torn-down PR environments. Show unique components by repository and ready components across current environments. Keep missing measurements unavailable. Exclude incomplete identities from unique component counts.
The inventory query can reach its time limit as the number of current environments increases. Read the selected component rows once and keep their latest deployment state for the result. Counts and filters stay the same. Return HTTP503 with analytics_timeout when PostgreSQL confirms a statement time limit. Keep other failures unchanged and exclude database details from the response.
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.
Administrators can review environment activity, repository and PR use, current health, and recorded Agent usage from existing Lifecycle records.
Lifetime results separate recorded API retirements from PR estimates. API lifetime uses creation and deletion dates. PR estimates use creation and last update dates for records marked torn down. Later edits and reuse gaps can increase PR estimates. Missing measurements remain unavailable.
Unique components count each configured component once within its repository. Ready components count each component in each current environment. PostgreSQL in two repositories across 20 ready PR environments gives two unique components and 20 ready components. Exclusions and incomplete identities remain visible. Enabled optional components can be absent from the totals. This count defect remains open.
Results support time windows, filters, comparisons, and paged records. Agent usage follows submitted runs. Reported and estimated costs remain separate. Access requires administrator permission.
Migration 036 adds an index for active deployment lookups. Lifetime and component metrics need no additional migration.
PR coverage and component queries avoid repeated reads of retained records. Current inventory reads selected component rows once and preserves their latest recorded deployment state. Counts and filters are unchanged. Each Analytics SQL statement keeps a limit of 10 seconds.
In a local fixture with 5,000 current environments, inventory changed from a time-limit failure to 422 ms. A larger fixture used 20,000 current environments and 2.1 million rows in each retained component and deployment table. It completed in 7.9 seconds. These synthetic measurements depend on the device, data, and cache. They do not guarantee production latency. The reported production request has not been inspected, so its cause remains unconfirmed.
Confirmed PostgreSQL statement timeouts return HTTP 503 with
analytics_timeoutand a retry action. The response excludes database details. Other failures keep their existing handling. This timeout fix needs no new index or migration.Validation: 9,594 API tests and 55 gateway tests passed, including CI coverage checks. Eleven existing API tests remain skipped. Lint, runtime TypeScript checks, and an isolated production build passed. PostgreSQL fixtures confirmed lifetime calculations, repository identity, component counts, exclusions, pagination, and count parity across 13 filter scopes. Additional PostgreSQL checks confirmed latest deployment selection, large-fixture counts, the timeout response, and connection recovery.
Commit and PR text review: passed against the final change and verification results.
UI text review: passed for API text shown in Analytics. Desktop Chrome confirmed measurement limits, unavailable data, known timeout responses, and manual recovery.
Deploy this API before the UI analytics change.