@observyze/sdk 0.1.2 → 0.1.4
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 +175 -10
- package/dist/chunk-FQBYUOJB.mjs +316 -0
- package/dist/{chunk-YRMQCX2P.mjs → chunk-YSYKPKKX.mjs} +5 -20
- package/dist/index--b41_E-1.d.mts +440 -0
- package/dist/index--b41_E-1.d.ts +440 -0
- package/dist/{index-DEorAmFu.d.mts → index-Cr-FN-y5.d.mts} +89 -89
- package/dist/{index-DEorAmFu.d.ts → index-Cr-FN-y5.d.ts} +89 -89
- package/dist/index-D4UXMom5.d.mts +429 -0
- package/dist/index-D4UXMom5.d.ts +429 -0
- package/dist/index-IZdiaORv.d.mts +477 -0
- package/dist/index-IZdiaORv.d.ts +477 -0
- package/dist/index.d.mts +4 -37
- package/dist/index.d.ts +4 -37
- package/dist/index.js +665 -349
- package/dist/index.mjs +396 -70
- package/dist/opentelemetry/index.d.mts +2 -1
- package/dist/opentelemetry/index.d.ts +2 -1
- package/dist/opentelemetry/index.js +7 -4
- package/dist/opentelemetry/index.mjs +1 -1
- package/package.json +13 -6
- package/LICENSE +0 -21
|
@@ -24,6 +24,9 @@ __export(opentelemetry_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(opentelemetry_exports);
|
|
26
26
|
|
|
27
|
+
// src/types.ts
|
|
28
|
+
var import_types = require("@observyze/types");
|
|
29
|
+
|
|
27
30
|
// src/trace.ts
|
|
28
31
|
var import_crypto = require("crypto");
|
|
29
32
|
function generateId() {
|
|
@@ -127,7 +130,7 @@ var Trace = class {
|
|
|
127
130
|
organization_id: organizationId,
|
|
128
131
|
project_id: projectId,
|
|
129
132
|
name,
|
|
130
|
-
status:
|
|
133
|
+
status: import_types.TraceStatus.RUNNING,
|
|
131
134
|
start_time: new Date(this.startTime),
|
|
132
135
|
end_time: new Date(this.startTime),
|
|
133
136
|
// Will be updated on end()
|
|
@@ -195,7 +198,7 @@ var Trace = class {
|
|
|
195
198
|
/**
|
|
196
199
|
* End the trace with a final status
|
|
197
200
|
*/
|
|
198
|
-
end(status =
|
|
201
|
+
end(status = import_types.TraceStatus.SUCCESS) {
|
|
199
202
|
if (this.ended) {
|
|
200
203
|
return;
|
|
201
204
|
}
|
|
@@ -296,9 +299,9 @@ var ObservyzeSpanExporter = class {
|
|
|
296
299
|
const statusCode = status?.code;
|
|
297
300
|
if (statusCode === 2) {
|
|
298
301
|
oSpan.setError(new Error(status?.message || "OTel span error"));
|
|
299
|
-
trace.end(
|
|
302
|
+
trace.end(import_types.TraceStatus.ERROR);
|
|
300
303
|
} else {
|
|
301
|
-
trace.end(
|
|
304
|
+
trace.end(import_types.TraceStatus.SUCCESS);
|
|
302
305
|
}
|
|
303
306
|
}
|
|
304
307
|
resultCallback({ code: 0 });
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@observyze/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Node.js SDK for Observyze AI Observability Platform",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
5
8
|
"main": "./dist/index.js",
|
|
6
9
|
"types": "./dist/index.d.ts",
|
|
7
10
|
"exports": {
|
|
@@ -16,12 +19,11 @@
|
|
|
16
19
|
"import": "./dist/opentelemetry/index.mjs"
|
|
17
20
|
}
|
|
18
21
|
},
|
|
19
|
-
"files": [
|
|
20
|
-
"dist"
|
|
21
|
-
],
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsup src/index.ts src/opentelemetry/index.ts --format cjs,esm --dts",
|
|
24
24
|
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
25
|
+
"lint": "eslint src --ext .ts",
|
|
26
|
+
"test": "vitest",
|
|
25
27
|
"typecheck": "tsc --noEmit"
|
|
26
28
|
},
|
|
27
29
|
"keywords": [
|
|
@@ -34,15 +36,20 @@
|
|
|
34
36
|
],
|
|
35
37
|
"author": "Observyze",
|
|
36
38
|
"license": "MIT",
|
|
37
|
-
"dependencies": {
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@observyze/types": "*",
|
|
41
|
+
"debug": "4.4.3"
|
|
42
|
+
},
|
|
38
43
|
"optionalDependencies": {
|
|
39
44
|
"@opentelemetry/api": "^1.9.0",
|
|
40
45
|
"@opentelemetry/sdk-trace-base": "^1.30.0"
|
|
41
46
|
},
|
|
42
47
|
"devDependencies": {
|
|
48
|
+
"@types/debug": "4.1.13",
|
|
43
49
|
"@types/node": "^20.0.0",
|
|
44
50
|
"tsup": "^8.0.0",
|
|
45
|
-
"typescript": "^5.3.0"
|
|
51
|
+
"typescript": "^5.3.0",
|
|
52
|
+
"vitest": "^1.0.0"
|
|
46
53
|
},
|
|
47
54
|
"engines": {
|
|
48
55
|
"node": ">=20.0.0"
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Observyze
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|