@biorate/nestjs-tools 1.140.0 → 1.141.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@biorate/nestjs-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.141.0",
|
|
4
4
|
"description": "NestJS tools",
|
|
5
5
|
"main": "dist",
|
|
6
6
|
"scripts": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"http-proxy-middleware": "2.0.6",
|
|
45
45
|
"on-headers": "1.0.2"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "d822168dd2508553618deaf5f5e0c71b2142f143"
|
|
48
48
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tap } from 'rxjs';
|
|
1
|
+
import { tap, catchError } from 'rxjs';
|
|
2
2
|
import { trace, Span } from '@biorate/opentelemetry';
|
|
3
3
|
import {
|
|
4
4
|
Injectable,
|
|
@@ -34,14 +34,17 @@ export class TracingInterceptor implements NestInterceptor {
|
|
|
34
34
|
const req = host.getRequest();
|
|
35
35
|
const res = host.getResponse();
|
|
36
36
|
if (this.excluded(req.url)) return next.handle();
|
|
37
|
+
span.setAttribute('request.url', this.stringify(req.url));
|
|
38
|
+
span.setAttribute('request.body', this.stringify(req.body));
|
|
39
|
+
span.setAttribute('request.headers', this.stringify(req.headers));
|
|
40
|
+
span.setAttribute('request.method', this.stringify(req.method));
|
|
41
|
+
span.setAttribute('request.params', this.stringify(req.params));
|
|
42
|
+
span.setAttribute('request.query', this.stringify(req.query));
|
|
37
43
|
return next.handle().pipe(
|
|
44
|
+
catchError((e: Error) => {
|
|
45
|
+
throw e;
|
|
46
|
+
}),
|
|
38
47
|
tap((data) => {
|
|
39
|
-
span.setAttribute('request.url', this.stringify(req.url));
|
|
40
|
-
span.setAttribute('request.body', this.stringify(req.body));
|
|
41
|
-
span.setAttribute('request.headers', this.stringify(req.headers));
|
|
42
|
-
span.setAttribute('request.method', this.stringify(req.method));
|
|
43
|
-
span.setAttribute('request.params', this.stringify(req.params));
|
|
44
|
-
span.setAttribute('request.query', this.stringify(req.query));
|
|
45
48
|
span.setAttribute('response.headers', this.stringify(res.headers));
|
|
46
49
|
span.setAttribute('response.statusCode', this.stringify(res.statusCode));
|
|
47
50
|
span.setAttribute('response.data', this.stringify(data));
|