Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(error-tracking): prioritize alert routes (#79418)

Hugues Pouillot64c384b745a6
diff --git a/frontend/src/products.tsx b/frontend/src/products.tsx
index e54c2701e6f0..c856f8385c50 100644
--- a/frontend/src/products.tsx
+++ b/frontend/src/products.tsx
@@ -154,10 +154,10 @@ export const productRoutes: Record<string, [string, string]> = {
'/engineering-analytics/authors/:handle': ['EngineeringAnalyticsAuthor', 'engineeringAnalyticsAuthor'],
'/error_tracking': ['ErrorTracking', 'errorTracking'],
'/error_tracking/fingerprint/*': ['ErrorTrackingFingerprint', 'errorTrackingFingerprint'],
+ '/error_tracking/alerts/new/:templateId': ['HogFunction', 'errorTrackingAlertNew'],
+ '/error_tracking/alerts/:id': ['HogFunction', 'errorTrackingAlert'],
'/error_tracking/:id': ['ErrorTrackingIssue', 'errorTrackingIssue'],
'/error_tracking/:id/fingerprints': ['ErrorTrackingIssueFingerprints', 'errorTrackingIssueFingerprints'],
- '/error_tracking/alerts/:id': ['HogFunction', 'errorTrackingAlert'],
- '/error_tracking/alerts/new/:templateId': ['HogFunction', 'errorTrackingAlertNew'],
'/feature_flags/templates': ['FeatureFlagTemplates', 'featureFlagTemplates'],
'/feature_flags/staff': ['FeatureFlagsStaffTools', 'featureFlagsStaffTools'],
'/games/368hedgehogs': ['Game368Hedgehogs', 'game368Hedgehogs'],
diff --git a/products/error_tracking/manifest.test.tsx b/products/error_tracking/manifest.test.tsx
new file mode 100644
index 000000000000..e9de368b3715
--- /dev/null
+++ b/products/error_tracking/manifest.test.tsx
@@ -0,0 +1,14 @@
+import { manifest } from './manifest'
+
+describe('error tracking routes', () => {
+ it('registers alert routes before the generic issue route', () => {
+ const routes = Object.keys(manifest.routes)
+ const alertsIdRoute = '/error_tracking/alerts/:id'
+ const alertsNewRoute = '/error_tracking/alerts/new/:templateId'
+ const genericIdRoute = '/error_tracking/:id'
+
+ expect(routes).toEqual(expect.arrayContaining([alertsIdRoute, alertsNewRoute, genericIdRoute]))
+ expect(routes.indexOf(alertsIdRoute)).toBeLessThan(routes.indexOf(genericIdRoute))
+ expect(routes.indexOf(alertsNewRoute)).toBeLessThan(routes.indexOf(alertsIdRoute))
+ })
+})
diff --git a/products/error_tracking/manifest.tsx b/products/error_tracking/manifest.tsx
index f3e346eb9922..00c032b01e40 100644
--- a/products/error_tracking/manifest.tsx
+++ b/products/error_tracking/manifest.tsx
@@ -37,10 +37,10 @@ export const manifest: ProductManifest = {
routes: {
'/error_tracking': ['ErrorTracking', 'errorTracking'],
'/error_tracking/fingerprint/*': ['ErrorTrackingFingerprint', 'errorTrackingFingerprint'],
+ '/error_tracking/alerts/new/:templateId': ['HogFunction', 'errorTrackingAlertNew'],
+ '/error_tracking/alerts/:id': ['HogFunction', 'errorTrackingAlert'],
'/error_tracking/:id': ['ErrorTrackingIssue', 'errorTrackingIssue'],
'/error_tracking/:id/fingerprints': ['ErrorTrackingIssueFingerprints', 'errorTrackingIssueFingerprints'],
- '/error_tracking/alerts/:id': ['HogFunction', 'errorTrackingAlert'],
- '/error_tracking/alerts/new/:templateId': ['HogFunction', 'errorTrackingAlertNew'],
},
redirects: {
'/error_tracking/configuration': (_params, searchParams, hashParams) => {