Error tracking enables you to track, investigate, and resolve exceptions your customers face.
If you're using a different SDK or the API, you can manually capture errors by using the capture API or calling the capture
method to capture an $exception
event with the following properties:
Property | Description |
---|---|
$exception_list | A list of exception objects with detailed information about each error |
$exception_fingerprint | (Optional) The identifier used to group issues. If not set, a unique hash based on the exception pattern will be generated during ingestion |
The expected schema is described as a type in our JS repo.
Example
Terminal
curl -X POST "https://us.i.posthog.com/i/v0/e/" \-H "Content-Type: application/json" \-d '{"api_key": "<ph_project_api_key>","event": "$exception","properties": {"distinct_id": "distinct_id_of_your_user","$exception_list": [{"type": "RangeError","value": "Maximum call stack size exceeded","mechanism": {"handled": true,"synthetic": false},"stacktrace": {"type": "resolved","frames": [{"raw_id": "89f3907385ddb1bdc2feebd77625387d685e3da2f9a68bcf2634e3b3b39122e51f895e5c880def374525c558899b2e90eed214900ff9c8f949243e4b79eb32a9","mangled_name": "Array.forEach","in_app": false,"resolved_name": "Array.forEach","lang": "javascript","resolved": true},/* Additional frames omitted for brevity */]}}],"$exception_fingerprint": "209842d96784e19321e3a36b068d53fff7a01ebcb1da9e98df35c4c49db0b4f3b62aea7ee25a714470e61f8d36b4716f227f241c153477e5fa9adfda64ce9f71"},}'