@nestjs/observe 0.3.2 → 0.3.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 +39 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/interfaces/observe-options.interface.d.ts +62 -0
- package/dist/observe.module.js +4 -1
- package/dist/protocols/job-trace-runner.d.ts +9 -3
- package/dist/protocols/job-trace-runner.js +53 -9
- package/dist/protocols/queue-observe-agent.service.d.ts +34 -0
- package/dist/protocols/queue-observe-agent.service.js +92 -7
- package/dist/protocols/rpc-observe-agent.service.d.ts +2 -2
- package/dist/protocols/rpc-observe-agent.service.js +28 -23
- package/dist/services/operation-trace.registry.d.ts +25 -0
- package/dist/services/operation-trace.registry.js +54 -0
- package/dist/services/skip-spans.util.d.ts +14 -0
- package/dist/services/skip-spans.util.js +20 -0
- package/package.json +5 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns the user-facing option into the one predicate the registry asks, or
|
|
3
|
+
* `undefined` when nothing is to be skipped - so an application that never
|
|
4
|
+
* set it pays one falsy check per operation and builds no context object.
|
|
5
|
+
*
|
|
6
|
+
* A list matches on the status code alone, by strict equality: a status never
|
|
7
|
+
* reaches the registry as a string, so `"404"` in the list can only be a
|
|
8
|
+
* mistake, and a list that coerced its way into skipping more than it names
|
|
9
|
+
* would be the worse one to get wrong.
|
|
10
|
+
*/
|
|
11
|
+
export function resolveSkipSpans(option) {
|
|
12
|
+
if (typeof option === "function") {
|
|
13
|
+
return option;
|
|
14
|
+
}
|
|
15
|
+
if (!Array.isArray(option) || option.length === 0) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
const statusCodes = new Set(option);
|
|
19
|
+
return ({ statusCode }) => statusCode !== undefined && statusCodes.has(statusCode);
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/observe",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Observability and APM agent for NestJS - traces, runtime metrics, custom metrics and CPU profiles",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"homepage": "https://observe.nestjs.com",
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"@nestjs/microservices": "^11.0.0 || ^12.0.0",
|
|
79
79
|
"@nestjs/schedule": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^12.0.0",
|
|
80
80
|
"@nestjs/websockets": "^11.0.0 || ^12.0.0",
|
|
81
|
+
"@taskforcesh/bullmq-pro": "^7.0.0",
|
|
81
82
|
"bull": "^3.3.0 || ^4.0.0",
|
|
82
83
|
"bullmq": "^5.0.0 || ^6.0.0",
|
|
83
84
|
"reflect-metadata": "^0.1.12 || ^0.2.0",
|
|
@@ -102,6 +103,9 @@
|
|
|
102
103
|
"@nestjs/websockets": {
|
|
103
104
|
"optional": true
|
|
104
105
|
},
|
|
106
|
+
"@taskforcesh/bullmq-pro": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
105
109
|
"bull": {
|
|
106
110
|
"optional": true
|
|
107
111
|
},
|