feat(error-tracking): add rate limit history chart to project-wide limit#61395
Merged
Conversation
Add a Simulation/History toggle to the project-wide rate limit section. History queries app_metrics2 (app_source 'exceptions') for recorded vs dropped exception counts emitted by the team-global rate limiter, and overlays the toggle plus a force-refresh control on the chart. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Size Change: +18 kB (+0.02%) Total Size: 82.2 MB 📦 View Changed
ℹ️ View Unchanged
|
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rate_limit/rateLimitConfigLogic.ts:165-166
The query reads from `app_metrics` (the legacy v1 table), but the error-tracking rate limiter writes via `AppMetricsAggregator` to the `clickhouse_app_metrics2` Kafka topic — confirmed in `app-metrics-aggregator.ts` ("matching the ClickHouse `app_metrics2` schema") and the test assertions in `keyed-rate-limiter-step.test.ts`. The code comment on line 65 even says "app_metrics2 fields". As written, this query will always return zero rows, making the History chart permanently empty regardless of rate-limit activity.
```suggestion
FROM app_metrics2
WHERE app_source = '${EXCEPTIONS_APP_SOURCE}'
```
Reviews (1): Last reviewed commit: "feat(error-tracking): add rate limit his..." | Re-trigger Greptile |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “History” view to the Error Tracking project-wide rate limit UI so users can see recorded vs dropped exceptions over time (sourced from app metrics), alongside the existing simulation view.
Changes:
- Introduces a new
RateLimitHistoryChartstacked bar chart for recorded vs dropped counts. - Adds chart mode toggle (Simulation/History) + refresh button UX in
RateLimitSettings. - Extends
rateLimitConfigLogicwith history loading (HogQL overapp_metrics) and chart refresh mechanics; refactors bucket timeline utilities for reuse.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rate_limit/RateLimitSimulationChart.tsx | Extracts reusable bucket timeline/label helpers for both charts. |
| products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rate_limit/RateLimitSettings.tsx | Adds chart mode segmented control, refresh button, and conditional rendering of simulation vs history chart. |
| products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rate_limit/RateLimitHistoryChart.tsx | New chart component rendering recorded vs dropped history as a stacked bar chart. |
| products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rate_limit/rateLimitConfigLogic.ts | Adds history loader querying app metrics, introduces chart mode + refresh actions, wires listeners. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cat-ph
approved these changes
Jun 5, 2026
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.
Adds history tab based on app metrics
