@rsdk/core 5.0.1 → 5.0.2-next.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.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.0.2-next.1](https://github.com/R-Vision/rsdk/compare/v5.0.2-next.0...v5.0.2-next.1) (2024-07-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @rsdk/core
|
|
9
|
+
|
|
10
|
+
## [5.0.2-next.0](https://github.com/R-Vision/rsdk/compare/v5.0.1...v5.0.2-next.0) (2024-07-19)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @rsdk/core
|
|
13
|
+
|
|
6
14
|
## [5.0.1](https://github.com/R-Vision/rsdk/compare/v5.0.1-next.0...v5.0.1) (2024-07-19)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @rsdk/core
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processPromiseResult = exports.processObservableResult = exports.processSyncResult = exports.endWithError = exports.endWithResult = exports.toAttribute = exports.MAX_ATTRIBUTE_SIZE = void 0;
|
|
4
|
-
const api_1 = require("@opentelemetry/api");
|
|
5
4
|
const common_1 = require("@rsdk/common");
|
|
6
5
|
const rxjs_1 = require("rxjs");
|
|
6
|
+
// reference from import { SpanStatusCode } from '@opentelemetry/api';
|
|
7
|
+
// in order not to depend on the package @opentelemetry/api
|
|
8
|
+
var SpanStatusCode;
|
|
9
|
+
(function (SpanStatusCode) {
|
|
10
|
+
/**
|
|
11
|
+
* The default status.
|
|
12
|
+
*/
|
|
13
|
+
SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET";
|
|
14
|
+
/**
|
|
15
|
+
* The operation has been validated by an Application developer or
|
|
16
|
+
* Operator to have completed successfully.
|
|
17
|
+
*/
|
|
18
|
+
SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK";
|
|
19
|
+
/**
|
|
20
|
+
* The operation contains an error.
|
|
21
|
+
*/
|
|
22
|
+
SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR";
|
|
23
|
+
})(SpanStatusCode || (SpanStatusCode = {}));
|
|
7
24
|
/**
|
|
8
25
|
* Maximum span attribute size
|
|
9
26
|
*/
|
|
@@ -33,7 +50,7 @@ exports.toAttribute = toAttribute;
|
|
|
33
50
|
*/
|
|
34
51
|
const endWithResult = (span, data) => {
|
|
35
52
|
span.setAttribute('result', (0, exports.toAttribute)(data));
|
|
36
|
-
span.setStatus({ code:
|
|
53
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
37
54
|
span.end();
|
|
38
55
|
};
|
|
39
56
|
exports.endWithResult = endWithResult;
|
|
@@ -45,7 +62,7 @@ exports.endWithResult = endWithResult;
|
|
|
45
62
|
const endWithError = (span, error) => {
|
|
46
63
|
span.recordException(error);
|
|
47
64
|
span.setStatus({
|
|
48
|
-
code:
|
|
65
|
+
code: SpanStatusCode.ERROR,
|
|
49
66
|
message: error.message,
|
|
50
67
|
});
|
|
51
68
|
span.end();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opentelemetry.helpers.js","sourceRoot":"","sources":["../../../src/tracing/opentelemetry/opentelemetry.helpers.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"opentelemetry.helpers.js","sourceRoot":"","sources":["../../../src/tracing/opentelemetry/opentelemetry.helpers.ts"],"names":[],"mappings":";;;AACA,yCAAuE;AACvE,+BAA6E;AAE7E,sEAAsE;AACtE,2DAA2D;AAC3D,IAAK,cAcJ;AAdD,WAAK,cAAc;IACjB;;OAEG;IACH,qDAAS,CAAA;IACT;;;OAGG;IACH,+CAAM,CAAA;IACN;;OAEG;IAC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@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/core",
|
|
3
|
-
"version": "5.0.1",
|
|
3
|
+
"version": "5.0.2-next.1",
|
|
4
4
|
"description": "Nestjs based microservice chassis",
|
|
5
5
|
"license": "Apache License 2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"optional": true
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "bab144720f5c97ba1b0321223de3fee2cd546982"
|
|
45
45
|
}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import type { AttributeValue, Span } from '@opentelemetry/api';
|
|
2
|
-
import { SpanStatusCode } from '@opentelemetry/api';
|
|
3
2
|
import { isPrimitive, isRecord, normalizer, Size } from '@rsdk/common';
|
|
4
3
|
import { catchError, mergeMap, type Observable, of, throwError } from 'rxjs';
|
|
5
4
|
|
|
5
|
+
// reference from import { SpanStatusCode } from '@opentelemetry/api';
|
|
6
|
+
// in order not to depend on the package @opentelemetry/api
|
|
7
|
+
enum SpanStatusCode {
|
|
8
|
+
/**
|
|
9
|
+
* The default status.
|
|
10
|
+
*/
|
|
11
|
+
UNSET = 0,
|
|
12
|
+
/**
|
|
13
|
+
* The operation has been validated by an Application developer or
|
|
14
|
+
* Operator to have completed successfully.
|
|
15
|
+
*/
|
|
16
|
+
OK = 1,
|
|
17
|
+
/**
|
|
18
|
+
* The operation contains an error.
|
|
19
|
+
*/
|
|
20
|
+
ERROR = 2,
|
|
21
|
+
}
|
|
22
|
+
|
|
6
23
|
/**
|
|
7
24
|
* Maximum span attribute size
|
|
8
25
|
*/
|