@orbitai/orbitrace 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +5 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -47,7 +47,7 @@ const orbitrace = getOrbitraceInstance({ service: "api" });
47
47
  try {
48
48
  // Your code here
49
49
  } catch (error) {
50
- await orbitrace.captureException(error, {
50
+ orbitrace.captureException(error, {
51
51
  endpoint: "/users",
52
52
  action: "createUser",
53
53
  });
@@ -57,15 +57,16 @@ try {
57
57
  ### 3. Capture Messages
58
58
 
59
59
  ```javascript
60
- await orbitrace.captureMessage("User registered", {
60
+ orbitrace.captureMessage("User registered", {
61
61
  userId: "123",
62
62
  });
63
63
  ```
64
64
 
65
65
  ### 4. Delivery Behavior
66
66
 
67
- Orbitrace never throws and never blocks your application for long:
67
+ Orbitrace never throws and never blocks your application:
68
68
 
69
+ - `captureException` and `captureMessage` return as soon as the event is queued. The request is sent in the background, so a request handler that captures an error does not wait for Orbitrace before answering its own client. Awaiting them is harmless but waits for nothing; use `flush()` when you need to know the events were delivered.
69
70
  - Each request times out after 5 seconds. Failures are logged to the console and swallowed.
70
71
  - Repeats of the same event (same message and stack) within 10 seconds are counted locally and sent as one request with an occurrence count, so an error raised in a loop costs at most two requests per 10 seconds.
71
72
  - At most 10 requests are in flight at once; events beyond that are dropped.
@@ -79,7 +80,7 @@ await orbitrace.flush();
79
80
 
80
81
  ### 5. Automatic Capture
81
82
 
82
- Pass `autoCapture: true` to `getInstance` (SDK 1.2.0 or newer) to capture what nobody handled and record breadcrumbs automatically. It is off unless you turn it on, so upgrading never changes how an application crashes or logs.
83
+ Pass `autoCapture: true` to `getInstance` (SDK 1.2.1 or newer) to capture what nobody handled and record breadcrumbs automatically. It is off unless you turn it on, so upgrading never changes how an application crashes or logs.
83
84
 
84
85
  ```javascript
85
86
  orbitrace.getInstance({ ...config, autoCapture: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbitai/orbitrace",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Error tracking for Node.js services: manual and automatic capture with breadcrumbs",
5
5
  "main": "dist/index.js",
6
6
  "files": [