: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(error-tracking): add severity to issue query state (#83107)
Hugues Pouillot46d73d2aa72a
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.jsonindex 3cebef242df2..39c7b5253a05 100644--- a/frontend/src/queries/schema.json+++ b/frontend/src/queries/schema.json@@ -20946,6 +20946,16 @@"required": ["both", "success_only", "exception_only", "neither"],"type": "object"},+ "severity": {+ "anyOf": [+ {+ "$ref": "#/definitions/ErrorTrackingQueryIssueSeverity"+ },+ {+ "type": "null"+ }+ ]+ },"status": {"$ref": "#/definitions/ErrorTrackingIssueStatus"}@@ -21201,6 +21211,16 @@"name": {"type": ["string", "null"]},+ "severity": {+ "anyOf": [+ {+ "$ref": "#/definitions/ErrorTrackingQueryIssueSeverity"+ },+ {+ "type": "null"+ }+ ]+ },"source": {"type": "string"},@@ -21521,6 +21541,16 @@"issue_name": {"type": ["string", "null"]},+ "issue_severity": {+ "anyOf": [+ {+ "$ref": "#/definitions/ErrorTrackingQueryIssueSeverity"+ },+ {+ "type": "null"+ }+ ]+ },"issue_status": {"type": "string"},@@ -21535,6 +21565,7 @@"issue_name","issue_description","issue_status",+ "issue_severity","assigned_user_id","assigned_role_id","first_seen",@@ -21652,6 +21683,11 @@"required": ["dateRange", "kind", "orderBy", "volumeResolution"],"type": "object"},+ "ErrorTrackingQueryIssueSeverity": {+ "enum": ["low", "medium", "high", "critical"],+ "title": "ErrorTrackingQueryIssueSeverity",+ "type": "string"+ },"ErrorTrackingQueryResponse": {"additionalProperties": false,"properties": {@@ -21779,6 +21815,16 @@"name": {"type": ["string", "null"]},+ "severity": {+ "anyOf": [+ {+ "$ref": "#/definitions/ErrorTrackingQueryIssueSeverity"+ },+ {+ "type": "null"+ }+ ]+ },"status": {"$ref": "#/definitions/ErrorTrackingIssueStatus"}diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.tsindex abdefaa18585..79d7b64e046a 100644--- a/frontend/src/queries/schema/schema-general.ts+++ b/frontend/src/queries/schema/schema-general.ts@@ -3769,6 +3769,9 @@ export type CachedSessionAttributionExplorerQueryResponse = CachedQueryResponse</** @title ErrorTrackingOrderBy */export type ErrorTrackingOrderBy = 'last_seen' | 'first_seen' | 'occurrences' | 'users' | 'sessions'+/** @title ErrorTrackingQueryIssueSeverity */+export type ErrorTrackingQueryIssueSeverity = 'low' | 'medium' | 'high' | 'critical'+/** Client-side pending fingerprint issue state update UNIONed into the argMax subquery to hide Kafka->CH sync lag after mutations. This has to be kept in sync with the CH schema */export interface ErrorTrackingPendingFingerprintIssueStateUpdate {fingerprint: string@@ -3776,6 +3779,7 @@ export interface ErrorTrackingPendingFingerprintIssueStateUpdate {issue_name: string | nullissue_description: string | nullissue_status: string+ issue_severity: ErrorTrackingQueryIssueSeverity | nullassigned_user_id: integer | nullassigned_role_id: string | null/** ISO 8601 datetime string. */@@ -3929,6 +3933,7 @@ export interface ErrorTrackingRelationalIssue {description: string | nullassignee: ErrorTrackingIssueAssignee | nullstatus: ErrorTrackingIssueStatus+ severity?: ErrorTrackingQueryIssueSeverity | null/** @format date-time */first_seen: stringexternal_issues?: ErrorTrackingExternalReference[]diff --git a/posthog/schema.py b/posthog/schema.pyindex 7f9dfd5b0ff7..e043f4df87e3 100644--- a/posthog/schema.py+++ b/posthog/schema.py@@ -99,6 +99,7 @@ from posthog.schema_enums import (ErrorTrackingIssueAssigneeType as ErrorTrackingIssueAssigneeType,ErrorTrackingIssueStatus as ErrorTrackingIssueStatus,ErrorTrackingOrderBy as ErrorTrackingOrderBy,+ ErrorTrackingQueryIssueSeverity as ErrorTrackingQueryIssueSeverity,EvaluationRuntime as EvaluationRuntime,ExperimentMetricGoal as ExperimentMetricGoal,ExperimentMetricMathType as ExperimentMetricMathType,@@ -4791,6 +4792,7 @@ class ErrorTrackingPendingFingerprintIssueStateUpdate(BaseModel):issue_description: str | None = Noneissue_id: strissue_name: str | None = None+ issue_severity: ErrorTrackingQueryIssueSeverity | None = Noneissue_status: strversion: int = Field(...,@@ -16558,6 +16560,7 @@ class ErrorTrackingIssue(BaseModel):last_seen: AwareDatetimelibrary: str | None = Nonename: str | None = None+ severity: ErrorTrackingQueryIssueSeverity | None = Nonesource: str | None = Nonestatus: ErrorTrackingIssueStatus@@ -16645,6 +16648,7 @@ class ErrorTrackingRelationalIssue(BaseModel):first_seen: AwareDatetimeid: strname: str | None = None+ severity: ErrorTrackingQueryIssueSeverity | None = Nonestatus: ErrorTrackingIssueStatus@@ -25515,6 +25519,7 @@ class ErrorTrackingCorrelatedIssue(BaseModel):name: str | None = Noneodds_ratio: floatpopulation: Population+ severity: ErrorTrackingQueryIssueSeverity | None = Nonestatus: ErrorTrackingIssueStatusdiff --git a/posthog/schema_enums.py b/posthog/schema_enums.pyindex 55f08e3ebd2a..c5a5061b1c95 100644--- a/posthog/schema_enums.py+++ b/posthog/schema_enums.py@@ -1141,6 +1141,13 @@ class ErrorTrackingOrderBy(StrEnum):SESSIONS = "sessions"+class ErrorTrackingQueryIssueSeverity(StrEnum):+ LOW = "low"+ MEDIUM = "medium"+ HIGH = "high"+ CRITICAL = "critical"++class EvaluationRuntime(StrEnum):HOG = "hog"LLM_JUDGE = "llm_judge"diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.tsindex 0ac4c28e6962..7fe9a278abbd 100644--- a/products/dashboards/frontend/generated/api.schemas.ts+++ b/products/dashboards/frontend/generated/api.schemas.ts@@ -4870,6 +4870,16 @@ export interface LastEventApi {uuid: string}+export type ErrorTrackingQueryIssueSeverityApi =+ (typeof ErrorTrackingQueryIssueSeverityApi)[keyof typeof ErrorTrackingQueryIssueSeverityApi]++export const ErrorTrackingQueryIssueSeverityApi = {+ Low: 'low',+ Medium: 'medium',+ High: 'high',+ Critical: 'critical',+} as const+export type ErrorTrackingIssueStatusApi = (typeof ErrorTrackingIssueStatusApi)[keyof typeof ErrorTrackingIssueStatusApi]export const ErrorTrackingIssueStatusApi = {@@ -4894,6 +4904,7 @@ export interface ErrorTrackingIssueApi {last_seen: stringlibrary?: string | nullname?: string | null+ severity?: ErrorTrackingQueryIssueSeverityApi | nullsource?: string | nullstatus: ErrorTrackingIssueStatusApi}@@ -4944,6 +4955,7 @@ export interface ErrorTrackingCorrelatedIssueApi {name?: string | nullodds_ratio: numberpopulation: PopulationApi+ severity?: ErrorTrackingQueryIssueSeverityApi | nullstatus: ErrorTrackingIssueStatusApi}@@ -7563,6 +7575,7 @@ export interface ErrorTrackingPendingFingerprintIssueStateUpdateApi {issue_description?: string | nullissue_id: stringissue_name?: string | null+ issue_severity?: ErrorTrackingQueryIssueSeverityApi | nullissue_status: string/** Client-stamped monotonic version (`Date.now()` ms at mutation success). */version: numberdiff --git a/products/error_tracking/frontend/components/ActivityDescriber.tsx b/products/error_tracking/frontend/components/ActivityDescriber.tsxindex 6bf29f016420..ed2fa2535d41 100644--- a/products/error_tracking/frontend/components/ActivityDescriber.tsx+++ b/products/error_tracking/frontend/components/ActivityDescriber.tsx@@ -113,6 +113,7 @@ const errorTrackingIssueActionsMapping: Record</** readonly / computed fields aren't described */id: () => null,+ severity: () => null,name: () => null,description: () => null,first_seen: () => null,diff --git a/products/error_tracking/frontend/logics/pendingFingerprintIssueStateUpdateLogic.ts b/products/error_tracking/frontend/logics/pendingFingerprintIssueStateUpdateLogic.tsindex 14898da39e04..97e31ad68890 100644--- a/products/error_tracking/frontend/logics/pendingFingerprintIssueStateUpdateLogic.ts+++ b/products/error_tracking/frontend/logics/pendingFingerprintIssueStateUpdateLogic.ts@@ -3,11 +3,7 @@ import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } froimport api from 'lib/api'import { ErrorTrackingFingerprint } from 'lib/components/Errors/types'-import {- ErrorTrackingIssue,- ErrorTrackingPendingFingerprintIssueStateUpdate,- ErrorTrackingRelationalIssue,-} from '~/queries/schema/schema-general'+import { ErrorTrackingIssue, ErrorTrackingPendingFingerprintIssueStateUpdate } from '~/queries/schema/schema-general'import { errorTrackingIssueSceneLogic } from '../scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic'import { issuesDataNodeLogic } from './issuesDataNodeLogic'@@ -151,16 +147,14 @@ export const pendingFingerprintIssueStateUpdateLogic = kea<pendingFingerprintIss])function findCurrentIssueState(id: string): CurrentIssueState | null {- const detail = errorTrackingIssueSceneLogic.findMounted({ id })?.values.issue as- | ErrorTrackingRelationalIssue- | null- | undefined+ const detail = errorTrackingIssueSceneLogic.findMounted({ id })?.values.issueif (detail && detail.id === id) {return {id: detail.id,name: detail.name ?? null,description: detail.description ?? null,status: detail.status,+ severity: detail.severity ?? null,assignee: detail.assignee ?? null,first_seen: detail.first_seen,}@@ -174,6 +168,7 @@ function findCurrentIssueState(id: string): CurrentIssueState | null {name: listIssue.name ?? null,description: listIssue.description ?? null,status: listIssue.status,+ severity: listIssue.severity ?? null,assignee: listIssue.assignee ?? null,first_seen: listIssue.first_seen,}diff --git a/products/error_tracking/frontend/logics/pendingUpdateHelpers.ts b/products/error_tracking/frontend/logics/pendingUpdateHelpers.tsindex c757ab8f9ac6..3cc5cd405836 100644--- a/products/error_tracking/frontend/logics/pendingUpdateHelpers.ts+++ b/products/error_tracking/frontend/logics/pendingUpdateHelpers.ts@@ -1,11 +1,13 @@import {ErrorTrackingIssueAssignee,ErrorTrackingIssueStatus,+ ErrorTrackingQueryIssueSeverity,ErrorTrackingPendingFingerprintIssueStateUpdate,} from '~/queries/schema/schema-general'export interface IssueStateDelta {status?: ErrorTrackingIssueStatus+ severity?: ErrorTrackingQueryIssueSeverity | nullname?: string | nulldescription?: string | nullassignee?: ErrorTrackingIssueAssignee | null@@ -16,6 +18,7 @@ export interface CurrentIssueState {name: string | nulldescription: string | nullstatus: ErrorTrackingIssueStatus+ severity: ErrorTrackingQueryIssueSeverity | nullassignee: ErrorTrackingIssueAssignee | nullfirst_seen: string}@@ -24,6 +27,7 @@ export function applyDelta(current: CurrentIssueState, delta: IssueStateDelta):return {...current,status: delta.status ?? current.status,+ severity: delta.severity !== undefined ? delta.severity : current.severity,name: delta.name !== undefined ? delta.name : current.name,description: delta.description !== undefined ? delta.description : current.description,assignee: delta.assignee !== undefined ? delta.assignee : current.assignee,@@ -43,6 +47,7 @@ export function buildPendingUpdate(issue_name: state.name ?? null,issue_description: state.description ?? null,issue_status: state.status,+ issue_severity: state.severity,assigned_user_id: assignee?.type === 'user' ? Number(assignee.id) : null,assigned_role_id: assignee?.type === 'role' ? String(assignee.id) : null,first_seen: state.first_seen,diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.tsindex dc94c894f8f8..cda50ee6e327 100644--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.ts+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.ts@@ -52,6 +52,7 @@ import type {ErrorTrackingIssueCohort,EventsQuery,} from '../../../../../frontend/src/queries/schema/schema-general'+import type { ErrorTrackingQueryIssueSeverity } from '../../../../../frontend/src/queries/schema/schema-general'import { issueActionsLogic } from '../../components/IssueActions/issueActionsLogic'import {DEFAULT_DATE_RANGE,@@ -182,6 +183,7 @@ export interface errorTrackingIssueSceneLogicActions {first_seen: stringid: stringname: string | null+ severity?: ErrorTrackingQueryIssueSeverity | null | undefinedstatus: ErrorTrackingIssueStatus} | null,payload?: {@@ -197,6 +199,7 @@ export interface errorTrackingIssueSceneLogicActions {first_seen: stringid: stringname: string | null+ severity?: ErrorTrackingQueryIssueSeverity | null | undefinedstatus: ErrorTrackingIssueStatus} | nullpayload?: {@@ -367,6 +370,7 @@ export interface errorTrackingIssueSceneLogicActions {first_seen: stringid: stringname: string | null+ severity?: ErrorTrackingQueryIssueSeverity | null | undefinedstatus: ErrorTrackingIssueStatus} | null,payload?: {@@ -381,6 +385,7 @@ export interface errorTrackingIssueSceneLogicActions {first_seen: stringid: stringname: string | null+ severity?: ErrorTrackingQueryIssueSeverity | null | undefinedstatus: ErrorTrackingIssueStatus} | nullpayload?: {@@ -406,6 +411,7 @@ export interface errorTrackingIssueSceneLogicActions {first_seen: stringid: stringname: string | null+ severity?: ErrorTrackingQueryIssueSeverity | null | undefinedstatus: ErrorTrackingIssueStatus} | null,payload?: {@@ -420,6 +426,7 @@ export interface errorTrackingIssueSceneLogicActions {first_seen: stringid: stringname: string | null+ severity?: ErrorTrackingQueryIssueSeverity | null | undefinedstatus: ErrorTrackingIssueStatus} | nullpayload?: {@@ -445,6 +452,7 @@ export interface errorTrackingIssueSceneLogicActions {first_seen: stringid: stringname: string+ severity?: ErrorTrackingQueryIssueSeverity | null | undefinedstatus: ErrorTrackingIssueStatus} | null,payload?: {@@ -459,6 +467,7 @@ export interface errorTrackingIssueSceneLogicActions {first_seen: stringid: stringname: string+ severity?: ErrorTrackingQueryIssueSeverity | null | undefinedstatus: ErrorTrackingIssueStatus} | nullpayload?: {@@ -484,6 +493,7 @@ export interface errorTrackingIssueSceneLogicActions {first_seen: stringid: stringname: string | null+ severity?: ErrorTrackingQueryIssueSeverity | null | undefinedstatus: ErrorTrackingIssueStatus} | null,payload?: {@@ -498,6 +508,7 @@ export interface errorTrackingIssueSceneLogicActions {first_seen: stringid: stringname: string | null+ severity?: ErrorTrackingQueryIssueSeverity | null | undefinedstatus: ErrorTrackingIssueStatus} | nullpayload?: {diff --git a/products/product_analytics/frontend/generated/api.schemas.ts b/products/product_analytics/frontend/generated/api.schemas.tsindex ea9653a225f3..6610fb1bb900 100644--- a/products/product_analytics/frontend/generated/api.schemas.ts+++ b/products/product_analytics/frontend/generated/api.schemas.ts@@ -4063,6 +4063,16 @@ export interface LastEventApi {uuid: string}+export type ErrorTrackingQueryIssueSeverityApi =+ (typeof ErrorTrackingQueryIssueSeverityApi)[keyof typeof ErrorTrackingQueryIssueSeverityApi]++export const ErrorTrackingQueryIssueSeverityApi = {+ Low: 'low',+ Medium: 'medium',+ High: 'high',+ Critical: 'critical',+} as const+export type ErrorTrackingIssueStatusApi = (typeof ErrorTrackingIssueStatusApi)[keyof typeof ErrorTrackingIssueStatusApi]export const ErrorTrackingIssueStatusApi = {@@ -4087,6 +4097,7 @@ export interface ErrorTrackingIssueApi {last_seen: stringlibrary?: string | nullname?: string | null+ severity?: ErrorTrackingQueryIssueSeverityApi | nullsource?: string | nullstatus: ErrorTrackingIssueStatusApi}@@ -4137,6 +4148,7 @@ export interface ErrorTrackingCorrelatedIssueApi {name?: string | nullodds_ratio: numberpopulation: PopulationApi+ severity?: ErrorTrackingQueryIssueSeverityApi | nullstatus: ErrorTrackingIssueStatusApi}@@ -6756,6 +6768,7 @@ export interface ErrorTrackingPendingFingerprintIssueStateUpdateApi {issue_description?: string | nullissue_id: stringissue_name?: string | null+ issue_severity?: ErrorTrackingQueryIssueSeverityApi | nullissue_status: string/** Client-stamped monotonic version (`Date.now()` ms at mutation success). */version: numberdiff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex d82201fe1952..e150b2dc8375 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -6323,6 +6323,16 @@ export namespace Schemas {uuid: string;}+ export type ErrorTrackingQueryIssueSeverity = typeof ErrorTrackingQueryIssueSeverity[keyof typeof ErrorTrackingQueryIssueSeverity];+++ export const ErrorTrackingQueryIssueSeverity = {+ Low: 'low',+ Medium: 'medium',+ High: 'high',+ Critical: 'critical',+ } as const;+export type ErrorTrackingIssueStatus = typeof ErrorTrackingIssueStatus[keyof typeof ErrorTrackingIssueStatus];@@ -6348,6 +6358,7 @@ export namespace Schemas {last_seen: string;library?: string | null;name?: string | null;+ severity?: ErrorTrackingQueryIssueSeverity | null;source?: string | null;status: ErrorTrackingIssueStatus;}@@ -6398,6 +6409,7 @@ export namespace Schemas {name?: string | null;odds_ratio: number;population: Population;+ severity?: ErrorTrackingQueryIssueSeverity | null;status: ErrorTrackingIssueStatus;}@@ -7669,6 +7681,7 @@ export namespace Schemas {issue_description?: string | null;issue_id: string;issue_name?: string | null;+ issue_severity?: ErrorTrackingQueryIssueSeverity | null;issue_status: string;/** Client-stamped monotonic version (`Date.now()` ms at mutation success). */version: number;