@defjs/opentelemetry-server 0.0.2 → 0.0.3
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.
- package/README.md +1 -1
- package/index.d.ts +1 -1
- package/index.js +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ It is a middleware plugin — the plugin form of an interceptor chain. Your appl
|
|
|
10
10
|
bun add @defjs/core @defjs/opentelemetry-server @opentelemetry/api @opentelemetry/core
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
The package is ESM and requires `@defjs/core` as a peer in the `^0.
|
|
13
|
+
The package is ESM and requires `@defjs/core` as a peer in the `^0.6.0` range.
|
|
14
14
|
|
|
15
15
|
## Quick start
|
|
16
16
|
|
package/index.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ interface OpenTelemetryServerTransportOptions<TResponse> {
|
|
|
39
39
|
*
|
|
40
40
|
* - The HTTP span ends as soon as `responseHook` returns; the hook is not awaited, so only its synchronous part can still change the span. A status of 400 or above ends it `ERROR` with `error.type` set to the status string; 100–399 leaves its status unset. An asynchronous hook rejection after end is reported through `diag.error`; configure `diag.setLogger(...)` from `@opentelemetry/api` to receive it. It cannot append events to an ended span.
|
|
41
41
|
*
|
|
42
|
-
* - A rejection through the interceptor has no response status and does not call `responseHook`. That includes a network failure, caller cancellation, an abort whose reason is `TimeoutError`, any declared-body read failure (`BodyFailure`, including text, blob, and bytes, not only JSON), and a progress observer failure (`EXT_OBSERVER_FAILED`). The span ends `ERROR` with `error.type` set to the thrown class name, such as `TypeError`, `Error` or `BodyFailure`. Caller cancellation is `Error` whatever the abort reason. There is no `timeout` option; a deadline is `
|
|
42
|
+
* - A rejection through the interceptor has no response status and does not call `responseHook`. That includes a network failure, caller cancellation, an abort whose reason is `TimeoutError`, any declared-body read failure (`BodyFailure`, including text, blob, and bytes, not only JSON), and a progress observer failure (`EXT_OBSERVER_FAILED`). The span ends `ERROR` with `error.type` set to the thrown class name, such as `TypeError`, `Error` or `BodyFailure`. Caller cancellation is `Error` whatever the abort reason. There is no `timeout` option; a deadline is `signal`.
|
|
43
43
|
*
|
|
44
44
|
* Pass `{ enabled: false }` to skip HTTP instrumentation. Span hooks run only when a `tracer` is supplied.
|
|
45
45
|
*
|
package/index.js
CHANGED
|
@@ -272,12 +272,12 @@ const CLIENT_EXCEPTIONS = {
|
|
|
272
272
|
/**
|
|
273
273
|
* Caller cancellation produces no log. An abort whose reason is `TimeoutError` or `ERR_TIMEOUT` still logs.
|
|
274
274
|
*
|
|
275
|
-
* `request.
|
|
275
|
+
* `request.signal` alone is not cancellation: WebSocket `finish()` aborts that same signal
|
|
276
276
|
* when a connect fails. Cancellation is an abort sentinel from any `@defjs/core` copy, or an
|
|
277
|
-
* `AbortError`, on the rejection or on `request.
|
|
277
|
+
* `AbortError`, on the rejection or on `request.signal.reason`. There is no `timeout` option.
|
|
278
278
|
*/
|
|
279
279
|
function isCallerCancellation(request, error) {
|
|
280
|
-
const reason = request.
|
|
280
|
+
const reason = request.signal?.reason;
|
|
281
281
|
if (isTimeoutCause(error) || isTimeoutCause(reason)) return false;
|
|
282
282
|
return isAbortCause(error) || isAbortCause(reason);
|
|
283
283
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defjs/opentelemetry-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Append OpenTelemetry interceptors to an application-owned Defjs client.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/defjs/defjs/issues"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@opentelemetry/api-logs": "^0.223.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@defjs/core": "^0.
|
|
20
|
+
"@defjs/core": "^0.6.0",
|
|
21
21
|
"@opentelemetry/api": "^1.0.0",
|
|
22
22
|
"@opentelemetry/core": "^2.0.0 || ^3.0.0"
|
|
23
23
|
},
|