Skip to main content

Error Instrumentation

Generates: Logs

Automatically captures unhandled & handled JavaScript errors. Also supports manual error reporting.

Configuration

Error instrumentation is enabled by default. You can disable it if needed:

Pulse.start({
autoDetectExceptions: true // Enabled by default
});

When autoDetectExceptions: false, unhandled errors are not automatically captured. However, you can still manually report errors using Pulse.reportException().

What Gets Tracked

When autoDetectExceptions is enabled:

  • Runtime errors and crashes
  • Fatal and non-fatal exceptions

You can also manually report caught exceptions:

try {
await riskyOperation();
} catch (error) {
Pulse.reportException(error);
}

Generated Telemetry

Type: Logs
Body: Error message

Attributes

Error-Specific Attributes

AttributeDescriptionExampleAlways Present
pulse.typeInstrumentation type"non_fatal"✅ Yes
error.fatalWhether error is fataltrue, false✅ Yes
error.sourceError source"js"✅ Yes
exception.typeError class name"Error", "TypeError"✅ Yes
exception.messageError message"Handled error (demo)"✅ Yes
exception.stacktraceFull JavaScript stack traceComplete stack trace string✅ Yes
platformReact Native platform"react-native"✅ Yes
thread.idJavaScript thread ID"69", "91"✅ Yes
thread.nameJavaScript thread name"mqt_v_js"✅ Yes
screen.nameCurrent screen name"MainActivity"⚠️ If available
session.idSession identifier"e19b517c705f78d5937c38005259ee1f"✅ Yes
span_idActive span ID"dc01e758f8c88a95"⚠️ Only if error occurs during active span
trace_idActive trace ID"09ae56c35b2170fbb9a30a9376f75ea2"⚠️ Only if error occurs during active trace
trace_flagsTrace flags0 (no trace) or 1 (active trace)✅ Yes

Note: When an error occurs during an active trace or span, span_id and trace_id are included in the error event. For fatal errors, active spans can be traced since the error occurred before the span ended, allowing you to see the full context of what was happening when the crash occurred.

Sample Payload: Handled Error (Non-Fatal)

{
"body": "Handled error (demo)",
"date": "2025-11-27T12:50:45.334Z",
"id": "0iiWlkd7cv7ADf2xPGO1TmIBPEO",
"timestamp": "2025-11-27T12:50:45.334Z",
"attributes": {
"error.fatal": false,
"error.source": "js",
"exception.message": "Handled error (demo)",
"exception.stacktrace": "Error: Handled error (demo)\n at triggerHandledError (...)",
"exception.type": "Error",
"network.carrier.icc": "us",
"network.carrier.mcc": "310",
"network.carrier.mnc": "260",
"network.carrier.name": "T-Mobile",
"network.connection.type": "cell",
"platform": "react-native",
"pulse.type": "non_fatal",
"screen.name": "MainActivity",
"session.id": "e19b517c705f78d5937c38005259ee1f",
"thread.id": "69",
"thread.name": "mqt_v_js"
},
"resources": {
"android.os.api_level": "36",
"app.build_id": "1",
"app.build_name": "1.0_1",
"device.manufacturer": "Google",
"device.model.identifier": "sdk_gphone64_arm64",
"device.model.name": "sdk_gphone64_arm64",
"os.description": "BE2A.250530.026.D1",
"os.name": "Android",
"os.type": "linux",
"os.version": "16",
"rum.sdk.version": "0.16.0-alpha-SNAPSHOT",
"service.name": "PulseReactNativeOtelExample",
"service.version": "1.0_1",
"telemetry.sdk.language": "java",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.54.1"
},
"span_id": "",
"trace_flags": 0,
"trace_id": ""
}

Sample Payload: Unhandled Error (Fatal)

{
"body": "Unhandled error (demo)",
"date": "2025-11-27T12:50:51.361Z",
"id": "0iiWlvYzccwGGo3DAeTeaJlGKsC",
"timestamp": "2025-11-27T12:50:51.361Z",
"attributes": {
"error.fatal": true,
"error.source": "js",
"exception.message": "Unhandled error (demo)",
"exception.stacktrace": "Error: Unhandled error (demo)\n at anonymous (...)",
"exception.type": "Error",
"network.carrier.icc": "us",
"network.carrier.mcc": "310",
"network.carrier.mnc": "260",
"network.carrier.name": "T-Mobile",
"network.connection.type": "cell",
"platform": "react-native",
"pulse.type": "non_fatal",
"screen.name": "MainActivity",
"session.id": "e19b517c705f78d5937c38005259ee1f",
"thread.id": "69",
"thread.name": "mqt_v_js"
},
"resources": {
"android.os.api_level": "36",
"app.build_id": "1",
"app.build_name": "1.0_1",
"device.manufacturer": "Google",
"device.model.identifier": "sdk_gphone64_arm64",
"device.model.name": "sdk_gphone64_arm64",
"os.description": "BE2A.250530.026.D1",
"os.name": "Android",
"os.type": "linux",
"os.version": "16",
"rum.sdk.version": "0.16.0-alpha-SNAPSHOT",
"service.name": "PulseReactNativeOtelExample",
"service.version": "1.0_1",
"telemetry.sdk.language": "java",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.54.1"
},
"span_id": "",
"trace_flags": 0,
"trace_id": ""
}

Sample Payload: Error During Active Span

{
"body": "Handled error with span (demo)",
"date": "2025-11-27T13:12:30.666Z",
"id": "0iiXNwat6hg4eSAvt1XMJORsXE7",
"timestamp": "2025-11-27T13:12:30.666Z",
"attributes": {
"error.fatal": false,
"error.source": "js",
"exception.message": "Handled error with span (demo)",
"exception.stacktrace": "Error: Handled error with span (demo)\n at triggerHandledErrorWithSpan (...)",
"exception.type": "Error",
"network.carrier.icc": "us",
"network.carrier.mcc": "310",
"network.carrier.mnc": "260",
"network.carrier.name": "T-Mobile",
"network.connection.type": "cell",
"platform": "react-native",
"pulse.type": "non_fatal",
"screen.name": "MainActivity",
"session.id": "dce09977c69b0a5c15aa5fd01f817514",
"thread.id": "68",
"thread.name": "mqt_v_js"
},
"resources": {
"android.os.api_level": "36",
"app.build_id": "1",
"app.build_name": "1.0_1",
"device.manufacturer": "Google",
"device.model.identifier": "sdk_gphone64_arm64",
"device.model.name": "sdk_gphone64_arm64",
"os.description": "BE2A.250530.026.D1",
"os.name": "Android",
"os.type": "linux",
"os.version": "16",
"rum.sdk.version": "0.16.0-alpha-SNAPSHOT",
"service.name": "PulseReactNativeOtelExample",
"service.version": "1.0_1",
"telemetry.sdk.language": "java",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.54.1"
},
"span_id": "dc01e758f8c88a95",
"trace_flags": 1,
"trace_id": "09ae56c35b2170fbb9a30a9376f75ea2"
}

Note: All error events include global attributes (service, device, OS, session, network carrier, etc.) in the resources object. See Global Attributes for complete list.

Manual Error Reporting API

// Basic reporting
Pulse.reportException(error);

// Report as fatal
Pulse.reportException(error, true);

// With custom attributes
Pulse.reportException(error, false, {
userId: 'user-123',
operation: 'checkout'
});