त्रुटि ट्रैकिंग
त्रुटि ट्रैकिंग किसी पेज द्वारा फेंकी गई त्रुटियों को इवेंट के रूप में पकड़ती है, एक ही कारण वाली त्रुटियों को एक समस्या में समूहित करती है, और दिखाती है कि हर एक कितनी बार, कितने लोगों के साथ और किन सत्रों में होती है। कैप्चर प्रति क्लाइंट वैकल्पिक है, और हर प्लान में एक एक्सेप्शन एक इवेंट गिना जाता है।
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,errorIssueover GraphQL, REST and MCP- Plan
- Every plan; an exception counts as an event
- न पकड़ी गई त्रुटियाँ और न संभाले गए रिजेक्शन अपने आप कैप्चर होते हैं; captureException वह त्रुटि भेजता है जिसे आपके कोड ने पकड़ा।
- त्रुटियाँ आते ही अपने प्रकार और स्टैक के आधार पर समूहित होती हैं, पंक्ति संख्या के आधार पर कभी नहीं, इसलिए डिप्लॉय के बाद भी समस्या वही रहती है।
- किसी समस्या को हल करें, संग्रहित करें, दबाएँ या सौंपें; हल की गई समस्या अपनी त्रुटि लौटने पर फिर खुल जाती है।
यह कैसे काम करता है
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].
$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
| Status | What it means | When 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 names | It is reopened and marked as regressed, with the time |
| <code>archived</code> | Known and not worth fixing | It stays archived |
| <code>suppressed</code> | Noise | The 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.
query OpenIssues($projectId: String!) {
errorIssues(projectId: $projectId, status: "open", limit: 20) {
id
type
message
lastSeen
occurrences
people
assigneeName
}
}इसे कहाँ से एक्सेस करें
| Surface | Operation |
|---|---|
| REST | GET /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 |
| GraphQL | errorIssues, errorIssueCounts, errorIssuesInSession, errorIssue queries; setErrorIssueStatus, assignErrorIssue mutations; errorIssueChanges subscription |
| Realtime | errorIssueChange in the project room |
| MCP | prodantix.errors.issues, prodantix.errors.counts, prodantix.errors.session_issues, prodantix.errors.issue, prodantix.errors.set_status, prodantix.errors.assign |
उदाहरण
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.