@uploadista/observability 0.0.12 → 0.0.13-beta.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/dist/index.cjs +1 -1
- package/dist/index.d.cts +233 -233
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +233 -233
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/flow/index.ts +7 -6
- package/src/flow/testing.ts +1 -1
- package/src/storage/index.ts +3 -2
- package/src/test-observability.ts +20 -17
- package/src/upload/index.ts +6 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Context, Effect, Layer, Metric, Option } from "effect";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as effect_MetricKeyType7 from "effect/MetricKeyType";
|
|
3
|
+
import * as effect_MetricState7 from "effect/MetricState";
|
|
4
4
|
import * as effect_Tracer0 from "effect/Tracer";
|
|
5
5
|
import * as _effect_opentelemetry_Resource0 from "@effect/opentelemetry/Resource";
|
|
6
|
-
import * as
|
|
6
|
+
import * as effect_Metric39 from "effect/Metric";
|
|
7
7
|
|
|
8
8
|
//#region src/core/metrics.d.ts
|
|
9
9
|
declare const createUploadMetrics: (storageType: string) => {
|
|
@@ -14,10 +14,10 @@ declare const createUploadMetrics: (storageType: string) => {
|
|
|
14
14
|
apiCallsTotal: Metric.Metric.Counter<number>;
|
|
15
15
|
};
|
|
16
16
|
declare const createUploadHistograms: (storageType: string) => {
|
|
17
|
-
uploadDurationHistogram: Metric.Metric<
|
|
18
|
-
partUploadDurationHistogram: Metric.Metric<
|
|
19
|
-
fileSizeHistogram: Metric.Metric<
|
|
20
|
-
partSizeHistogram: Metric.Metric<
|
|
17
|
+
uploadDurationHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
18
|
+
partUploadDurationHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
19
|
+
fileSizeHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
20
|
+
partSizeHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
21
21
|
};
|
|
22
22
|
declare const createUploadGauges: (storageType: string) => {
|
|
23
23
|
activeUploadsGauge: Metric.Metric.Gauge<number>;
|
|
@@ -30,10 +30,10 @@ declare const createStorageMetrics: (storageType: string) => {
|
|
|
30
30
|
uploadLatencySummary: Metric.Metric.Summary<number>;
|
|
31
31
|
activeUploadsGauge: Metric.Metric.Gauge<number>;
|
|
32
32
|
uploadThroughputGauge: Metric.Metric.Gauge<number>;
|
|
33
|
-
uploadDurationHistogram: Metric.Metric<
|
|
34
|
-
partUploadDurationHistogram: Metric.Metric<
|
|
35
|
-
fileSizeHistogram: Metric.Metric<
|
|
36
|
-
partSizeHistogram: Metric.Metric<
|
|
33
|
+
uploadDurationHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
34
|
+
partUploadDurationHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
35
|
+
fileSizeHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
36
|
+
partSizeHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
37
37
|
uploadRequestsTotal: Metric.Metric.Counter<number>;
|
|
38
38
|
uploadPartsTotal: Metric.Metric.Counter<number>;
|
|
39
39
|
uploadSuccessTotal: Metric.Metric.Counter<number>;
|
|
@@ -236,6 +236,56 @@ declare const withActiveUploadTracking: <A, E, R>(metrics: StorageMetrics, effec
|
|
|
236
236
|
declare const withThroughputTracking: <A, E, R>(metrics: StorageMetrics, bytes: number, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
237
237
|
declare const withStorageOperationMetrics: <A, E, R>(metrics: StorageMetrics, operation: string, uploadId: string, effect: Effect.Effect<A, E, R>, fileSize?: number) => Effect.Effect<A, E, R>;
|
|
238
238
|
//#endregion
|
|
239
|
+
//#region src/flow/errors.d.ts
|
|
240
|
+
type FlowErrorCategory = "flow_validation_error" | "node_execution_error" | "node_not_found_error" | "flow_timeout_error" | "flow_cancelled_error" | "unknown_flow_error";
|
|
241
|
+
/**
|
|
242
|
+
* Classify flow execution errors
|
|
243
|
+
*/
|
|
244
|
+
declare const classifyFlowError: (error: unknown) => FlowErrorCategory;
|
|
245
|
+
/**
|
|
246
|
+
* Track flow errors with classification
|
|
247
|
+
*/
|
|
248
|
+
declare const trackFlowError: <E>(error: E) => Effect.Effect<void, never, never>;
|
|
249
|
+
/**
|
|
250
|
+
* Track node errors with classification
|
|
251
|
+
*/
|
|
252
|
+
declare const trackNodeError: <E>(nodeId: string, nodeType: string, error: E) => Effect.Effect<void, never, never>;
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/flow/layers.d.ts
|
|
255
|
+
/**
|
|
256
|
+
* Create a live flow observability layer with full metrics
|
|
257
|
+
*/
|
|
258
|
+
declare const makeFlowObservabilityLive: (serviceName?: string) => Layer.Layer<FlowObservability>;
|
|
259
|
+
/**
|
|
260
|
+
* Default live flow observability layer
|
|
261
|
+
*/
|
|
262
|
+
declare const FlowObservabilityLive: Layer.Layer<FlowObservability, never, never>;
|
|
263
|
+
/**
|
|
264
|
+
* Helper to get flow metrics from context
|
|
265
|
+
*/
|
|
266
|
+
declare const getFlowMetrics: Effect.Effect<{
|
|
267
|
+
flowStarted: Effect.Effect<void>;
|
|
268
|
+
flowCompleted: Effect.Effect<void>;
|
|
269
|
+
flowFailed: Effect.Effect<void>;
|
|
270
|
+
nodeExecuted: Effect.Effect<void>;
|
|
271
|
+
}, never, FlowObservability>;
|
|
272
|
+
/**
|
|
273
|
+
* Helper to track flow duration
|
|
274
|
+
*/
|
|
275
|
+
declare const withFlowDuration: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
276
|
+
/**
|
|
277
|
+
* Helper to track node duration
|
|
278
|
+
*/
|
|
279
|
+
declare const withNodeDuration: <A, E, R>(nodeId: string, nodeType: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
280
|
+
/**
|
|
281
|
+
* Helper to track active flows
|
|
282
|
+
*/
|
|
283
|
+
declare const trackActiveFlow: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
284
|
+
/**
|
|
285
|
+
* Helper to track active nodes
|
|
286
|
+
*/
|
|
287
|
+
declare const trackActiveNode: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
288
|
+
//#endregion
|
|
239
289
|
//#region src/flow/metrics.d.ts
|
|
240
290
|
/**
|
|
241
291
|
* Flow engine metrics for tracking flow execution operations
|
|
@@ -250,10 +300,10 @@ declare const createFlowMetrics: () => {
|
|
|
250
300
|
nodeSuccessTotal: Metric.Metric.Counter<number>;
|
|
251
301
|
nodeFailedTotal: Metric.Metric.Counter<number>;
|
|
252
302
|
nodeSkippedTotal: Metric.Metric.Counter<number>;
|
|
253
|
-
flowDurationHistogram: Metric.Metric<
|
|
254
|
-
nodeDurationHistogram: Metric.Metric<
|
|
255
|
-
flowNodeCountHistogram: Metric.Metric<
|
|
256
|
-
parallelNodesHistogram: Metric.Metric<
|
|
303
|
+
flowDurationHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
304
|
+
nodeDurationHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
305
|
+
flowNodeCountHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
306
|
+
parallelNodesHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
257
307
|
activeFlowsGauge: Metric.Metric.Gauge<number>;
|
|
258
308
|
activeNodesGauge: Metric.Metric.Gauge<number>;
|
|
259
309
|
pausedFlowsGauge: Metric.Metric.Gauge<number>;
|
|
@@ -277,10 +327,10 @@ declare const flowMetrics: {
|
|
|
277
327
|
nodeSuccessTotal: Metric.Metric.Counter<number>;
|
|
278
328
|
nodeFailedTotal: Metric.Metric.Counter<number>;
|
|
279
329
|
nodeSkippedTotal: Metric.Metric.Counter<number>;
|
|
280
|
-
flowDurationHistogram: Metric.Metric<
|
|
281
|
-
nodeDurationHistogram: Metric.Metric<
|
|
282
|
-
flowNodeCountHistogram: Metric.Metric<
|
|
283
|
-
parallelNodesHistogram: Metric.Metric<
|
|
330
|
+
flowDurationHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
331
|
+
nodeDurationHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
332
|
+
flowNodeCountHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
333
|
+
parallelNodesHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
284
334
|
activeFlowsGauge: Metric.Metric.Gauge<number>;
|
|
285
335
|
activeNodesGauge: Metric.Metric.Gauge<number>;
|
|
286
336
|
pausedFlowsGauge: Metric.Metric.Gauge<number>;
|
|
@@ -288,6 +338,16 @@ declare const flowMetrics: {
|
|
|
288
338
|
nodeLatencySummary: Metric.Metric.Summary<number>;
|
|
289
339
|
};
|
|
290
340
|
//#endregion
|
|
341
|
+
//#region src/flow/testing.d.ts
|
|
342
|
+
/**
|
|
343
|
+
* Mock flow observability for testing
|
|
344
|
+
*/
|
|
345
|
+
declare const makeTestFlowObservability$1: () => Layer.Layer<FlowObservability>;
|
|
346
|
+
/**
|
|
347
|
+
* Run an effect with test flow observability
|
|
348
|
+
*/
|
|
349
|
+
declare const runWithTestFlowObservability: <A, E>(effect: Effect.Effect<A, E, FlowObservability>) => Effect.Effect<A, E>;
|
|
350
|
+
//#endregion
|
|
291
351
|
//#region src/flow/tracing.d.ts
|
|
292
352
|
/**
|
|
293
353
|
* Wrap an Effect with a flow operation span
|
|
@@ -323,66 +383,6 @@ declare const withExecutionContext: (context: {
|
|
|
323
383
|
parallelCount?: number;
|
|
324
384
|
}) => Effect.Effect<void, never, never>;
|
|
325
385
|
//#endregion
|
|
326
|
-
//#region src/flow/layers.d.ts
|
|
327
|
-
/**
|
|
328
|
-
* Create a live flow observability layer with full metrics
|
|
329
|
-
*/
|
|
330
|
-
declare const makeFlowObservabilityLive: (serviceName?: string) => Layer.Layer<FlowObservability>;
|
|
331
|
-
/**
|
|
332
|
-
* Default live flow observability layer
|
|
333
|
-
*/
|
|
334
|
-
declare const FlowObservabilityLive: Layer.Layer<FlowObservability, never, never>;
|
|
335
|
-
/**
|
|
336
|
-
* Helper to get flow metrics from context
|
|
337
|
-
*/
|
|
338
|
-
declare const getFlowMetrics: Effect.Effect<{
|
|
339
|
-
flowStarted: Effect.Effect<void>;
|
|
340
|
-
flowCompleted: Effect.Effect<void>;
|
|
341
|
-
flowFailed: Effect.Effect<void>;
|
|
342
|
-
nodeExecuted: Effect.Effect<void>;
|
|
343
|
-
}, never, FlowObservability>;
|
|
344
|
-
/**
|
|
345
|
-
* Helper to track flow duration
|
|
346
|
-
*/
|
|
347
|
-
declare const withFlowDuration: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
348
|
-
/**
|
|
349
|
-
* Helper to track node duration
|
|
350
|
-
*/
|
|
351
|
-
declare const withNodeDuration: <A, E, R>(nodeId: string, nodeType: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
352
|
-
/**
|
|
353
|
-
* Helper to track active flows
|
|
354
|
-
*/
|
|
355
|
-
declare const trackActiveFlow: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
356
|
-
/**
|
|
357
|
-
* Helper to track active nodes
|
|
358
|
-
*/
|
|
359
|
-
declare const trackActiveNode: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
360
|
-
//#endregion
|
|
361
|
-
//#region src/flow/errors.d.ts
|
|
362
|
-
type FlowErrorCategory = "flow_validation_error" | "node_execution_error" | "node_not_found_error" | "flow_timeout_error" | "flow_cancelled_error" | "unknown_flow_error";
|
|
363
|
-
/**
|
|
364
|
-
* Classify flow execution errors
|
|
365
|
-
*/
|
|
366
|
-
declare const classifyFlowError: (error: unknown) => FlowErrorCategory;
|
|
367
|
-
/**
|
|
368
|
-
* Track flow errors with classification
|
|
369
|
-
*/
|
|
370
|
-
declare const trackFlowError: <E>(error: E) => Effect.Effect<void, never, never>;
|
|
371
|
-
/**
|
|
372
|
-
* Track node errors with classification
|
|
373
|
-
*/
|
|
374
|
-
declare const trackNodeError: <E>(nodeId: string, nodeType: string, error: E) => Effect.Effect<void, never, never>;
|
|
375
|
-
//#endregion
|
|
376
|
-
//#region src/flow/testing.d.ts
|
|
377
|
-
/**
|
|
378
|
-
* Mock flow observability for testing
|
|
379
|
-
*/
|
|
380
|
-
declare const makeTestFlowObservability$1: () => Layer.Layer<FlowObservability>;
|
|
381
|
-
/**
|
|
382
|
-
* Run an effect with test flow observability
|
|
383
|
-
*/
|
|
384
|
-
declare const runWithTestFlowObservability: <A, E>(effect: Effect.Effect<A, E, FlowObservability>) => Effect.Effect<A, E>;
|
|
385
|
-
//#endregion
|
|
386
386
|
//#region src/service/metrics.d.ts
|
|
387
387
|
declare const MetricsService_base: Context.TagClass<MetricsService, "MetricsService", {
|
|
388
388
|
/**
|
|
@@ -404,41 +404,41 @@ declare class MetricsService extends MetricsService_base {}
|
|
|
404
404
|
*/
|
|
405
405
|
declare const NoOpMetricsServiceLive: Layer.Layer<MetricsService>;
|
|
406
406
|
//#endregion
|
|
407
|
-
//#region src/storage/
|
|
408
|
-
declare const
|
|
409
|
-
uploadLatencySummary:
|
|
410
|
-
activeUploadsGauge:
|
|
411
|
-
uploadThroughputGauge:
|
|
412
|
-
uploadDurationHistogram:
|
|
413
|
-
partUploadDurationHistogram:
|
|
414
|
-
fileSizeHistogram:
|
|
415
|
-
partSizeHistogram:
|
|
416
|
-
uploadRequestsTotal:
|
|
417
|
-
uploadPartsTotal:
|
|
418
|
-
uploadSuccessTotal:
|
|
419
|
-
uploadErrorsTotal:
|
|
420
|
-
apiCallsTotal:
|
|
407
|
+
//#region src/storage/azure.d.ts
|
|
408
|
+
declare const azureMetrics: {
|
|
409
|
+
uploadLatencySummary: effect_Metric39.Metric.Summary<number>;
|
|
410
|
+
activeUploadsGauge: effect_Metric39.Metric.Gauge<number>;
|
|
411
|
+
uploadThroughputGauge: effect_Metric39.Metric.Gauge<number>;
|
|
412
|
+
uploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
413
|
+
partUploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
414
|
+
fileSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
415
|
+
partSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
416
|
+
uploadRequestsTotal: effect_Metric39.Metric.Counter<number>;
|
|
417
|
+
uploadPartsTotal: effect_Metric39.Metric.Counter<number>;
|
|
418
|
+
uploadSuccessTotal: effect_Metric39.Metric.Counter<number>;
|
|
419
|
+
uploadErrorsTotal: effect_Metric39.Metric.Counter<number>;
|
|
420
|
+
apiCallsTotal: effect_Metric39.Metric.Counter<number>;
|
|
421
421
|
};
|
|
422
|
-
declare const
|
|
422
|
+
declare const AzureTracingLayer: Layer.Layer<{
|
|
423
423
|
serviceName: string;
|
|
424
424
|
}, never, never>;
|
|
425
|
-
declare const
|
|
426
|
-
declare const
|
|
425
|
+
declare const trackAzureError: (operation: string, error: unknown, context?: Record<string, unknown>) => Effect.Effect<void, never, never>;
|
|
426
|
+
declare const AzureObservabilityLayer: Layer.Layer<{
|
|
427
427
|
serviceName: string;
|
|
428
428
|
}, never, never>;
|
|
429
|
-
declare const
|
|
430
|
-
declare const
|
|
431
|
-
declare const
|
|
432
|
-
declare const
|
|
433
|
-
declare const
|
|
434
|
-
declare const
|
|
435
|
-
declare const
|
|
429
|
+
declare const withAzureUploadMetrics: <A, E, R>(uploadId: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
430
|
+
declare const withAzureApiMetrics: <A, E, R>(operation: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
431
|
+
declare const withAzureTimingMetrics: <A, E, R>(metric: effect_Metric39.Metric.Histogram<number>, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
432
|
+
declare const withAzureOperationMetrics: <A, E, R>(operation: string, uploadId: string, effect: Effect.Effect<A, E, R>, fileSize?: number) => Effect.Effect<A, E, R>;
|
|
433
|
+
declare const withAzureSpan: <A, E, R>(operation: string, attributes?: Record<string, unknown>) => (effect: Effect.Effect<A, E, R>) => Effect.Effect<unknown, unknown, unknown>;
|
|
434
|
+
declare const logAzureOperation: (operation: string, uploadId: string, metadata?: Record<string, unknown> | undefined) => Effect.Effect<void, never, never>;
|
|
435
|
+
declare const logAzureUploadProgress: (uploadId: string, progress: {
|
|
436
436
|
uploadedBytes: number;
|
|
437
437
|
totalBytes: number;
|
|
438
438
|
partNumber?: number;
|
|
439
439
|
speed?: number;
|
|
440
440
|
}) => Effect.Effect<void, never, never>;
|
|
441
|
-
declare const
|
|
441
|
+
declare const logAzureUploadCompletion: (uploadId: string, metrics: {
|
|
442
442
|
fileSize: number;
|
|
443
443
|
totalDurationMs: number;
|
|
444
444
|
partsCount?: number;
|
|
@@ -446,45 +446,45 @@ declare const logS3UploadCompletion: (uploadId: string, metrics: {
|
|
|
446
446
|
throughputBps?: number;
|
|
447
447
|
retryCount?: number;
|
|
448
448
|
}) => Effect.Effect<void, never, never>;
|
|
449
|
-
declare const
|
|
450
|
-
declare const
|
|
451
|
-
type
|
|
449
|
+
declare const logAzureContext: (message: string, context: Record<string, unknown>) => Effect.Effect<void, never, never>;
|
|
450
|
+
declare const azureUploadRequestsTotal: effect_Metric39.Metric.Counter<number>, azureUploadPartsTotal: effect_Metric39.Metric.Counter<number>, azureUploadSuccessTotal: effect_Metric39.Metric.Counter<number>, azureUploadErrorsTotal: effect_Metric39.Metric.Counter<number>, azureApiCallsTotal: effect_Metric39.Metric.Counter<number>, azureUploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, azurePartUploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, azureFileSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, azurePartSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, azureActiveUploadsGauge: effect_Metric39.Metric.Gauge<number>, azureUploadThroughputGauge: effect_Metric39.Metric.Gauge<number>, azureUploadLatencySummary: effect_Metric39.Metric.Summary<number>;
|
|
451
|
+
type AzureMetrics = StorageMetrics;
|
|
452
452
|
//#endregion
|
|
453
|
-
//#region src/storage/
|
|
454
|
-
declare const
|
|
455
|
-
uploadLatencySummary:
|
|
456
|
-
activeUploadsGauge:
|
|
457
|
-
uploadThroughputGauge:
|
|
458
|
-
uploadDurationHistogram:
|
|
459
|
-
partUploadDurationHistogram:
|
|
460
|
-
fileSizeHistogram:
|
|
461
|
-
partSizeHistogram:
|
|
462
|
-
uploadRequestsTotal:
|
|
463
|
-
uploadPartsTotal:
|
|
464
|
-
uploadSuccessTotal:
|
|
465
|
-
uploadErrorsTotal:
|
|
466
|
-
apiCallsTotal:
|
|
453
|
+
//#region src/storage/filesystem.d.ts
|
|
454
|
+
declare const filesystemMetrics: {
|
|
455
|
+
uploadLatencySummary: effect_Metric39.Metric.Summary<number>;
|
|
456
|
+
activeUploadsGauge: effect_Metric39.Metric.Gauge<number>;
|
|
457
|
+
uploadThroughputGauge: effect_Metric39.Metric.Gauge<number>;
|
|
458
|
+
uploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
459
|
+
partUploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
460
|
+
fileSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
461
|
+
partSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
462
|
+
uploadRequestsTotal: effect_Metric39.Metric.Counter<number>;
|
|
463
|
+
uploadPartsTotal: effect_Metric39.Metric.Counter<number>;
|
|
464
|
+
uploadSuccessTotal: effect_Metric39.Metric.Counter<number>;
|
|
465
|
+
uploadErrorsTotal: effect_Metric39.Metric.Counter<number>;
|
|
466
|
+
apiCallsTotal: effect_Metric39.Metric.Counter<number>;
|
|
467
467
|
};
|
|
468
|
-
declare const
|
|
468
|
+
declare const FilesystemTracingLayer: Layer.Layer<{
|
|
469
469
|
serviceName: string;
|
|
470
470
|
}, never, never>;
|
|
471
|
-
declare const
|
|
472
|
-
declare const
|
|
471
|
+
declare const trackFilesystemError: (operation: string, error: unknown, context?: Record<string, unknown>) => Effect.Effect<void, never, never>;
|
|
472
|
+
declare const FilesystemObservabilityLayer: Layer.Layer<{
|
|
473
473
|
serviceName: string;
|
|
474
474
|
}, never, never>;
|
|
475
|
-
declare const
|
|
476
|
-
declare const
|
|
477
|
-
declare const
|
|
478
|
-
declare const
|
|
479
|
-
declare const
|
|
480
|
-
declare const
|
|
481
|
-
declare const
|
|
475
|
+
declare const withFilesystemUploadMetrics: <A, E, R>(uploadId: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
476
|
+
declare const withFilesystemApiMetrics: <A, E, R>(operation: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
477
|
+
declare const withFilesystemTimingMetrics: <A, E, R>(metric: effect_Metric39.Metric.Histogram<number>, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
478
|
+
declare const withFilesystemOperationMetrics: <A, E, R>(operation: string, uploadId: string, effect: Effect.Effect<A, E, R>, fileSize?: number) => Effect.Effect<A, E, R>;
|
|
479
|
+
declare const withFilesystemSpan: <A, E, R>(operation: string, attributes?: Record<string, unknown>) => (effect: Effect.Effect<A, E, R>) => Effect.Effect<unknown, unknown, unknown>;
|
|
480
|
+
declare const logFilesystemOperation: (operation: string, uploadId: string, metadata?: Record<string, unknown> | undefined) => Effect.Effect<void, never, never>;
|
|
481
|
+
declare const logFilesystemUploadProgress: (uploadId: string, progress: {
|
|
482
482
|
uploadedBytes: number;
|
|
483
483
|
totalBytes: number;
|
|
484
484
|
partNumber?: number;
|
|
485
485
|
speed?: number;
|
|
486
486
|
}) => Effect.Effect<void, never, never>;
|
|
487
|
-
declare const
|
|
487
|
+
declare const logFilesystemUploadCompletion: (uploadId: string, metrics: {
|
|
488
488
|
fileSize: number;
|
|
489
489
|
totalDurationMs: number;
|
|
490
490
|
partsCount?: number;
|
|
@@ -492,24 +492,24 @@ declare const logAzureUploadCompletion: (uploadId: string, metrics: {
|
|
|
492
492
|
throughputBps?: number;
|
|
493
493
|
retryCount?: number;
|
|
494
494
|
}) => Effect.Effect<void, never, never>;
|
|
495
|
-
declare const
|
|
496
|
-
declare const
|
|
497
|
-
type
|
|
495
|
+
declare const logFilesystemContext: (message: string, context: Record<string, unknown>) => Effect.Effect<void, never, never>;
|
|
496
|
+
declare const filesystemUploadRequestsTotal: effect_Metric39.Metric.Counter<number>, filesystemUploadPartsTotal: effect_Metric39.Metric.Counter<number>, filesystemUploadSuccessTotal: effect_Metric39.Metric.Counter<number>, filesystemUploadErrorsTotal: effect_Metric39.Metric.Counter<number>, filesystemApiCallsTotal: effect_Metric39.Metric.Counter<number>, filesystemUploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, filesystemPartUploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, filesystemFileSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, filesystemPartSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, filesystemActiveUploadsGauge: effect_Metric39.Metric.Gauge<number>, filesystemUploadThroughputGauge: effect_Metric39.Metric.Gauge<number>, filesystemUploadLatencySummary: effect_Metric39.Metric.Summary<number>;
|
|
497
|
+
type FilesystemMetrics = StorageMetrics;
|
|
498
498
|
//#endregion
|
|
499
499
|
//#region src/storage/gcs.d.ts
|
|
500
500
|
declare const gcsMetrics: {
|
|
501
|
-
uploadLatencySummary:
|
|
502
|
-
activeUploadsGauge:
|
|
503
|
-
uploadThroughputGauge:
|
|
504
|
-
uploadDurationHistogram:
|
|
505
|
-
partUploadDurationHistogram:
|
|
506
|
-
fileSizeHistogram:
|
|
507
|
-
partSizeHistogram:
|
|
508
|
-
uploadRequestsTotal:
|
|
509
|
-
uploadPartsTotal:
|
|
510
|
-
uploadSuccessTotal:
|
|
511
|
-
uploadErrorsTotal:
|
|
512
|
-
apiCallsTotal:
|
|
501
|
+
uploadLatencySummary: effect_Metric39.Metric.Summary<number>;
|
|
502
|
+
activeUploadsGauge: effect_Metric39.Metric.Gauge<number>;
|
|
503
|
+
uploadThroughputGauge: effect_Metric39.Metric.Gauge<number>;
|
|
504
|
+
uploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
505
|
+
partUploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
506
|
+
fileSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
507
|
+
partSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
508
|
+
uploadRequestsTotal: effect_Metric39.Metric.Counter<number>;
|
|
509
|
+
uploadPartsTotal: effect_Metric39.Metric.Counter<number>;
|
|
510
|
+
uploadSuccessTotal: effect_Metric39.Metric.Counter<number>;
|
|
511
|
+
uploadErrorsTotal: effect_Metric39.Metric.Counter<number>;
|
|
512
|
+
apiCallsTotal: effect_Metric39.Metric.Counter<number>;
|
|
513
513
|
};
|
|
514
514
|
declare const GCSTracingLayer: Layer.Layer<{
|
|
515
515
|
serviceName: string;
|
|
@@ -520,7 +520,7 @@ declare const GCSObservabilityLayer: Layer.Layer<{
|
|
|
520
520
|
}, never, never>;
|
|
521
521
|
declare const withGCSUploadMetrics: <A, E, R>(uploadId: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
522
522
|
declare const withGCSApiMetrics: <A, E, R>(operation: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
523
|
-
declare const withGCSTimingMetrics: <A, E, R>(metric:
|
|
523
|
+
declare const withGCSTimingMetrics: <A, E, R>(metric: effect_Metric39.Metric.Histogram<number>, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
524
524
|
declare const withGCSOperationMetrics: <A, E, R>(operation: string, uploadId: string, effect: Effect.Effect<A, E, R>, fileSize?: number) => Effect.Effect<A, E, R>;
|
|
525
525
|
declare const withGCSSpan: <A, E, R>(operation: string, attributes?: Record<string, unknown>) => (effect: Effect.Effect<A, E, R>) => Effect.Effect<unknown, unknown, unknown>;
|
|
526
526
|
declare const logGCSOperation: (operation: string, uploadId: string, metadata?: Record<string, unknown> | undefined) => Effect.Effect<void, never, never>;
|
|
@@ -539,44 +539,44 @@ declare const logGCSUploadCompletion: (uploadId: string, metrics: {
|
|
|
539
539
|
retryCount?: number;
|
|
540
540
|
}) => Effect.Effect<void, never, never>;
|
|
541
541
|
declare const logGCSContext: (message: string, context: Record<string, unknown>) => Effect.Effect<void, never, never>;
|
|
542
|
-
declare const gcsUploadRequestsTotal:
|
|
542
|
+
declare const gcsUploadRequestsTotal: effect_Metric39.Metric.Counter<number>, gcsUploadPartsTotal: effect_Metric39.Metric.Counter<number>, gcsUploadSuccessTotal: effect_Metric39.Metric.Counter<number>, gcsUploadErrorsTotal: effect_Metric39.Metric.Counter<number>, gcsApiCallsTotal: effect_Metric39.Metric.Counter<number>, gcsUploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, gcsPartUploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, gcsFileSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, gcsPartSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, gcsActiveUploadsGauge: effect_Metric39.Metric.Gauge<number>, gcsUploadThroughputGauge: effect_Metric39.Metric.Gauge<number>, gcsUploadLatencySummary: effect_Metric39.Metric.Summary<number>;
|
|
543
543
|
type GCSMetrics = StorageMetrics;
|
|
544
544
|
//#endregion
|
|
545
|
-
//#region src/storage/
|
|
546
|
-
declare const
|
|
547
|
-
uploadLatencySummary:
|
|
548
|
-
activeUploadsGauge:
|
|
549
|
-
uploadThroughputGauge:
|
|
550
|
-
uploadDurationHistogram:
|
|
551
|
-
partUploadDurationHistogram:
|
|
552
|
-
fileSizeHistogram:
|
|
553
|
-
partSizeHistogram:
|
|
554
|
-
uploadRequestsTotal:
|
|
555
|
-
uploadPartsTotal:
|
|
556
|
-
uploadSuccessTotal:
|
|
557
|
-
uploadErrorsTotal:
|
|
558
|
-
apiCallsTotal:
|
|
545
|
+
//#region src/storage/s3.d.ts
|
|
546
|
+
declare const s3Metrics: {
|
|
547
|
+
uploadLatencySummary: effect_Metric39.Metric.Summary<number>;
|
|
548
|
+
activeUploadsGauge: effect_Metric39.Metric.Gauge<number>;
|
|
549
|
+
uploadThroughputGauge: effect_Metric39.Metric.Gauge<number>;
|
|
550
|
+
uploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
551
|
+
partUploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
552
|
+
fileSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
553
|
+
partSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
554
|
+
uploadRequestsTotal: effect_Metric39.Metric.Counter<number>;
|
|
555
|
+
uploadPartsTotal: effect_Metric39.Metric.Counter<number>;
|
|
556
|
+
uploadSuccessTotal: effect_Metric39.Metric.Counter<number>;
|
|
557
|
+
uploadErrorsTotal: effect_Metric39.Metric.Counter<number>;
|
|
558
|
+
apiCallsTotal: effect_Metric39.Metric.Counter<number>;
|
|
559
559
|
};
|
|
560
|
-
declare const
|
|
560
|
+
declare const S3TracingLayer: Layer.Layer<{
|
|
561
561
|
serviceName: string;
|
|
562
562
|
}, never, never>;
|
|
563
|
-
declare const
|
|
564
|
-
declare const
|
|
563
|
+
declare const trackS3Error: (operation: string, error: unknown, context?: Record<string, unknown>) => Effect.Effect<void, never, never>;
|
|
564
|
+
declare const S3ObservabilityLayer: Layer.Layer<{
|
|
565
565
|
serviceName: string;
|
|
566
566
|
}, never, never>;
|
|
567
|
-
declare const
|
|
568
|
-
declare const
|
|
569
|
-
declare const
|
|
570
|
-
declare const
|
|
571
|
-
declare const
|
|
572
|
-
declare const
|
|
573
|
-
declare const
|
|
567
|
+
declare const withS3UploadMetrics: <A, E, R>(uploadId: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
568
|
+
declare const withS3ApiMetrics: <A, E, R>(operation: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
569
|
+
declare const withS3TimingMetrics: <A, E, R>(metric: effect_Metric39.Metric.Histogram<number>, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
570
|
+
declare const withS3OperationMetrics: <A, E, R>(operation: string, uploadId: string, effect: Effect.Effect<A, E, R>, fileSize?: number) => Effect.Effect<A, E, R>;
|
|
571
|
+
declare const withS3Span: <A, E, R>(operation: string, attributes?: Record<string, unknown>) => (effect: Effect.Effect<A, E, R>) => Effect.Effect<unknown, unknown, unknown>;
|
|
572
|
+
declare const logS3Operation: (operation: string, uploadId: string, metadata?: Record<string, unknown> | undefined) => Effect.Effect<void, never, never>;
|
|
573
|
+
declare const logS3UploadProgress: (uploadId: string, progress: {
|
|
574
574
|
uploadedBytes: number;
|
|
575
575
|
totalBytes: number;
|
|
576
576
|
partNumber?: number;
|
|
577
577
|
speed?: number;
|
|
578
578
|
}) => Effect.Effect<void, never, never>;
|
|
579
|
-
declare const
|
|
579
|
+
declare const logS3UploadCompletion: (uploadId: string, metrics: {
|
|
580
580
|
fileSize: number;
|
|
581
581
|
totalDurationMs: number;
|
|
582
582
|
partsCount?: number;
|
|
@@ -584,9 +584,9 @@ declare const logFilesystemUploadCompletion: (uploadId: string, metrics: {
|
|
|
584
584
|
throughputBps?: number;
|
|
585
585
|
retryCount?: number;
|
|
586
586
|
}) => Effect.Effect<void, never, never>;
|
|
587
|
-
declare const
|
|
588
|
-
declare const
|
|
589
|
-
type
|
|
587
|
+
declare const logS3Context: (message: string, context: Record<string, unknown>) => Effect.Effect<void, never, never>;
|
|
588
|
+
declare const s3UploadRequestsTotal: effect_Metric39.Metric.Counter<number>, s3UploadPartsTotal: effect_Metric39.Metric.Counter<number>, s3UploadSuccessTotal: effect_Metric39.Metric.Counter<number>, s3UploadErrorsTotal: effect_Metric39.Metric.Counter<number>, s3ApiCallsTotal: effect_Metric39.Metric.Counter<number>, s3UploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, s3PartUploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, s3FileSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, s3PartSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, s3ActiveUploadsGauge: effect_Metric39.Metric.Gauge<number>, s3UploadThroughputGauge: effect_Metric39.Metric.Gauge<number>, s3UploadLatencySummary: effect_Metric39.Metric.Summary<number>;
|
|
589
|
+
type S3Metrics = StorageMetrics;
|
|
590
590
|
//#endregion
|
|
591
591
|
//#region src/upload/metrics.d.ts
|
|
592
592
|
/**
|
|
@@ -600,10 +600,10 @@ declare const createUploadServerMetrics: () => {
|
|
|
600
600
|
uploadFromUrlTotal: Metric.Metric.Counter<number>;
|
|
601
601
|
uploadFromUrlSuccessTotal: Metric.Metric.Counter<number>;
|
|
602
602
|
uploadFromUrlFailedTotal: Metric.Metric.Counter<number>;
|
|
603
|
-
uploadDurationHistogram: Metric.Metric<
|
|
604
|
-
chunkUploadDurationHistogram: Metric.Metric<
|
|
605
|
-
uploadFileSizeHistogram: Metric.Metric<
|
|
606
|
-
chunkSizeHistogram: Metric.Metric<
|
|
603
|
+
uploadDurationHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
604
|
+
chunkUploadDurationHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
605
|
+
uploadFileSizeHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
606
|
+
chunkSizeHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
607
607
|
activeUploadsGauge: Metric.Metric.Gauge<number>;
|
|
608
608
|
uploadThroughputGauge: Metric.Metric.Gauge<number>;
|
|
609
609
|
uploadLatencySummary: Metric.Metric.Summary<number>;
|
|
@@ -624,40 +624,30 @@ declare const uploadServerMetrics: {
|
|
|
624
624
|
uploadFromUrlTotal: Metric.Metric.Counter<number>;
|
|
625
625
|
uploadFromUrlSuccessTotal: Metric.Metric.Counter<number>;
|
|
626
626
|
uploadFromUrlFailedTotal: Metric.Metric.Counter<number>;
|
|
627
|
-
uploadDurationHistogram: Metric.Metric<
|
|
628
|
-
chunkUploadDurationHistogram: Metric.Metric<
|
|
629
|
-
uploadFileSizeHistogram: Metric.Metric<
|
|
630
|
-
chunkSizeHistogram: Metric.Metric<
|
|
627
|
+
uploadDurationHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
628
|
+
chunkUploadDurationHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
629
|
+
uploadFileSizeHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
630
|
+
chunkSizeHistogram: Metric.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
631
631
|
activeUploadsGauge: Metric.Metric.Gauge<number>;
|
|
632
632
|
uploadThroughputGauge: Metric.Metric.Gauge<number>;
|
|
633
633
|
uploadLatencySummary: Metric.Metric.Summary<number>;
|
|
634
634
|
chunkLatencySummary: Metric.Metric.Summary<number>;
|
|
635
635
|
};
|
|
636
636
|
//#endregion
|
|
637
|
-
//#region src/upload/
|
|
637
|
+
//#region src/upload/errors.d.ts
|
|
638
|
+
type UploadErrorCategory = "network_error" | "authentication_error" | "authorization_error" | "validation_error" | "size_limit_error" | "storage_error" | "abort_error" | "unknown_error";
|
|
638
639
|
/**
|
|
639
|
-
*
|
|
640
|
+
* Classify upload errors into standard categories
|
|
640
641
|
*/
|
|
641
|
-
declare const
|
|
642
|
+
declare const classifyUploadError: (error: unknown) => UploadErrorCategory;
|
|
642
643
|
/**
|
|
643
|
-
*
|
|
644
|
+
* Track upload errors with metrics and structured logging
|
|
644
645
|
*/
|
|
645
|
-
declare const
|
|
646
|
-
uploadId?: string;
|
|
647
|
-
fileName?: string;
|
|
648
|
-
fileSize?: number;
|
|
649
|
-
storageId?: string;
|
|
650
|
-
mimeType?: string;
|
|
651
|
-
}) => Effect.Effect<void, never, never>;
|
|
646
|
+
declare const trackUploadError: (metrics: UploadServerMetrics, operation: string, error: unknown, context?: Record<string, unknown>) => Effect.Effect<void, never, never>;
|
|
652
647
|
/**
|
|
653
|
-
*
|
|
648
|
+
* Create a custom error classifier for upload operations
|
|
654
649
|
*/
|
|
655
|
-
declare const
|
|
656
|
-
uploadId: string;
|
|
657
|
-
chunkSize: number;
|
|
658
|
-
offset: number;
|
|
659
|
-
totalSize?: number;
|
|
660
|
-
}) => Effect.Effect<void, never, never>;
|
|
650
|
+
declare const createUploadErrorClassifier: (customErrorMapping?: (error: unknown) => UploadErrorCategory | null) => (error: unknown) => UploadErrorCategory;
|
|
661
651
|
//#endregion
|
|
662
652
|
//#region src/upload/layers.d.ts
|
|
663
653
|
/**
|
|
@@ -686,21 +676,6 @@ declare const withUploadDuration: <A, E, R>(effect: Effect.Effect<A, E, R>) => E
|
|
|
686
676
|
*/
|
|
687
677
|
declare const withChunkDuration: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
688
678
|
//#endregion
|
|
689
|
-
//#region src/upload/errors.d.ts
|
|
690
|
-
type UploadErrorCategory = "network_error" | "authentication_error" | "authorization_error" | "validation_error" | "size_limit_error" | "storage_error" | "abort_error" | "unknown_error";
|
|
691
|
-
/**
|
|
692
|
-
* Classify upload errors into standard categories
|
|
693
|
-
*/
|
|
694
|
-
declare const classifyUploadError: (error: unknown) => UploadErrorCategory;
|
|
695
|
-
/**
|
|
696
|
-
* Track upload errors with metrics and structured logging
|
|
697
|
-
*/
|
|
698
|
-
declare const trackUploadError: (metrics: UploadServerMetrics, operation: string, error: unknown, context?: Record<string, unknown>) => Effect.Effect<void, never, never>;
|
|
699
|
-
/**
|
|
700
|
-
* Create a custom error classifier for upload operations
|
|
701
|
-
*/
|
|
702
|
-
declare const createUploadErrorClassifier: (customErrorMapping?: (error: unknown) => UploadErrorCategory | null) => (error: unknown) => UploadErrorCategory;
|
|
703
|
-
//#endregion
|
|
704
679
|
//#region src/upload/testing.d.ts
|
|
705
680
|
/**
|
|
706
681
|
* Create a test upload observability layer that doesn't actually emit metrics
|
|
@@ -711,26 +686,51 @@ declare const UploadObservabilityTest: Layer.Layer<UploadObservability, never, n
|
|
|
711
686
|
* Get metrics for validation (useful for testing metric definitions)
|
|
712
687
|
*/
|
|
713
688
|
declare const getTestMetrics: () => {
|
|
714
|
-
uploadCreatedTotal:
|
|
715
|
-
uploadCompletedTotal:
|
|
716
|
-
uploadFailedTotal:
|
|
717
|
-
chunkUploadedTotal:
|
|
718
|
-
uploadFromUrlTotal:
|
|
719
|
-
uploadFromUrlSuccessTotal:
|
|
720
|
-
uploadFromUrlFailedTotal:
|
|
721
|
-
uploadDurationHistogram:
|
|
722
|
-
chunkUploadDurationHistogram:
|
|
723
|
-
uploadFileSizeHistogram:
|
|
724
|
-
chunkSizeHistogram:
|
|
725
|
-
activeUploadsGauge:
|
|
726
|
-
uploadThroughputGauge:
|
|
727
|
-
uploadLatencySummary:
|
|
728
|
-
chunkLatencySummary:
|
|
689
|
+
uploadCreatedTotal: effect_Metric39.Metric.Counter<number>;
|
|
690
|
+
uploadCompletedTotal: effect_Metric39.Metric.Counter<number>;
|
|
691
|
+
uploadFailedTotal: effect_Metric39.Metric.Counter<number>;
|
|
692
|
+
chunkUploadedTotal: effect_Metric39.Metric.Counter<number>;
|
|
693
|
+
uploadFromUrlTotal: effect_Metric39.Metric.Counter<number>;
|
|
694
|
+
uploadFromUrlSuccessTotal: effect_Metric39.Metric.Counter<number>;
|
|
695
|
+
uploadFromUrlFailedTotal: effect_Metric39.Metric.Counter<number>;
|
|
696
|
+
uploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
697
|
+
chunkUploadDurationHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
698
|
+
uploadFileSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
699
|
+
chunkSizeHistogram: effect_Metric39.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
|
|
700
|
+
activeUploadsGauge: effect_Metric39.Metric.Gauge<number>;
|
|
701
|
+
uploadThroughputGauge: effect_Metric39.Metric.Gauge<number>;
|
|
702
|
+
uploadLatencySummary: effect_Metric39.Metric.Summary<number>;
|
|
703
|
+
chunkLatencySummary: effect_Metric39.Metric.Summary<number>;
|
|
729
704
|
};
|
|
730
705
|
/**
|
|
731
706
|
* Validate that all required metrics exist
|
|
732
707
|
*/
|
|
733
708
|
declare const validateMetricsExist: () => boolean;
|
|
734
709
|
//#endregion
|
|
710
|
+
//#region src/upload/tracing.d.ts
|
|
711
|
+
/**
|
|
712
|
+
* Wrap an Effect with an upload operation span
|
|
713
|
+
*/
|
|
714
|
+
declare const withUploadSpan: <A, E, R>(operation: string, attributes?: Record<string, unknown>) => (effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
715
|
+
/**
|
|
716
|
+
* Add upload context to the current span
|
|
717
|
+
*/
|
|
718
|
+
declare const withUploadContext: (context: {
|
|
719
|
+
uploadId?: string;
|
|
720
|
+
fileName?: string;
|
|
721
|
+
fileSize?: number;
|
|
722
|
+
storageId?: string;
|
|
723
|
+
mimeType?: string;
|
|
724
|
+
}) => Effect.Effect<void, never, never>;
|
|
725
|
+
/**
|
|
726
|
+
* Add chunk context to the current span
|
|
727
|
+
*/
|
|
728
|
+
declare const withChunkContext: (context: {
|
|
729
|
+
uploadId: string;
|
|
730
|
+
chunkSize: number;
|
|
731
|
+
offset: number;
|
|
732
|
+
totalSize?: number;
|
|
733
|
+
}) => Effect.Effect<void, never, never>;
|
|
734
|
+
//#endregion
|
|
735
735
|
export { AzureMetrics, AzureObservabilityLayer, AzureTracingLayer, FilesystemMetrics, FilesystemObservabilityLayer, FilesystemTracingLayer, FlowErrorCategory, FlowMetrics, FlowObservability, FlowObservabilityDisabled, FlowObservabilityLive, FlowObservabilityService, GCSMetrics, GCSObservabilityLayer, GCSTracingLayer, MetricsService, NoOpMetricsServiceLive, NodeSdkLive, Observability, ObservabilityDisabled, ObservabilityService, ObservabilityTestFixture, S3Metrics, S3ObservabilityLayer, S3TracingLayer, StorageErrorCategory, StorageMetrics, StorageObservability, StorageObservabilityDisabled, StorageObservabilityService, TracingService, UploadErrorCategory, UploadObservability, UploadObservabilityDisabled, UploadObservabilityLive, UploadObservabilityService, UploadObservabilityTest, UploadServerMetrics, WebSdkLive, WorkersSdkLive, azureActiveUploadsGauge, azureApiCallsTotal, azureFileSizeHistogram, azureMetrics, azurePartSizeHistogram, azurePartUploadDurationHistogram, azureUploadDurationHistogram, azureUploadErrorsTotal, azureUploadLatencySummary, azureUploadPartsTotal, azureUploadRequestsTotal, azureUploadSuccessTotal, azureUploadThroughputGauge, captureMetrics, classifyFlowError, classifyStorageError, classifyUploadError, createFlowMetrics, createStorageErrorClassifier, createStorageErrorTracker, createStorageMetrics, createStorageTracingLayer, createTestFixture, createTracingLayer, createUploadErrorClassifier, createUploadGauges, createUploadHistograms, createUploadMetrics, createUploadServerMetrics, createUploadSummaries, filesystemActiveUploadsGauge, filesystemApiCallsTotal, filesystemFileSizeHistogram, filesystemMetrics, filesystemPartSizeHistogram, filesystemPartUploadDurationHistogram, filesystemUploadDurationHistogram, filesystemUploadErrorsTotal, filesystemUploadLatencySummary, filesystemUploadPartsTotal, filesystemUploadRequestsTotal, filesystemUploadSuccessTotal, filesystemUploadThroughputGauge, flowMetrics, gcsActiveUploadsGauge, gcsApiCallsTotal, gcsFileSizeHistogram, gcsMetrics, gcsPartSizeHistogram, gcsPartUploadDurationHistogram, gcsUploadDurationHistogram, gcsUploadErrorsTotal, gcsUploadLatencySummary, gcsUploadPartsTotal, gcsUploadRequestsTotal, gcsUploadSuccessTotal, gcsUploadThroughputGauge, getFlowMetrics, getTestMetrics, getUploadMetrics, isObservabilityEnabled, logAzureContext, logAzureOperation, logAzureUploadCompletion, logAzureUploadProgress, logFilesystemContext, logFilesystemOperation, logFilesystemUploadCompletion, logFilesystemUploadProgress, logGCSContext, logGCSOperation, logGCSUploadCompletion, logGCSUploadProgress, logS3Context, logS3Operation, logS3UploadCompletion, logS3UploadProgress, logStorageOperation, logUploadCompletion, logUploadProgress, logWithContext, makeFlowObservabilityLayer, makeFlowObservabilityLive, makeObservabilityLayer, makeStorageObservabilityLayer, makeTestFlowObservability, makeTestFlowObservability$1 as makeTestFlowObservabilityUtil, makeTestStorageObservability, makeTestUploadObservability, makeUploadObservabilityLayer, makeUploadObservabilityLive, runWithTestFlowObservability, runWithTestObservability, s3ActiveUploadsGauge, s3ApiCallsTotal, s3FileSizeHistogram, s3Metrics, s3PartSizeHistogram, s3PartUploadDurationHistogram, s3UploadDurationHistogram, s3UploadErrorsTotal, s3UploadLatencySummary, s3UploadPartsTotal, s3UploadRequestsTotal, s3UploadSuccessTotal, s3UploadThroughputGauge, trackActiveFlow, trackActiveNode, trackAzureError, trackFileSize, trackFilesystemError, trackFlowError, trackGCSError, trackNodeError, trackPartSize, trackS3Error, trackStorageError, trackUploadError, uploadServerMetrics, validateMetricsExist, whenObservabilityEnabled, withActiveUploadTracking, withApiMetrics, withAzureApiMetrics, withAzureOperationMetrics, withAzureSpan, withAzureTimingMetrics, withAzureUploadMetrics, withChunkContext, withChunkDuration, withExecutionContext, withFilesystemApiMetrics, withFilesystemOperationMetrics, withFilesystemSpan, withFilesystemTimingMetrics, withFilesystemUploadMetrics, withFlowContext, withFlowDuration, withFlowSpan, withGCSApiMetrics, withGCSOperationMetrics, withGCSSpan, withGCSTimingMetrics, withGCSUploadMetrics, withMetricTracking, withNodeContext, withNodeDuration, withS3ApiMetrics, withS3OperationMetrics, withS3Span, withS3TimingMetrics, withS3UploadMetrics, withStorageOperationMetrics, withStorageSpan, withThroughputTracking, withTimingMetrics, withUploadContext, withUploadDuration, withUploadMetrics, withUploadSpan };
|
|
736
736
|
//# sourceMappingURL=index.d.cts.map
|