Zum Hauptinhalt springen

Fehlerverfolgung

Die Fehlerverfolgung erfasst die Fehler, die eine Seite wirft, als Ereignisse, fasst die mit derselben Ursache zu einem Problem zusammen und zeigt, wie oft jedes auftritt, bei wie vielen Personen und in welchen Sitzungen. Die Erfassung wird pro Client aktiviert, und eine Ausnahme zählt in jedem Tarif als Ereignis.

At a glance

Enable
createWebClient({ errorTracking: true })
Event
$exception, an ordinary event
Grouping
By type and stack at ingest, never by line number
Statuses
open, resolved, archived, suppressed
Read
errorIssues, errorIssue over GraphQL, REST and MCP
Plan
Every plan; an exception counts as an event
  • Nicht abgefangene Fehler und unbehandelte Ablehnungen werden von selbst erfasst; captureException sendet einen Fehler, den Ihr Code abgefangen hat.
  • Fehler werden beim Eintreffen nach Typ und Stack gruppiert, nie nach Zeilennummern, sodass ein Problem nach einem Deployment dasselbe bleibt.
  • Lösen, archivieren, unterdrücken oder weisen Sie ein Problem zu; ein gelöstes wird wieder geöffnet, wenn sein Fehler zurückkehrt.

So funktioniert es

With errorTracking on, the web SDK listens for the page’s uncaught errors and unhandled promise rejections and sends each as a $exception event with $exception_handled: false. captureException sends an error your own code caught, as handled. The event travels the path every event travels, so a trend, a funnel, a cohort, an event stream and the warehouse all see it, and it carries the session it happened in.

As the event arrives, the platform works out which issue it belongs to and writes that as $exception_fingerprint. Whatever a sender put under that name is replaced: a page cannot choose its issue. The first exception of a fingerprint opens an issue; every later one moves when the issue was last seen.

What an exception carries

An exception carries its type ($exception_type), its message ($exception_message, 1,000 characters at most), its stack as frames ($exception_frames, 50 at most, each a function, a file, a line and a column) and the page it happened on. A file’s address is recorded without its fragment, without a name and password, and with every query value replaced by [redacted].

An error’s message is whatever the page’s code wrote and can hold a person’s details, which is why capture is off until you turn it on. To drop or scrub a property before it is stored, use a transformation on $exception.

How errors are grouped

Two exceptions are one issue when they have the same type and the same five innermost frames, each read as its function and its file. A file is read without its host and without any build hash in its path, and a frame’s line and column are never read, so the same error is the same issue before and after a deploy. An exception with no stack is grouped by its type and its message with every number replaced, so Order 1042 failed and Order 1043 failed are one issue.

Statuses

StatusWhat it meansWhen the error happens again
<code>open</code>Nobody has dealt with it yet, or it came back after being resolved (<code>regressedAt</code> says when)It stays open
<code>resolved</code>Fixed, by the member it names, at the time it namesIt is reopened and marked as regressed, with the time
<code>archived</code>Known and not worth fixingIt stays archived
<code>suppressed</code>NoiseThe exception is dropped as it arrives: not stored, not counted against the events allowance

An issue can be assigned to one member of the company. When that member leaves, the issue still names them and reads as unassigned in every filter. Reading issues takes prodantix.errors.read, which every member holds; changing a status or an assignee takes prodantix.errors.manage, which Owner and Admin hold and a custom role can be given.

Reading an issue

errorIssues lists a project’s issues, the one seen most recently first, each with how often it happened (occurrences) and to how many people (people) in the range you ask for, or in everything stored. It filters by status (regressed keeps the open issues that came back after being resolved), by one member (memberSub) or the unassigned ones (unassigned), and by a search over the type and the message, 50 a page and 200 at most. The counts are read from the events themselves, so they never drift from what a trend of $exception shows. errorIssueCounts answers how many issues each status holds under the same filters.

errorIssuesInSession answers the issues whose errors happened in one session, the one seen most recently first. It is how a recording’s console errors open their issue: give it the session id a replay carries.

errorIssue answers one issue with its occurrences on each day (the range you ask for, a year at most, or the thirty days to now) and the sessions it happened in, newest first and fifty at most. Each session says whether its recording still exists (hasRecording) and how far into it the error first happens (watchAtMs), so a list never offers a replay that was not made or has expired. errorIssueChanges tells a list when an issue opens, regresses, changes status or changes hands.

GraphQL
query OpenIssues($projectId: String!) {
  errorIssues(projectId: $projectId, status: "open", limit: 20) {
    id
    type
    message
    lastSeen
    occurrences
    people
    assigneeName
  }
}

Wo Sie darauf zugreifen

SurfaceOperation
RESTGET /v1/projects/{projectId}/error-issues, GET .../error-issue-counts, GET .../sessions/{sessionId}/error-issues, GET .../error-issues/{issueId}, PUT .../error-issues/{issueId}/status, PUT .../error-issues/{issueId}/assignee
GraphQLerrorIssues, errorIssueCounts, errorIssuesInSession, errorIssue queries; setErrorIssueStatus, assignErrorIssue mutations; errorIssueChanges subscription
RealtimeerrorIssueChange in the project room
MCPprodantix.errors.issues, prodantix.errors.counts, prodantix.errors.session_issues, prodantix.errors.issue, prodantix.errors.set_status, prodantix.errors.assign

Beispiel

TypeScript
import { captureException, createWebClient } from '@prodantix/sdk/web';

const prodantix = createWebClient({
  apiKey: process.env.PRODANTIX_KEY,
  errorTracking: true,
});

try {
  await submitOrder(cart);
} catch (error) {
  // An error your code caught is sent as handled, with what you add to it.
  captureException(prodantix, error, { cart_size: cart.items.length });
  throw error;
}

Capture ships in the web SDK from version 0.14.0. The server, Flutter and Python SDKs do not capture errors yet.