@uploadista/observability 0.0.20 ā 0.1.0-beta.5
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/dist/index.cjs +1 -1
- package/dist/index.d.cts +51 -51
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +19 -19
- package/src/core/errors.ts +1 -1
- package/src/flow/layers.ts +1 -1
- package/src/test-observability.ts +4 -4
- package/src/upload/testing.ts +7 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadista/observability",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.1.0-beta.5",
|
|
5
5
|
"description": "Observability package for Uploadista",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Uploadista",
|
|
@@ -14,32 +14,32 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@effect/opentelemetry": "0.
|
|
17
|
+
"@effect/opentelemetry": "0.60.0",
|
|
18
18
|
"@opentelemetry/api": "1.9.0",
|
|
19
|
-
"@opentelemetry/api-logs": "0.
|
|
20
|
-
"@opentelemetry/exporter-metrics-otlp-http": "0.
|
|
21
|
-
"@opentelemetry/exporter-trace-otlp-http": "0.
|
|
22
|
-
"@opentelemetry/exporter-logs-otlp-http": "0.
|
|
23
|
-
"@opentelemetry/sdk-logs": "0.
|
|
24
|
-
"@opentelemetry/sdk-metrics": "2.
|
|
25
|
-
"@opentelemetry/sdk-trace-base": "2.
|
|
26
|
-
"@opentelemetry/sdk-trace-node": "2.
|
|
27
|
-
"@opentelemetry/sdk-trace-web": "2.
|
|
19
|
+
"@opentelemetry/api-logs": "0.210.0",
|
|
20
|
+
"@opentelemetry/exporter-metrics-otlp-http": "0.210.0",
|
|
21
|
+
"@opentelemetry/exporter-trace-otlp-http": "0.210.0",
|
|
22
|
+
"@opentelemetry/exporter-logs-otlp-http": "0.210.0",
|
|
23
|
+
"@opentelemetry/sdk-logs": "0.210.0",
|
|
24
|
+
"@opentelemetry/sdk-metrics": "2.4.0",
|
|
25
|
+
"@opentelemetry/sdk-trace-base": "2.4.0",
|
|
26
|
+
"@opentelemetry/sdk-trace-node": "2.4.0",
|
|
27
|
+
"@opentelemetry/sdk-trace-web": "2.4.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@effect/platform": "^0.93.8",
|
|
30
|
+
"@effect/platform": "^0.93.8 || ^0.94.0",
|
|
31
31
|
"@opentelemetry/semantic-conventions": "^1.33.0",
|
|
32
32
|
"effect": "^3.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@cloudflare/workers-types": "4.
|
|
35
|
+
"@cloudflare/workers-types": "4.20260115.0",
|
|
36
36
|
"@effect/vitest": "0.27.0",
|
|
37
|
-
"@types/node": "24.10.
|
|
38
|
-
"effect": "3.19.
|
|
39
|
-
"tsdown": "0.
|
|
37
|
+
"@types/node": "24.10.8",
|
|
38
|
+
"effect": "3.19.14",
|
|
39
|
+
"tsdown": "0.19.0",
|
|
40
40
|
"typescript": "5.9.3",
|
|
41
|
-
"vitest": "4.0.
|
|
42
|
-
"@uploadista/typescript-config": "0.0.
|
|
41
|
+
"vitest": "4.0.17",
|
|
42
|
+
"@uploadista/typescript-config": "0.1.0-beta.5"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsc --noEmit && tsdown",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"lint": "biome lint --write ./src",
|
|
48
48
|
"check": "biome check --write ./src",
|
|
49
49
|
"clean": "rimraf -rf dist && rimraf -rf .turbo && rimraf tsconfig.tsbuildinfo",
|
|
50
|
-
"test": "vitest",
|
|
50
|
+
"test": "vitest run",
|
|
51
51
|
"test:run": "vitest run",
|
|
52
52
|
"test:watch": "vitest watch"
|
|
53
53
|
}
|
package/src/core/errors.ts
CHANGED
|
@@ -102,7 +102,7 @@ export const classifyStorageError = (error: unknown): StorageErrorCategory => {
|
|
|
102
102
|
|
|
103
103
|
// Storage-specific error classifier factory
|
|
104
104
|
export const createStorageErrorClassifier = (
|
|
105
|
-
|
|
105
|
+
_storageType: string,
|
|
106
106
|
customErrorMapping?: (error: unknown) => StorageErrorCategory | null,
|
|
107
107
|
) => {
|
|
108
108
|
return (error: unknown): StorageErrorCategory => {
|
package/src/flow/layers.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
FlowObservability,
|
|
4
4
|
makeFlowObservabilityLayer,
|
|
5
5
|
} from "../core/layers.js";
|
|
6
|
-
import { createFlowMetrics
|
|
6
|
+
import { createFlowMetrics } from "./metrics.js";
|
|
7
7
|
|
|
8
8
|
// ============================================================================
|
|
9
9
|
// Flow Observability Layer Implementation
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* 5. Structured logging
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { Effect,
|
|
12
|
+
import { Effect, Metric } from "effect";
|
|
13
13
|
import {
|
|
14
14
|
classifyStorageError,
|
|
15
15
|
createStorageMetrics,
|
|
@@ -102,7 +102,7 @@ const simulateUpload = (fileSize: number, shouldFail: boolean) =>
|
|
|
102
102
|
// Test: Error Classification
|
|
103
103
|
// ============================================================================
|
|
104
104
|
|
|
105
|
-
const testErrorClassification = Effect.
|
|
105
|
+
const testErrorClassification = Effect.sync(() => {
|
|
106
106
|
console.log("\nš Testing Error Classification:");
|
|
107
107
|
|
|
108
108
|
const testErrors = [
|
|
@@ -134,7 +134,7 @@ const testErrorTracking = Effect.gen(function* () {
|
|
|
134
134
|
console.log("\nā ļø Testing Error Tracking:");
|
|
135
135
|
|
|
136
136
|
const error = new Error("ECONNRESET: Connection reset by peer");
|
|
137
|
-
(error as
|
|
137
|
+
(error as unknown as { code: string }).code = "ECONNRESET";
|
|
138
138
|
|
|
139
139
|
yield* trackStorageError(testStorageType, obs.metrics, "uploadPart", error, {
|
|
140
140
|
upload_id: "test-upload-456",
|
|
@@ -220,7 +220,7 @@ const runTests = Effect.gen(function* () {
|
|
|
220
220
|
yield* testErrorTracking;
|
|
221
221
|
yield* testMetricsSnapshot;
|
|
222
222
|
|
|
223
|
-
console.log(
|
|
223
|
+
console.log(`\n${"=".repeat(50)}`);
|
|
224
224
|
console.log("ā
All tests completed successfully!");
|
|
225
225
|
console.log("\nCore observability infrastructure is working correctly:");
|
|
226
226
|
console.log(" ā
Layer creation and composition");
|
package/src/upload/testing.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Layer } from "effect";
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
2
|
import { UploadObservability } from "../core/layers.js";
|
|
3
3
|
import { createUploadEngineMetrics } from "./metrics.js";
|
|
4
4
|
|
|
5
|
-
//
|
|
5
|
+
// ============================================================================
|
|
6
6
|
// Upload Observability Testing Utilities
|
|
7
7
|
// ============================================================================
|
|
8
8
|
|
|
@@ -14,11 +14,11 @@ export const UploadObservabilityTest = Layer.succeed(UploadObservability, {
|
|
|
14
14
|
serviceName: "uploadista-upload-server-test",
|
|
15
15
|
enabled: true,
|
|
16
16
|
metrics: {
|
|
17
|
-
uploadCreated:
|
|
18
|
-
uploadCompleted:
|
|
19
|
-
uploadFailed:
|
|
20
|
-
chunkUploaded:
|
|
21
|
-
}
|
|
17
|
+
uploadCreated: Effect.void,
|
|
18
|
+
uploadCompleted: Effect.void,
|
|
19
|
+
uploadFailed: Effect.void,
|
|
20
|
+
chunkUploaded: Effect.void,
|
|
21
|
+
},
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
/**
|