@uploadista/observability 0.0.18-beta.9 → 0.0.18

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.d.cts CHANGED
@@ -1,9 +1,15 @@
1
- import { Context, Effect, Layer, Metric, Option } from "effect";
1
+ import { Context, Effect, Layer, Logger, Metric, Option, Tracer } from "effect";
2
2
  import * as effect_MetricKeyType7 from "effect/MetricKeyType";
3
3
  import * as effect_MetricState7 from "effect/MetricState";
4
- import * as effect_Tracer0 from "effect/Tracer";
5
- import * as _effect_opentelemetry_Resource0 from "@effect/opentelemetry/Resource";
6
- import * as effect_Metric24 from "effect/Metric";
4
+ import { OTLPLogExporter, OTLPLogExporter as OTLPLogExporter$1 } from "@opentelemetry/exporter-logs-otlp-http";
5
+ import { OTLPMetricExporter, OTLPMetricExporter as OTLPMetricExporter$1 } from "@opentelemetry/exporter-metrics-otlp-http";
6
+ import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
7
+ import { BatchLogRecordProcessor, LoggerProvider, LoggerProvider as LoggerProvider$1 } from "@opentelemetry/sdk-logs";
8
+ import { MeterProvider, MeterProvider as MeterProvider$1, PeriodicExportingMetricReader } from "@opentelemetry/sdk-metrics";
9
+ import * as _effect_opentelemetry_Resource7 from "@effect/opentelemetry/Resource";
10
+ import { Meter } from "@opentelemetry/api";
11
+ import { Logger as Logger$1, SeverityNumber, SeverityNumber as SeverityNumber$1 } from "@opentelemetry/api-logs";
12
+ import * as effect_Metric49 from "effect/Metric";
7
13
 
8
14
  //#region src/core/metrics.d.ts
9
15
  declare const createUploadMetrics: (storageType: string) => {
@@ -49,6 +55,953 @@ declare const createStorageErrorClassifier: (storageType: string, customErrorMap
49
55
  declare const trackStorageError: (storageType: string, metrics: StorageMetrics, operation: string, error: unknown, context?: Record<string, unknown>, errorClassifier?: (error: unknown) => StorageErrorCategory) => Effect.Effect<void, never, never>;
50
56
  declare const createStorageErrorTracker: (storageType: string, metrics: StorageMetrics, customErrorClassifier?: (error: unknown) => StorageErrorCategory | null) => (operation: string, error: unknown, context?: Record<string, unknown>) => Effect.Effect<void, never, never>;
51
57
  //#endregion
58
+ //#region src/core/exporters.d.ts
59
+ /**
60
+ * Configuration options for OTLP exporters.
61
+ */
62
+ interface OtlpExporterConfig {
63
+ /** Base endpoint URL. Defaults to OTEL_EXPORTER_OTLP_ENDPOINT or http://localhost:4318 */
64
+ endpoint?: string;
65
+ /** Headers to include in requests (for authentication). Defaults to OTEL_EXPORTER_OTLP_HEADERS */
66
+ headers?: Record<string, string>;
67
+ /** Request timeout in milliseconds. Defaults to 5000 */
68
+ timeoutMillis?: number;
69
+ }
70
+ /**
71
+ * Parses the OTEL_EXPORTER_OTLP_HEADERS environment variable.
72
+ *
73
+ * Format: key=value,key2=value2
74
+ * Example: Authorization=Basic abc123,X-Custom-Header=value
75
+ *
76
+ * @returns Parsed headers as a Record, or undefined if not set
77
+ */
78
+ declare function parseOtlpHeaders(): Record<string, string> | undefined;
79
+ /**
80
+ * Gets the OTLP endpoint from environment variables with fallback.
81
+ *
82
+ * Checks in order:
83
+ * 1. Provided endpoint parameter
84
+ * 2. Signal-specific endpoint (OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, OTEL_EXPORTER_OTLP_METRICS_ENDPOINT, or OTEL_EXPORTER_OTLP_LOGS_ENDPOINT)
85
+ * 3. Base endpoint (OTEL_EXPORTER_OTLP_ENDPOINT)
86
+ * 4. Default: http://localhost:4318
87
+ *
88
+ * @param signal - The signal type ('traces', 'metrics', or 'logs')
89
+ * @param configEndpoint - Optional endpoint from config
90
+ * @returns The resolved endpoint URL
91
+ */
92
+ declare function getOtlpEndpoint(signal: "traces" | "metrics" | "logs", configEndpoint?: string): string;
93
+ /**
94
+ * Creates an OTLP trace exporter configured from environment variables.
95
+ *
96
+ * The exporter sends traces to an OTLP-compatible endpoint using HTTP/protobuf.
97
+ *
98
+ * @param config - Optional configuration overrides
99
+ * @returns Configured OTLPTraceExporter instance
100
+ *
101
+ * @example
102
+ * ```typescript
103
+ * // Use environment variables
104
+ * const exporter = createOtlpTraceExporter();
105
+ *
106
+ * // Override endpoint
107
+ * const exporter = createOtlpTraceExporter({
108
+ * endpoint: 'https://otlp.grafana.net'
109
+ * });
110
+ * ```
111
+ */
112
+ declare function createOtlpTraceExporter(config?: OtlpExporterConfig): OTLPTraceExporter;
113
+ /**
114
+ * Creates an OTLP metric exporter configured from environment variables.
115
+ *
116
+ * The exporter sends metrics to an OTLP-compatible endpoint using HTTP/protobuf.
117
+ *
118
+ * @param config - Optional configuration overrides
119
+ * @returns Configured OTLPMetricExporter instance
120
+ *
121
+ * @example
122
+ * ```typescript
123
+ * // Use environment variables
124
+ * const exporter = createOtlpMetricExporter();
125
+ *
126
+ * // Override endpoint
127
+ * const exporter = createOtlpMetricExporter({
128
+ * endpoint: 'https://otlp.grafana.net'
129
+ * });
130
+ * ```
131
+ */
132
+ declare function createOtlpMetricExporter(config?: OtlpExporterConfig): OTLPMetricExporter$1;
133
+ /**
134
+ * Checks if observability is enabled via environment variable.
135
+ *
136
+ * Reads UPLOADISTA_OBSERVABILITY_ENABLED environment variable.
137
+ * Defaults to true if not set.
138
+ *
139
+ * @returns true if observability should be enabled
140
+ */
141
+ declare function isOtlpExportEnabled(): boolean;
142
+ /**
143
+ * Gets the service name from environment variables.
144
+ *
145
+ * Reads OTEL_SERVICE_NAME environment variable.
146
+ * Defaults to "uploadista" if not set.
147
+ *
148
+ * @param defaultName - Default service name if not configured
149
+ * @returns The service name to use
150
+ */
151
+ declare function getServiceName(defaultName?: string): string;
152
+ /**
153
+ * Parses resource attributes from OTEL_RESOURCE_ATTRIBUTES environment variable.
154
+ *
155
+ * Format: key=value,key2=value2
156
+ * Example: tenant.id=abc123,deployment.environment=production
157
+ *
158
+ * @returns Parsed attributes as a Record, or empty object if not set
159
+ */
160
+ declare function parseResourceAttributes(): Record<string, string>;
161
+ /**
162
+ * Creates an OTLP log exporter configured from environment variables.
163
+ *
164
+ * The exporter sends logs to an OTLP-compatible endpoint using HTTP/protobuf.
165
+ *
166
+ * @param config - Optional configuration overrides
167
+ * @returns Configured OTLPLogExporter instance
168
+ *
169
+ * @example
170
+ * ```typescript
171
+ * // Use environment variables
172
+ * const exporter = createOtlpLogExporter();
173
+ *
174
+ * // Override endpoint
175
+ * const exporter = createOtlpLogExporter({
176
+ * endpoint: 'https://otlp.grafana.net'
177
+ * });
178
+ * ```
179
+ */
180
+ declare function createOtlpLogExporter(config?: OtlpExporterConfig): OTLPLogExporter$1;
181
+ /**
182
+ * Configuration for metrics export.
183
+ */
184
+ interface MetricsSdkConfig extends OtlpExporterConfig {
185
+ /** Service name for metrics. Defaults to OTEL_SERVICE_NAME or "uploadista" */
186
+ serviceName?: string;
187
+ /** Export interval in milliseconds. Defaults to OTEL_METRICS_EXPORT_INTERVAL or 60000 */
188
+ exportIntervalMillis?: number;
189
+ /** Export timeout in milliseconds. Defaults to 30000 */
190
+ exportTimeoutMillis?: number;
191
+ }
192
+ /**
193
+ * Gets the metrics export interval from environment or config.
194
+ *
195
+ * @param configInterval - Optional interval from config
196
+ * @returns Export interval in milliseconds
197
+ */
198
+ declare function getMetricsExportInterval(configInterval?: number): number;
199
+ /**
200
+ * Creates an OTLP MeterProvider with PeriodicExportingMetricReader.
201
+ *
202
+ * The MeterProvider is pre-configured with:
203
+ * - OTLP HTTP exporter for metrics
204
+ * - Periodic export based on OTEL_METRICS_EXPORT_INTERVAL (default: 60s)
205
+ * - Graceful error handling (failures logged, not thrown)
206
+ *
207
+ * @param config - Optional configuration
208
+ * @returns Configured MeterProvider instance
209
+ *
210
+ * @example
211
+ * ```typescript
212
+ * const meterProvider = createOtlpMeterProvider();
213
+ * const meter = meterProvider.getMeter("uploadista");
214
+ * const counter = meter.createCounter("uploads_total");
215
+ * counter.add(1, { storage: "s3" });
216
+ * ```
217
+ */
218
+ declare function createOtlpMeterProvider(config?: MetricsSdkConfig): MeterProvider$1;
219
+ /**
220
+ * Configuration for logs export.
221
+ */
222
+ interface LogsSdkConfig extends OtlpExporterConfig {
223
+ /** Service name for logs. Defaults to OTEL_SERVICE_NAME or "uploadista" */
224
+ serviceName?: string;
225
+ /** Maximum queue size for batch processor. Defaults to 512 */
226
+ maxQueueSize?: number;
227
+ /** Maximum export batch size. Defaults to 512 */
228
+ maxExportBatchSize?: number;
229
+ /** Schedule delay in milliseconds. Defaults to OTEL_LOGS_EXPORT_INTERVAL or 5000 */
230
+ scheduledDelayMillis?: number;
231
+ /** Export timeout in milliseconds. Defaults to 30000 */
232
+ exportTimeoutMillis?: number;
233
+ }
234
+ /**
235
+ * Gets the logs export interval from environment or config.
236
+ *
237
+ * @param configInterval - Optional interval from config
238
+ * @returns Export interval in milliseconds
239
+ */
240
+ declare function getLogsExportInterval(configInterval?: number): number;
241
+ /**
242
+ * Creates an OTLP LoggerProvider with BatchLogRecordProcessor.
243
+ *
244
+ * The LoggerProvider is pre-configured with:
245
+ * - OTLP HTTP exporter for logs
246
+ * - Batch processing with configurable queue and batch sizes
247
+ * - Graceful error handling (failures logged, not thrown)
248
+ *
249
+ * @param config - Optional configuration
250
+ * @returns Configured LoggerProvider instance
251
+ *
252
+ * @example
253
+ * ```typescript
254
+ * const loggerProvider = createOtlpLoggerProvider();
255
+ * const logger = loggerProvider.getLogger("uploadista");
256
+ * logger.emit({
257
+ * severityNumber: SeverityNumber.INFO,
258
+ * body: "Upload completed",
259
+ * attributes: { uploadId: "123" },
260
+ * });
261
+ * ```
262
+ */
263
+ declare function createOtlpLoggerProvider(config?: LogsSdkConfig): LoggerProvider$1;
264
+ //#endregion
265
+ //#region src/core/metrics-sdk.d.ts
266
+ /**
267
+ * OpenTelemetry Meter service for recording metrics.
268
+ */
269
+ interface OtelMeterService {
270
+ /** The OpenTelemetry Meter instance */
271
+ readonly meter: Meter;
272
+ /** The MeterProvider for shutdown handling */
273
+ readonly provider: MeterProvider$1;
274
+ }
275
+ declare const OtelMeter_base: Context.TagClass<OtelMeter, "OtelMeter", OtelMeterService>;
276
+ /**
277
+ * Effect Context tag for the OTEL Meter service.
278
+ */
279
+ declare class OtelMeter extends OtelMeter_base {}
280
+ /**
281
+ * Node.js OTLP Metrics SDK Layer for production use.
282
+ *
283
+ * Exports metrics to an OTLP-compatible endpoint configured via environment variables.
284
+ *
285
+ * @example
286
+ * ```typescript
287
+ * import { OtlpMetricsNodeSdkLive, OtelMeter } from "@uploadista/observability";
288
+ * import { Effect } from "effect";
289
+ *
290
+ * const program = Effect.gen(function* () {
291
+ * const { meter } = yield* OtelMeter;
292
+ * const counter = meter.createCounter("uploads_total");
293
+ * counter.add(1, { storage: "s3" });
294
+ * }).pipe(Effect.provide(OtlpMetricsNodeSdkLive));
295
+ * ```
296
+ */
297
+ declare const OtlpMetricsNodeSdkLive: Layer.Layer<OtelMeter, never, never>;
298
+ /**
299
+ * Creates a customized OTLP Metrics Node.js SDK Layer.
300
+ *
301
+ * @param config - Custom configuration options
302
+ * @returns Configured Effect Layer
303
+ *
304
+ * @example
305
+ * ```typescript
306
+ * const customMetrics = createOtlpMetricsNodeSdkLayer({
307
+ * serviceName: "my-upload-service",
308
+ * exportIntervalMillis: 30000, // Export every 30 seconds
309
+ * });
310
+ * ```
311
+ */
312
+ declare function createOtlpMetricsNodeSdkLayer(config?: MetricsSdkConfig): Layer.Layer<OtelMeter, never, never>;
313
+ /**
314
+ * Browser OTLP Metrics SDK Layer for production use.
315
+ *
316
+ * Uses the same OTLP HTTP exporter, suitable for browser environments.
317
+ * Note: Browser environments may have CORS restrictions.
318
+ *
319
+ * @example
320
+ * ```typescript
321
+ * import { OtlpMetricsWebSdkLive } from "@uploadista/observability";
322
+ *
323
+ * const program = myEffect.pipe(Effect.provide(OtlpMetricsWebSdkLive));
324
+ * ```
325
+ */
326
+ declare const OtlpMetricsWebSdkLive: Layer.Layer<OtelMeter, never, never>;
327
+ /**
328
+ * Creates a customized OTLP Metrics Web SDK Layer.
329
+ *
330
+ * @param config - Custom configuration options
331
+ * @returns Configured Effect Layer for browser environments
332
+ */
333
+ declare function createOtlpMetricsWebSdkLayer(config?: MetricsSdkConfig): Layer.Layer<OtelMeter, never, never>;
334
+ /**
335
+ * Cloudflare Workers OTLP Metrics SDK Layer for production use.
336
+ *
337
+ * Pre-configured with Workers-appropriate defaults.
338
+ *
339
+ * @example
340
+ * ```typescript
341
+ * import { OtlpMetricsWorkersSdkLive } from "@uploadista/observability";
342
+ *
343
+ * export default {
344
+ * async fetch(request, env) {
345
+ * const program = handleRequest(request).pipe(
346
+ * Effect.provide(OtlpMetricsWorkersSdkLive)
347
+ * );
348
+ * return Effect.runPromise(program);
349
+ * }
350
+ * };
351
+ * ```
352
+ */
353
+ declare const OtlpMetricsWorkersSdkLive: Layer.Layer<OtelMeter, never, never>;
354
+ /**
355
+ * Creates a customized OTLP Metrics Workers SDK Layer.
356
+ *
357
+ * @param config - Custom configuration options
358
+ * @returns Configured Effect Layer for Cloudflare Workers
359
+ */
360
+ declare function createOtlpMetricsWorkersSdkLayer(config?: MetricsSdkConfig): Layer.Layer<OtelMeter, never, never>;
361
+ /**
362
+ * Records a counter metric using the OTEL Meter from context.
363
+ *
364
+ * @param name - Counter name
365
+ * @param value - Value to add (default: 1)
366
+ * @param attributes - Optional metric attributes
367
+ * @returns Effect that records the counter
368
+ *
369
+ * @example
370
+ * ```typescript
371
+ * yield* recordCounter("uploads_total", 1, { storage: "s3" });
372
+ * ```
373
+ */
374
+ declare const recordCounter: (name: string, value?: number, attributes?: Record<string, string | number | boolean>) => Effect.Effect<void, never, OtelMeter>;
375
+ /**
376
+ * Records a histogram metric using the OTEL Meter from context.
377
+ *
378
+ * @param name - Histogram name
379
+ * @param value - Value to record
380
+ * @param attributes - Optional metric attributes
381
+ * @returns Effect that records the histogram
382
+ *
383
+ * @example
384
+ * ```typescript
385
+ * yield* recordHistogram("upload_duration_seconds", 1.5, { storage: "s3" });
386
+ * ```
387
+ */
388
+ declare const recordHistogram: (name: string, value: number, attributes?: Record<string, string | number | boolean>) => Effect.Effect<void, never, OtelMeter>;
389
+ /**
390
+ * Creates an observable gauge that reports the current value.
391
+ *
392
+ * @param name - Gauge name
393
+ * @param callback - Function that returns the current value
394
+ * @param attributes - Optional metric attributes
395
+ * @returns Effect that registers the gauge
396
+ *
397
+ * @example
398
+ * ```typescript
399
+ * let activeUploads = 0;
400
+ * yield* createGauge("active_uploads", () => activeUploads);
401
+ * ```
402
+ */
403
+ declare const createGauge: (name: string, callback: () => number, attributes?: Record<string, string | number | boolean>) => Effect.Effect<void, never, OtelMeter>;
404
+ //#endregion
405
+ //#region src/core/logs-sdk.d.ts
406
+ /**
407
+ * OpenTelemetry Logger service for emitting logs.
408
+ */
409
+ interface OtelLoggerService {
410
+ /** The OpenTelemetry Logger instance */
411
+ readonly logger: Logger$1;
412
+ /** The LoggerProvider for shutdown handling */
413
+ readonly provider: LoggerProvider$1;
414
+ }
415
+ declare const OtelLogger_base: Context.TagClass<OtelLogger, "OtelLogger", OtelLoggerService>;
416
+ /**
417
+ * Effect Context tag for the OTEL Logger service.
418
+ */
419
+ declare class OtelLogger extends OtelLogger_base {}
420
+ /**
421
+ * Maps Effect log levels to OpenTelemetry SeverityNumber.
422
+ *
423
+ * | Effect Level | OTEL Severity |
424
+ * |--------------|---------------|
425
+ * | Debug | 5 (DEBUG) |
426
+ * | Info | 9 (INFO) |
427
+ * | Warning | 13 (WARN) |
428
+ * | Error | 17 (ERROR) |
429
+ * | Fatal | 21 (FATAL) |
430
+ */
431
+ declare function mapLogLevelToSeverity(level: string): SeverityNumber$1;
432
+ /**
433
+ * Maps SeverityNumber to human-readable severity text.
434
+ */
435
+ declare function severityToText(severity: SeverityNumber$1): string;
436
+ /**
437
+ * Gets the current trace context from OpenTelemetry.
438
+ *
439
+ * @returns Object with trace_id and span_id if active, empty object otherwise
440
+ */
441
+ declare function getTraceContext(): Record<string, string>;
442
+ /**
443
+ * Extended configuration for logs SDK.
444
+ */
445
+ interface LogsLayerConfig extends LogsSdkConfig {
446
+ /** Minimum severity level to export. Logs below this level are filtered. */
447
+ minSeverity?: SeverityNumber$1;
448
+ }
449
+ /**
450
+ * Node.js OTLP Logs SDK Layer for production use.
451
+ *
452
+ * Exports logs to an OTLP-compatible endpoint with automatic trace correlation.
453
+ *
454
+ * @example
455
+ * ```typescript
456
+ * import { OtlpLogsNodeSdkLive, OtelLogger } from "@uploadista/observability";
457
+ * import { Effect } from "effect";
458
+ * import { SeverityNumber } from "@opentelemetry/api-logs";
459
+ *
460
+ * const program = Effect.gen(function* () {
461
+ * const { logger } = yield* OtelLogger;
462
+ * logger.emit({
463
+ * severityNumber: SeverityNumber.INFO,
464
+ * body: "Upload completed",
465
+ * attributes: { uploadId: "123" },
466
+ * });
467
+ * }).pipe(Effect.provide(OtlpLogsNodeSdkLive));
468
+ * ```
469
+ */
470
+ declare const OtlpLogsNodeSdkLive: Layer.Layer<OtelLogger, never, never>;
471
+ /**
472
+ * Creates a customized OTLP Logs Node.js SDK Layer.
473
+ *
474
+ * @param config - Custom configuration options
475
+ * @returns Configured Effect Layer
476
+ *
477
+ * @example
478
+ * ```typescript
479
+ * const customLogs = createOtlpLogsNodeSdkLayer({
480
+ * serviceName: "my-upload-service",
481
+ * minSeverity: SeverityNumber.WARN, // Only export WARN and above
482
+ * });
483
+ * ```
484
+ */
485
+ declare function createOtlpLogsNodeSdkLayer(config?: LogsLayerConfig): Layer.Layer<OtelLogger, never, never>;
486
+ /**
487
+ * Browser OTLP Logs SDK Layer for production use.
488
+ *
489
+ * Uses the same OTLP HTTP exporter, suitable for browser environments.
490
+ * Note: Browser environments may have CORS restrictions.
491
+ *
492
+ * @example
493
+ * ```typescript
494
+ * import { OtlpLogsWebSdkLive } from "@uploadista/observability";
495
+ *
496
+ * const program = myEffect.pipe(Effect.provide(OtlpLogsWebSdkLive));
497
+ * ```
498
+ */
499
+ declare const OtlpLogsWebSdkLive: Layer.Layer<OtelLogger, never, never>;
500
+ /**
501
+ * Creates a customized OTLP Logs Web SDK Layer.
502
+ *
503
+ * @param config - Custom configuration options
504
+ * @returns Configured Effect Layer for browser environments
505
+ */
506
+ declare function createOtlpLogsWebSdkLayer(config?: LogsLayerConfig): Layer.Layer<OtelLogger, never, never>;
507
+ /**
508
+ * Cloudflare Workers OTLP Logs SDK Layer for production use.
509
+ *
510
+ * Pre-configured with Workers-appropriate defaults.
511
+ *
512
+ * @example
513
+ * ```typescript
514
+ * import { OtlpLogsWorkersSdkLive } from "@uploadista/observability";
515
+ *
516
+ * export default {
517
+ * async fetch(request, env) {
518
+ * const program = handleRequest(request).pipe(
519
+ * Effect.provide(OtlpLogsWorkersSdkLive)
520
+ * );
521
+ * return Effect.runPromise(program);
522
+ * }
523
+ * };
524
+ * ```
525
+ */
526
+ declare const OtlpLogsWorkersSdkLive: Layer.Layer<OtelLogger, never, never>;
527
+ /**
528
+ * Creates a customized OTLP Logs Workers SDK Layer.
529
+ *
530
+ * @param config - Custom configuration options
531
+ * @returns Configured Effect Layer for Cloudflare Workers
532
+ */
533
+ declare function createOtlpLogsWorkersSdkLayer(config?: LogsLayerConfig): Layer.Layer<OtelLogger, never, never>;
534
+ /**
535
+ * Creates an Effect Logger that forwards logs to OTLP.
536
+ *
537
+ * This logger intercepts Effect.log calls and sends them to the OTLP endpoint
538
+ * with automatic trace correlation and annotation support.
539
+ *
540
+ * @param minSeverity - Minimum severity to export (default: all)
541
+ * @returns Effect Logger that exports to OTLP
542
+ *
543
+ * @example
544
+ * ```typescript
545
+ * import { createOtlpEffectLogger, OtlpLogsNodeSdkLive } from "@uploadista/observability";
546
+ *
547
+ * const program = Effect.gen(function* () {
548
+ * yield* Effect.log("This will be exported to OTLP");
549
+ * yield* Effect.logError("Errors too!");
550
+ * }).pipe(
551
+ * Effect.provide(OtlpLogsNodeSdkLive),
552
+ * EffectLogger.withMinimumLogLevel(LogLevel.Debug),
553
+ * );
554
+ * ```
555
+ */
556
+ declare const createOtlpEffectLogger: (minSeverity?: SeverityNumber$1) => Logger.Logger<unknown, void>;
557
+ /**
558
+ * Emits a log record to OTLP using the OtelLogger from context.
559
+ *
560
+ * @param level - Log level (debug, info, warn, error, fatal)
561
+ * @param message - Log message
562
+ * @param attributes - Optional log attributes
563
+ * @returns Effect that emits the log
564
+ *
565
+ * @example
566
+ * ```typescript
567
+ * yield* emitLog("info", "Upload completed", { uploadId: "123" });
568
+ * ```
569
+ */
570
+ declare const emitLog: (level: "debug" | "info" | "warn" | "error" | "fatal", message: string, attributes?: Record<string, string | number | boolean>) => Effect.Effect<void, never, OtelLogger>;
571
+ /**
572
+ * Emits a debug log to OTLP.
573
+ */
574
+ declare const logDebug: (message: string, attributes?: Record<string, string | number | boolean>) => Effect.Effect<void, never, OtelLogger>;
575
+ /**
576
+ * Emits an info log to OTLP.
577
+ */
578
+ declare const logInfo: (message: string, attributes?: Record<string, string | number | boolean>) => Effect.Effect<void, never, OtelLogger>;
579
+ /**
580
+ * Emits a warning log to OTLP.
581
+ */
582
+ declare const logWarn: (message: string, attributes?: Record<string, string | number | boolean>) => Effect.Effect<void, never, OtelLogger>;
583
+ /**
584
+ * Emits an error log to OTLP.
585
+ */
586
+ declare const logError: (message: string, attributes?: Record<string, string | number | boolean>) => Effect.Effect<void, never, OtelLogger>;
587
+ /**
588
+ * Emits a fatal log to OTLP.
589
+ */
590
+ declare const logFatal: (message: string, attributes?: Record<string, string | number | boolean>) => Effect.Effect<void, never, OtelLogger>;
591
+ //#endregion
592
+ //#region src/core/types.d.ts
593
+ /**
594
+ * OpenTelemetry trace context types for distributed tracing.
595
+ *
596
+ * These types enable trace context propagation across HTTP requests,
597
+ * allowing spans from multiple requests to be grouped under a single trace.
598
+ *
599
+ * @module observability/core/types
600
+ */
601
+ /**
602
+ * Trace context for distributed tracing.
603
+ *
604
+ * This structure holds the essential OpenTelemetry trace context that needs
605
+ * to be persisted and propagated across requests to maintain trace continuity.
606
+ *
607
+ * @property traceId - 128-bit unique identifier for the entire trace (32 hex chars)
608
+ * @property spanId - 64-bit unique identifier for the parent span (16 hex chars)
609
+ * @property traceFlags - Sampling decision (1 = sampled, 0 = not sampled)
610
+ *
611
+ * @example
612
+ * ```typescript
613
+ * // Store trace context with upload metadata
614
+ * const traceContext: TraceContext = {
615
+ * traceId: "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
616
+ * spanId: "a1b2c3d4e5f6a1b2",
617
+ * traceFlags: 1
618
+ * };
619
+ *
620
+ * // Later, restore context to link spans
621
+ * if (uploadFile.traceContext) {
622
+ * yield* withParentContext(uploadFile.traceContext)(
623
+ * Effect.withSpan("upload-chunk", { ... })(chunkEffect)
624
+ * );
625
+ * }
626
+ * ```
627
+ */
628
+ type TraceContext = {
629
+ /** 128-bit trace identifier (32 hex characters) */
630
+ traceId: string;
631
+ /** 64-bit span identifier (16 hex characters) */
632
+ spanId: string;
633
+ /** Trace flags (1 = sampled) */
634
+ traceFlags: number;
635
+ };
636
+ //#endregion
637
+ //#region src/core/tracing.d.ts
638
+ declare const TracingService: Context.Tag<{
639
+ serviceName: string;
640
+ }, {
641
+ serviceName: string;
642
+ }>;
643
+ declare const createTracingLayer: (options?: {
644
+ serviceName?: string;
645
+ }) => Layer.Layer<{
646
+ serviceName: string;
647
+ }, never, never>;
648
+ declare const createStorageTracingLayer: (storageType: string) => Layer.Layer<{
649
+ serviceName: string;
650
+ }, never, never>;
651
+ declare const withStorageSpan: <A, E, R>(operation: string, storageType: string, attributes?: Record<string, unknown>) => (effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Tracer.ParentSpan>>;
652
+ declare const WebSdkLive: Layer.Layer<_effect_opentelemetry_Resource7.Resource, never, never>;
653
+ declare const NodeSdkLive: Layer.Layer<_effect_opentelemetry_Resource7.Resource, never, never>;
654
+ declare const WorkersSdkLive: Layer.Layer<_effect_opentelemetry_Resource7.Resource, never, never>;
655
+ /**
656
+ * Configuration options for OTLP SDK layers.
657
+ */
658
+ interface OtlpSdkConfig {
659
+ /** Service name for traces. Defaults to OTEL_SERVICE_NAME or "uploadista" */
660
+ serviceName?: string;
661
+ /** Additional resource attributes to include in all spans */
662
+ resourceAttributes?: Record<string, string>;
663
+ /** Maximum queue size for batch processor. Defaults to 512 */
664
+ maxQueueSize?: number;
665
+ /** Maximum export batch size. Defaults to 512 */
666
+ maxExportBatchSize?: number;
667
+ /** Schedule delay in milliseconds. Defaults to 5000 */
668
+ scheduledDelayMillis?: number;
669
+ /** Export timeout in milliseconds. Defaults to 5000 */
670
+ exportTimeoutMillis?: number;
671
+ }
672
+ /**
673
+ * Node.js OTLP SDK Layer for production use.
674
+ *
675
+ * Exports traces to an OTLP-compatible endpoint configured via environment variables:
676
+ * - OTEL_EXPORTER_OTLP_ENDPOINT: Base endpoint (default: http://localhost:4318)
677
+ * - OTEL_EXPORTER_OTLP_HEADERS: Authentication headers
678
+ * - OTEL_SERVICE_NAME: Service name (default: uploadista)
679
+ * - OTEL_RESOURCE_ATTRIBUTES: Additional resource attributes
680
+ * - UPLOADISTA_OBSERVABILITY_ENABLED: Set to "false" to disable (default: true)
681
+ *
682
+ * @example
683
+ * ```typescript
684
+ * import { OtlpNodeSdkLive } from "@uploadista/observability";
685
+ * import { Effect } from "effect";
686
+ *
687
+ * // With default environment configuration
688
+ * const program = myEffect.pipe(Effect.provide(OtlpNodeSdkLive));
689
+ *
690
+ * // Run with:
691
+ * // OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
692
+ * // OTEL_SERVICE_NAME=my-upload-service
693
+ * ```
694
+ */
695
+ declare const OtlpNodeSdkLive: Layer.Layer<_effect_opentelemetry_Resource7.Resource, never, never>;
696
+ /**
697
+ * Creates a customized OTLP Node.js SDK Layer.
698
+ *
699
+ * Use this when you need to customize the SDK configuration beyond
700
+ * what environment variables provide.
701
+ *
702
+ * @param config - Custom configuration options
703
+ * @returns Configured Effect Layer
704
+ *
705
+ * @example
706
+ * ```typescript
707
+ * const customSdk = createOtlpNodeSdkLayer({
708
+ * serviceName: "my-custom-service",
709
+ * resourceAttributes: {
710
+ * "tenant.id": "abc123",
711
+ * "deployment.environment": "production"
712
+ * },
713
+ * maxQueueSize: 1024,
714
+ * });
715
+ *
716
+ * const program = myEffect.pipe(Effect.provide(customSdk));
717
+ * ```
718
+ */
719
+ declare function createOtlpNodeSdkLayer(config?: OtlpSdkConfig): Layer.Layer<_effect_opentelemetry_Resource7.Resource, never, never>;
720
+ /**
721
+ * Browser OTLP SDK Layer for production use.
722
+ *
723
+ * Similar to OtlpNodeSdkLive but uses fetch API for browser compatibility.
724
+ * Note: Browser environments may have CORS restrictions.
725
+ *
726
+ * @example
727
+ * ```typescript
728
+ * import { OtlpWebSdkLive } from "@uploadista/observability";
729
+ *
730
+ * const program = myEffect.pipe(Effect.provide(OtlpWebSdkLive));
731
+ * ```
732
+ */
733
+ declare const OtlpWebSdkLive: Layer.Layer<_effect_opentelemetry_Resource7.Resource, never, never>;
734
+ /**
735
+ * Creates a customized OTLP Web SDK Layer.
736
+ *
737
+ * @param config - Custom configuration options
738
+ * @returns Configured Effect Layer for browser environments
739
+ */
740
+ declare function createOtlpWebSdkLayer(config?: OtlpSdkConfig): Layer.Layer<_effect_opentelemetry_Resource7.Resource, never, never>;
741
+ /**
742
+ * Cloudflare Workers OTLP SDK Layer for production use.
743
+ *
744
+ * Uses the Web SDK under the hood with fetch-based export.
745
+ * Suitable for edge computing environments.
746
+ *
747
+ * @example
748
+ * ```typescript
749
+ * import { OtlpWorkersSdkLive } from "@uploadista/observability";
750
+ *
751
+ * export default {
752
+ * async fetch(request, env) {
753
+ * const program = handleRequest(request).pipe(
754
+ * Effect.provide(OtlpWorkersSdkLive)
755
+ * );
756
+ * return Effect.runPromise(program);
757
+ * }
758
+ * };
759
+ * ```
760
+ */
761
+ declare const OtlpWorkersSdkLive: Layer.Layer<_effect_opentelemetry_Resource7.Resource, never, never>;
762
+ /**
763
+ * Creates a customized OTLP Workers SDK Layer.
764
+ *
765
+ * @param config - Custom configuration options
766
+ * @returns Configured Effect Layer for Cloudflare Workers
767
+ */
768
+ declare function createOtlpWorkersSdkLayer(config?: OtlpSdkConfig): Layer.Layer<_effect_opentelemetry_Resource7.Resource, never, never>;
769
+ /**
770
+ * @deprecated Use `captureTraceContextEffect` instead. This synchronous function
771
+ * uses OpenTelemetry's `trace.getActiveSpan()` which may not be synchronized
772
+ * with Effect's span context when using @effect/opentelemetry.
773
+ *
774
+ * @returns TraceContext if there's an active OpenTelemetry span, undefined otherwise
775
+ */
776
+ declare function captureTraceContext(): TraceContext | undefined;
777
+ /**
778
+ * Captures the current Effect trace context for distributed tracing.
779
+ *
780
+ * Uses Effect's `currentSpan` to get the active span, which is more reliable
781
+ * than OpenTelemetry's `trace.getActiveSpan()` when using @effect/opentelemetry
782
+ * because Effect manages its own span context that may not be synchronized
783
+ * with OpenTelemetry's global context.
784
+ *
785
+ * Use this to save the trace context (traceId, spanId, traceFlags) for later
786
+ * use in distributed tracing. The captured context can be stored alongside
787
+ * data (e.g., in KV store with upload metadata) and restored later using
788
+ * `createExternalSpan` and passing it to `Effect.withSpan`'s `parent` option.
789
+ *
790
+ * @returns Effect yielding TraceContext if there's an active span, undefined otherwise
791
+ *
792
+ * @example
793
+ * ```typescript
794
+ * // Capture context during upload creation
795
+ * const createUpload = Effect.gen(function* () {
796
+ * const traceContext = yield* captureTraceContextEffect;
797
+ *
798
+ * const file: UploadFile = {
799
+ * id: uploadId,
800
+ * traceContext, // Store for later
801
+ * // ...
802
+ * };
803
+ * yield* kvStore.set(uploadId, file);
804
+ * }).pipe(Effect.withSpan("upload-create", { ... }));
805
+ * ```
806
+ */
807
+ declare const captureTraceContextEffect: Effect.Effect<TraceContext | undefined>;
808
+ /**
809
+ * Creates an ExternalSpan from a stored trace context.
810
+ *
811
+ * Use this to create a parent span reference that can be passed to
812
+ * `Effect.withSpan`'s `parent` option for distributed tracing.
813
+ *
814
+ * **Important:** The parent must be passed directly to `Effect.withSpan`'s
815
+ * options, not provided as a service afterward.
816
+ *
817
+ * @param traceContext - Previously captured trace context
818
+ * @returns ExternalSpan that can be used as a parent in Effect.withSpan
819
+ *
820
+ * @example
821
+ * ```typescript
822
+ * // Create parent span from stored trace context
823
+ * const parentSpan = file.traceContext
824
+ * ? createExternalSpan(file.traceContext)
825
+ * : undefined;
826
+ *
827
+ * // Pass parent directly to withSpan
828
+ * const chunkEffect = Effect.gen(function* () {
829
+ * // ... chunk upload logic
830
+ * }).pipe(
831
+ * Effect.withSpan("upload-chunk", {
832
+ * attributes: { ... },
833
+ * parent: parentSpan, // Link to original trace
834
+ * })
835
+ * );
836
+ * ```
837
+ */
838
+ declare function createExternalSpan(traceContext: TraceContext): Tracer.ExternalSpan;
839
+ /**
840
+ * @deprecated Use `createExternalSpan` instead and pass the result to
841
+ * `Effect.withSpan`'s `parent` option directly. This function doesn't
842
+ * work correctly because Effect.withSpan reads the parent at construction
843
+ * time, not from the provided service.
844
+ *
845
+ * @example
846
+ * ```typescript
847
+ * // Instead of:
848
+ * withParentContext(traceContext)(effect.pipe(Effect.withSpan(...)))
849
+ *
850
+ * // Do this:
851
+ * const parent = createExternalSpan(traceContext);
852
+ * effect.pipe(Effect.withSpan("name", { parent }))
853
+ * ```
854
+ */
855
+ declare function withParentContext(traceContext: TraceContext): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
856
+ /**
857
+ * Checks if there's an active trace context.
858
+ *
859
+ * Useful for conditional logic based on whether tracing is active.
860
+ *
861
+ * @returns true if there's an active span with valid trace context
862
+ *
863
+ * @example
864
+ * ```typescript
865
+ * if (hasActiveTraceContext()) {
866
+ * console.log("Tracing is active");
867
+ * }
868
+ * ```
869
+ */
870
+ declare function hasActiveTraceContext(): boolean;
871
+ //#endregion
872
+ //#region src/core/full-observability.d.ts
873
+ /**
874
+ * Configuration for full observability SDK.
875
+ */
876
+ interface FullObservabilityConfig {
877
+ /** Service name for all telemetry. Defaults to OTEL_SERVICE_NAME or "uploadista" */
878
+ serviceName?: string;
879
+ /** Additional resource attributes */
880
+ resourceAttributes?: Record<string, string>;
881
+ /** Traces-specific configuration */
882
+ traces?: Omit<OtlpSdkConfig, "serviceName" | "resourceAttributes">;
883
+ /** Metrics-specific configuration */
884
+ metrics?: Omit<MetricsSdkConfig, "serviceName">;
885
+ /** Logs-specific configuration */
886
+ logs?: Omit<LogsLayerConfig, "serviceName">;
887
+ }
888
+ /**
889
+ * Node.js Full Observability SDK Layer.
890
+ *
891
+ * Combines traces, metrics, and logs export into a single layer.
892
+ * Use this for easy setup of complete observability.
893
+ *
894
+ * @example
895
+ * ```typescript
896
+ * import { OtlpFullObservabilityNodeSdkLive } from "@uploadista/observability";
897
+ * import { Effect } from "effect";
898
+ *
899
+ * const program = Effect.gen(function* () {
900
+ * // All three pillars are now active:
901
+ * // - Traces via Effect.withSpan
902
+ * // - Metrics via OtelMeter
903
+ * // - Logs via OtelLogger
904
+ * yield* Effect.log("This goes to OTLP!");
905
+ * }).pipe(Effect.provide(OtlpFullObservabilityNodeSdkLive));
906
+ * ```
907
+ */
908
+ declare const OtlpFullObservabilityNodeSdkLive: Layer.Layer<_effect_opentelemetry_Resource7.Resource | OtelMeter | OtelLogger, never, never>;
909
+ /**
910
+ * Creates a customized Full Observability Node.js SDK Layer.
911
+ *
912
+ * @param config - Configuration for all three pillars
913
+ * @returns Combined Effect Layer
914
+ *
915
+ * @example
916
+ * ```typescript
917
+ * const customObservability = createOtlpFullObservabilityNodeSdkLayer({
918
+ * serviceName: "my-upload-service",
919
+ * traces: { maxQueueSize: 1024 },
920
+ * metrics: { exportIntervalMillis: 30000 },
921
+ * logs: { minSeverity: SeverityNumber.WARN },
922
+ * });
923
+ * ```
924
+ */
925
+ declare function createOtlpFullObservabilityNodeSdkLayer(config?: FullObservabilityConfig): Layer.Layer<_effect_opentelemetry_Resource7.Resource | OtelMeter | OtelLogger, never, never>;
926
+ /**
927
+ * Browser Full Observability SDK Layer.
928
+ *
929
+ * Combines traces, metrics, and logs export for browser environments.
930
+ *
931
+ * @example
932
+ * ```typescript
933
+ * import { OtlpFullObservabilityWebSdkLive } from "@uploadista/observability";
934
+ *
935
+ * const program = myEffect.pipe(Effect.provide(OtlpFullObservabilityWebSdkLive));
936
+ * ```
937
+ */
938
+ declare const OtlpFullObservabilityWebSdkLive: Layer.Layer<_effect_opentelemetry_Resource7.Resource | OtelMeter | OtelLogger, never, never>;
939
+ /**
940
+ * Creates a customized Full Observability Web SDK Layer.
941
+ *
942
+ * @param config - Configuration for all three pillars
943
+ * @returns Combined Effect Layer for browser environments
944
+ */
945
+ declare function createOtlpFullObservabilityWebSdkLayer(config?: FullObservabilityConfig): Layer.Layer<_effect_opentelemetry_Resource7.Resource | OtelMeter | OtelLogger, never, never>;
946
+ /**
947
+ * Cloudflare Workers Full Observability SDK Layer.
948
+ *
949
+ * Combines traces, metrics, and logs export for Workers environments.
950
+ *
951
+ * @example
952
+ * ```typescript
953
+ * import { OtlpFullObservabilityWorkersSdkLive } from "@uploadista/observability";
954
+ *
955
+ * export default {
956
+ * async fetch(request, env) {
957
+ * const program = handleRequest(request).pipe(
958
+ * Effect.provide(OtlpFullObservabilityWorkersSdkLive)
959
+ * );
960
+ * return Effect.runPromise(program);
961
+ * }
962
+ * };
963
+ * ```
964
+ */
965
+ declare const OtlpFullObservabilityWorkersSdkLive: Layer.Layer<_effect_opentelemetry_Resource7.Resource | OtelMeter | OtelLogger, never, never>;
966
+ /**
967
+ * Creates a customized Full Observability Workers SDK Layer.
968
+ *
969
+ * @param config - Configuration for all three pillars
970
+ * @returns Combined Effect Layer for Cloudflare Workers
971
+ */
972
+ declare function createOtlpFullObservabilityWorkersSdkLayer(config?: FullObservabilityConfig): Layer.Layer<_effect_opentelemetry_Resource7.Resource | OtelMeter | OtelLogger, never, never>;
973
+ /**
974
+ * Runtime environment types.
975
+ */
976
+ type Environment = "node" | "web" | "workers";
977
+ /**
978
+ * Detects the current runtime environment.
979
+ *
980
+ * @returns The detected environment
981
+ */
982
+ declare function detectEnvironment(): Environment;
983
+ /**
984
+ * Auto-detecting Full Observability SDK Layer.
985
+ *
986
+ * Automatically selects the appropriate layer based on runtime environment.
987
+ *
988
+ * @example
989
+ * ```typescript
990
+ * import { OtlpAutoSdkLive } from "@uploadista/observability";
991
+ *
992
+ * // Works in Node.js, Browser, or Workers automatically
993
+ * const program = myEffect.pipe(Effect.provide(OtlpAutoSdkLive));
994
+ * ```
995
+ */
996
+ declare const OtlpAutoSdkLive: Layer.Layer<_effect_opentelemetry_Resource7.Resource | OtelMeter | OtelLogger, never, never>;
997
+ /**
998
+ * Creates an auto-detecting Full Observability SDK Layer with custom config.
999
+ *
1000
+ * @param config - Configuration for all three pillars
1001
+ * @returns Auto-detecting combined Effect Layer
1002
+ */
1003
+ declare function createOtlpAutoSdkLayer(config?: FullObservabilityConfig): Layer.Layer<_effect_opentelemetry_Resource7.Resource | OtelMeter | OtelLogger, never, never>;
1004
+ //#endregion
52
1005
  //#region src/core/layers.d.ts
53
1006
  /**
54
1007
  * Core observability service providing tracing, metrics, and logging capabilities
@@ -207,25 +1160,6 @@ declare const createTestFixture: (storageType?: string) => ObservabilityTestFixt
207
1160
  */
208
1161
  declare const runWithTestObservability: <A, E>(effect: Effect.Effect<A, E, StorageObservability | UploadObservability | FlowObservability>, storageType?: string) => Effect.Effect<A, E>;
209
1162
  //#endregion
210
- //#region src/core/tracing.d.ts
211
- declare const TracingService: Context.Tag<{
212
- serviceName: string;
213
- }, {
214
- serviceName: string;
215
- }>;
216
- declare const createTracingLayer: (options?: {
217
- serviceName?: string;
218
- }) => Layer.Layer<{
219
- serviceName: string;
220
- }, never, never>;
221
- declare const createStorageTracingLayer: (storageType: string) => Layer.Layer<{
222
- serviceName: string;
223
- }, never, never>;
224
- declare const withStorageSpan: <A, E, R>(operation: string, storageType: string, attributes?: Record<string, unknown>) => (effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, effect_Tracer0.ParentSpan>>;
225
- declare const WebSdkLive: Layer.Layer<_effect_opentelemetry_Resource0.Resource, never, never>;
226
- declare const NodeSdkLive: Layer.Layer<_effect_opentelemetry_Resource0.Resource, never, never>;
227
- declare const WorkersSdkLive: Layer.Layer<_effect_opentelemetry_Resource0.Resource, never, never>;
228
- //#endregion
229
1163
  //#region src/core/utilities.d.ts
230
1164
  declare const withUploadMetrics: <A, E, R>(metrics: StorageMetrics, uploadId: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
231
1165
  declare const withApiMetrics: <A, E, R>(metrics: StorageMetrics, operation: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
@@ -275,8 +1209,12 @@ declare const getFlowMetrics: Effect.Effect<{
275
1209
  declare const withFlowDuration: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
276
1210
  /**
277
1211
  * Helper to track node duration
1212
+ * @param nodeId - Unique node identifier
1213
+ * @param nodeType - Generic node type (e.g., "optimize", "resize")
1214
+ * @param effect - The effect to track
1215
+ * @param nodeTypeId - Optional specific node type ID (e.g., "optimize-image", "resize-video")
278
1216
  */
279
- declare const withNodeDuration: <A, E, R>(nodeId: string, nodeType: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
1217
+ declare const withNodeDuration: <A, E, R>(nodeId: string, nodeType: string, effect: Effect.Effect<A, E, R>, nodeTypeId?: string) => Effect.Effect<A, E, R>;
280
1218
  /**
281
1219
  * Helper to track active flows
282
1220
  */
@@ -406,6 +1344,42 @@ declare const withExecutionContext: (context: {
406
1344
  totalNodes?: number;
407
1345
  parallelCount?: number;
408
1346
  }) => Effect.Effect<void, never, never>;
1347
+ /**
1348
+ * Operation domains for plugin-level tracing
1349
+ */
1350
+ type OperationDomain = "image" | "video" | "document" | "ai" | "virus-scan" | "zip";
1351
+ /**
1352
+ * Wrap an Effect with a plugin operation span
1353
+ *
1354
+ * @param domain - The operation domain (e.g., "image", "video", "document")
1355
+ * @param operation - The specific operation (e.g., "optimize", "transcode", "extract-text")
1356
+ * @param attributes - Optional span attributes with operation-specific details
1357
+ *
1358
+ * @example
1359
+ * ```typescript
1360
+ * // Image optimization span
1361
+ * withOperationSpan("image", "optimize", {
1362
+ * "image.format": "webp",
1363
+ * "image.quality": 80,
1364
+ * })(imageService.optimize(inputBytes, params))
1365
+ *
1366
+ * // Video transcoding span
1367
+ * withOperationSpan("video", "transcode", {
1368
+ * "video.format": "mp4",
1369
+ * "video.codec": "h264",
1370
+ * })(videoService.transcode(inputBytes, params))
1371
+ * ```
1372
+ */
1373
+ declare const withOperationSpan: <A, E, R>(domain: OperationDomain, operation: string, attributes?: Record<string, unknown>) => (effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
1374
+ /**
1375
+ * Add operation context to the current span
1376
+ */
1377
+ declare const withOperationContext: (context: {
1378
+ domain: OperationDomain;
1379
+ operation: string;
1380
+ inputSize?: number;
1381
+ outputSize?: number;
1382
+ }) => Effect.Effect<void, never, never>;
409
1383
  /**
410
1384
  * Circuit breaker state for tracing
411
1385
  */
@@ -459,18 +1433,18 @@ declare const NoOpMetricsServiceLive: Layer.Layer<MetricsService>;
459
1433
  //#endregion
460
1434
  //#region src/storage/azure.d.ts
461
1435
  declare const azureMetrics: {
462
- uploadLatencySummary: effect_Metric24.Metric.Summary<number>;
463
- activeUploadsGauge: effect_Metric24.Metric.Gauge<number>;
464
- uploadThroughputGauge: effect_Metric24.Metric.Gauge<number>;
465
- uploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
466
- partUploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
467
- fileSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
468
- partSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
469
- uploadRequestsTotal: effect_Metric24.Metric.Counter<number>;
470
- uploadPartsTotal: effect_Metric24.Metric.Counter<number>;
471
- uploadSuccessTotal: effect_Metric24.Metric.Counter<number>;
472
- uploadErrorsTotal: effect_Metric24.Metric.Counter<number>;
473
- apiCallsTotal: effect_Metric24.Metric.Counter<number>;
1436
+ uploadLatencySummary: effect_Metric49.Metric.Summary<number>;
1437
+ activeUploadsGauge: effect_Metric49.Metric.Gauge<number>;
1438
+ uploadThroughputGauge: effect_Metric49.Metric.Gauge<number>;
1439
+ uploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1440
+ partUploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1441
+ fileSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1442
+ partSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1443
+ uploadRequestsTotal: effect_Metric49.Metric.Counter<number>;
1444
+ uploadPartsTotal: effect_Metric49.Metric.Counter<number>;
1445
+ uploadSuccessTotal: effect_Metric49.Metric.Counter<number>;
1446
+ uploadErrorsTotal: effect_Metric49.Metric.Counter<number>;
1447
+ apiCallsTotal: effect_Metric49.Metric.Counter<number>;
474
1448
  };
475
1449
  declare const AzureTracingLayer: Layer.Layer<{
476
1450
  serviceName: string;
@@ -481,7 +1455,7 @@ declare const AzureObservabilityLayer: Layer.Layer<{
481
1455
  }, never, never>;
482
1456
  declare const withAzureUploadMetrics: <A, E, R>(uploadId: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
483
1457
  declare const withAzureApiMetrics: <A, E, R>(operation: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
484
- declare const withAzureTimingMetrics: <A, E, R>(metric: effect_Metric24.Metric.Histogram<number>, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
1458
+ declare const withAzureTimingMetrics: <A, E, R>(metric: effect_Metric49.Metric.Histogram<number>, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
485
1459
  declare const withAzureOperationMetrics: <A, E, R>(operation: string, uploadId: string, effect: Effect.Effect<A, E, R>, fileSize?: number) => Effect.Effect<A, E, R>;
486
1460
  declare const withAzureSpan: <A, E, R>(operation: string, attributes?: Record<string, unknown>) => (effect: Effect.Effect<A, E, R>) => Effect.Effect<unknown, unknown, unknown>;
487
1461
  declare const logAzureOperation: (operation: string, uploadId: string, metadata?: Record<string, unknown> | undefined) => Effect.Effect<void, never, never>;
@@ -500,23 +1474,23 @@ declare const logAzureUploadCompletion: (uploadId: string, metrics: {
500
1474
  retryCount?: number;
501
1475
  }) => Effect.Effect<void, never, never>;
502
1476
  declare const logAzureContext: (message: string, context: Record<string, unknown>) => Effect.Effect<void, never, never>;
503
- declare const azureUploadRequestsTotal: effect_Metric24.Metric.Counter<number>, azureUploadPartsTotal: effect_Metric24.Metric.Counter<number>, azureUploadSuccessTotal: effect_Metric24.Metric.Counter<number>, azureUploadErrorsTotal: effect_Metric24.Metric.Counter<number>, azureApiCallsTotal: effect_Metric24.Metric.Counter<number>, azureUploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, azurePartUploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, azureFileSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, azurePartSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, azureActiveUploadsGauge: effect_Metric24.Metric.Gauge<number>, azureUploadThroughputGauge: effect_Metric24.Metric.Gauge<number>, azureUploadLatencySummary: effect_Metric24.Metric.Summary<number>;
1477
+ declare const azureUploadRequestsTotal: effect_Metric49.Metric.Counter<number>, azureUploadPartsTotal: effect_Metric49.Metric.Counter<number>, azureUploadSuccessTotal: effect_Metric49.Metric.Counter<number>, azureUploadErrorsTotal: effect_Metric49.Metric.Counter<number>, azureApiCallsTotal: effect_Metric49.Metric.Counter<number>, azureUploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, azurePartUploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, azureFileSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, azurePartSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, azureActiveUploadsGauge: effect_Metric49.Metric.Gauge<number>, azureUploadThroughputGauge: effect_Metric49.Metric.Gauge<number>, azureUploadLatencySummary: effect_Metric49.Metric.Summary<number>;
504
1478
  type AzureMetrics = StorageMetrics;
505
1479
  //#endregion
506
1480
  //#region src/storage/filesystem.d.ts
507
1481
  declare const filesystemMetrics: {
508
- uploadLatencySummary: effect_Metric24.Metric.Summary<number>;
509
- activeUploadsGauge: effect_Metric24.Metric.Gauge<number>;
510
- uploadThroughputGauge: effect_Metric24.Metric.Gauge<number>;
511
- uploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
512
- partUploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
513
- fileSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
514
- partSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
515
- uploadRequestsTotal: effect_Metric24.Metric.Counter<number>;
516
- uploadPartsTotal: effect_Metric24.Metric.Counter<number>;
517
- uploadSuccessTotal: effect_Metric24.Metric.Counter<number>;
518
- uploadErrorsTotal: effect_Metric24.Metric.Counter<number>;
519
- apiCallsTotal: effect_Metric24.Metric.Counter<number>;
1482
+ uploadLatencySummary: effect_Metric49.Metric.Summary<number>;
1483
+ activeUploadsGauge: effect_Metric49.Metric.Gauge<number>;
1484
+ uploadThroughputGauge: effect_Metric49.Metric.Gauge<number>;
1485
+ uploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1486
+ partUploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1487
+ fileSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1488
+ partSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1489
+ uploadRequestsTotal: effect_Metric49.Metric.Counter<number>;
1490
+ uploadPartsTotal: effect_Metric49.Metric.Counter<number>;
1491
+ uploadSuccessTotal: effect_Metric49.Metric.Counter<number>;
1492
+ uploadErrorsTotal: effect_Metric49.Metric.Counter<number>;
1493
+ apiCallsTotal: effect_Metric49.Metric.Counter<number>;
520
1494
  };
521
1495
  declare const FilesystemTracingLayer: Layer.Layer<{
522
1496
  serviceName: string;
@@ -527,7 +1501,7 @@ declare const FilesystemObservabilityLayer: Layer.Layer<{
527
1501
  }, never, never>;
528
1502
  declare const withFilesystemUploadMetrics: <A, E, R>(uploadId: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
529
1503
  declare const withFilesystemApiMetrics: <A, E, R>(operation: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
530
- declare const withFilesystemTimingMetrics: <A, E, R>(metric: effect_Metric24.Metric.Histogram<number>, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
1504
+ declare const withFilesystemTimingMetrics: <A, E, R>(metric: effect_Metric49.Metric.Histogram<number>, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
531
1505
  declare const withFilesystemOperationMetrics: <A, E, R>(operation: string, uploadId: string, effect: Effect.Effect<A, E, R>, fileSize?: number) => Effect.Effect<A, E, R>;
532
1506
  declare const withFilesystemSpan: <A, E, R>(operation: string, attributes?: Record<string, unknown>) => (effect: Effect.Effect<A, E, R>) => Effect.Effect<unknown, unknown, unknown>;
533
1507
  declare const logFilesystemOperation: (operation: string, uploadId: string, metadata?: Record<string, unknown> | undefined) => Effect.Effect<void, never, never>;
@@ -546,23 +1520,23 @@ declare const logFilesystemUploadCompletion: (uploadId: string, metrics: {
546
1520
  retryCount?: number;
547
1521
  }) => Effect.Effect<void, never, never>;
548
1522
  declare const logFilesystemContext: (message: string, context: Record<string, unknown>) => Effect.Effect<void, never, never>;
549
- declare const filesystemUploadRequestsTotal: effect_Metric24.Metric.Counter<number>, filesystemUploadPartsTotal: effect_Metric24.Metric.Counter<number>, filesystemUploadSuccessTotal: effect_Metric24.Metric.Counter<number>, filesystemUploadErrorsTotal: effect_Metric24.Metric.Counter<number>, filesystemApiCallsTotal: effect_Metric24.Metric.Counter<number>, filesystemUploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, filesystemPartUploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, filesystemFileSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, filesystemPartSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, filesystemActiveUploadsGauge: effect_Metric24.Metric.Gauge<number>, filesystemUploadThroughputGauge: effect_Metric24.Metric.Gauge<number>, filesystemUploadLatencySummary: effect_Metric24.Metric.Summary<number>;
1523
+ declare const filesystemUploadRequestsTotal: effect_Metric49.Metric.Counter<number>, filesystemUploadPartsTotal: effect_Metric49.Metric.Counter<number>, filesystemUploadSuccessTotal: effect_Metric49.Metric.Counter<number>, filesystemUploadErrorsTotal: effect_Metric49.Metric.Counter<number>, filesystemApiCallsTotal: effect_Metric49.Metric.Counter<number>, filesystemUploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, filesystemPartUploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, filesystemFileSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, filesystemPartSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, filesystemActiveUploadsGauge: effect_Metric49.Metric.Gauge<number>, filesystemUploadThroughputGauge: effect_Metric49.Metric.Gauge<number>, filesystemUploadLatencySummary: effect_Metric49.Metric.Summary<number>;
550
1524
  type FilesystemMetrics = StorageMetrics;
551
1525
  //#endregion
552
1526
  //#region src/storage/gcs.d.ts
553
1527
  declare const gcsMetrics: {
554
- uploadLatencySummary: effect_Metric24.Metric.Summary<number>;
555
- activeUploadsGauge: effect_Metric24.Metric.Gauge<number>;
556
- uploadThroughputGauge: effect_Metric24.Metric.Gauge<number>;
557
- uploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
558
- partUploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
559
- fileSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
560
- partSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
561
- uploadRequestsTotal: effect_Metric24.Metric.Counter<number>;
562
- uploadPartsTotal: effect_Metric24.Metric.Counter<number>;
563
- uploadSuccessTotal: effect_Metric24.Metric.Counter<number>;
564
- uploadErrorsTotal: effect_Metric24.Metric.Counter<number>;
565
- apiCallsTotal: effect_Metric24.Metric.Counter<number>;
1528
+ uploadLatencySummary: effect_Metric49.Metric.Summary<number>;
1529
+ activeUploadsGauge: effect_Metric49.Metric.Gauge<number>;
1530
+ uploadThroughputGauge: effect_Metric49.Metric.Gauge<number>;
1531
+ uploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1532
+ partUploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1533
+ fileSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1534
+ partSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1535
+ uploadRequestsTotal: effect_Metric49.Metric.Counter<number>;
1536
+ uploadPartsTotal: effect_Metric49.Metric.Counter<number>;
1537
+ uploadSuccessTotal: effect_Metric49.Metric.Counter<number>;
1538
+ uploadErrorsTotal: effect_Metric49.Metric.Counter<number>;
1539
+ apiCallsTotal: effect_Metric49.Metric.Counter<number>;
566
1540
  };
567
1541
  declare const GCSTracingLayer: Layer.Layer<{
568
1542
  serviceName: string;
@@ -573,7 +1547,7 @@ declare const GCSObservabilityLayer: Layer.Layer<{
573
1547
  }, never, never>;
574
1548
  declare const withGCSUploadMetrics: <A, E, R>(uploadId: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
575
1549
  declare const withGCSApiMetrics: <A, E, R>(operation: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
576
- declare const withGCSTimingMetrics: <A, E, R>(metric: effect_Metric24.Metric.Histogram<number>, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
1550
+ declare const withGCSTimingMetrics: <A, E, R>(metric: effect_Metric49.Metric.Histogram<number>, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
577
1551
  declare const withGCSOperationMetrics: <A, E, R>(operation: string, uploadId: string, effect: Effect.Effect<A, E, R>, fileSize?: number) => Effect.Effect<A, E, R>;
578
1552
  declare const withGCSSpan: <A, E, R>(operation: string, attributes?: Record<string, unknown>) => (effect: Effect.Effect<A, E, R>) => Effect.Effect<unknown, unknown, unknown>;
579
1553
  declare const logGCSOperation: (operation: string, uploadId: string, metadata?: Record<string, unknown> | undefined) => Effect.Effect<void, never, never>;
@@ -592,23 +1566,23 @@ declare const logGCSUploadCompletion: (uploadId: string, metrics: {
592
1566
  retryCount?: number;
593
1567
  }) => Effect.Effect<void, never, never>;
594
1568
  declare const logGCSContext: (message: string, context: Record<string, unknown>) => Effect.Effect<void, never, never>;
595
- declare const gcsUploadRequestsTotal: effect_Metric24.Metric.Counter<number>, gcsUploadPartsTotal: effect_Metric24.Metric.Counter<number>, gcsUploadSuccessTotal: effect_Metric24.Metric.Counter<number>, gcsUploadErrorsTotal: effect_Metric24.Metric.Counter<number>, gcsApiCallsTotal: effect_Metric24.Metric.Counter<number>, gcsUploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, gcsPartUploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, gcsFileSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, gcsPartSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, gcsActiveUploadsGauge: effect_Metric24.Metric.Gauge<number>, gcsUploadThroughputGauge: effect_Metric24.Metric.Gauge<number>, gcsUploadLatencySummary: effect_Metric24.Metric.Summary<number>;
1569
+ declare const gcsUploadRequestsTotal: effect_Metric49.Metric.Counter<number>, gcsUploadPartsTotal: effect_Metric49.Metric.Counter<number>, gcsUploadSuccessTotal: effect_Metric49.Metric.Counter<number>, gcsUploadErrorsTotal: effect_Metric49.Metric.Counter<number>, gcsApiCallsTotal: effect_Metric49.Metric.Counter<number>, gcsUploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, gcsPartUploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, gcsFileSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, gcsPartSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, gcsActiveUploadsGauge: effect_Metric49.Metric.Gauge<number>, gcsUploadThroughputGauge: effect_Metric49.Metric.Gauge<number>, gcsUploadLatencySummary: effect_Metric49.Metric.Summary<number>;
596
1570
  type GCSMetrics = StorageMetrics;
597
1571
  //#endregion
598
1572
  //#region src/storage/s3.d.ts
599
1573
  declare const s3Metrics: {
600
- uploadLatencySummary: effect_Metric24.Metric.Summary<number>;
601
- activeUploadsGauge: effect_Metric24.Metric.Gauge<number>;
602
- uploadThroughputGauge: effect_Metric24.Metric.Gauge<number>;
603
- uploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
604
- partUploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
605
- fileSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
606
- partSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
607
- uploadRequestsTotal: effect_Metric24.Metric.Counter<number>;
608
- uploadPartsTotal: effect_Metric24.Metric.Counter<number>;
609
- uploadSuccessTotal: effect_Metric24.Metric.Counter<number>;
610
- uploadErrorsTotal: effect_Metric24.Metric.Counter<number>;
611
- apiCallsTotal: effect_Metric24.Metric.Counter<number>;
1574
+ uploadLatencySummary: effect_Metric49.Metric.Summary<number>;
1575
+ activeUploadsGauge: effect_Metric49.Metric.Gauge<number>;
1576
+ uploadThroughputGauge: effect_Metric49.Metric.Gauge<number>;
1577
+ uploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1578
+ partUploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1579
+ fileSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1580
+ partSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1581
+ uploadRequestsTotal: effect_Metric49.Metric.Counter<number>;
1582
+ uploadPartsTotal: effect_Metric49.Metric.Counter<number>;
1583
+ uploadSuccessTotal: effect_Metric49.Metric.Counter<number>;
1584
+ uploadErrorsTotal: effect_Metric49.Metric.Counter<number>;
1585
+ apiCallsTotal: effect_Metric49.Metric.Counter<number>;
612
1586
  };
613
1587
  declare const S3TracingLayer: Layer.Layer<{
614
1588
  serviceName: string;
@@ -619,7 +1593,7 @@ declare const S3ObservabilityLayer: Layer.Layer<{
619
1593
  }, never, never>;
620
1594
  declare const withS3UploadMetrics: <A, E, R>(uploadId: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
621
1595
  declare const withS3ApiMetrics: <A, E, R>(operation: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
622
- declare const withS3TimingMetrics: <A, E, R>(metric: effect_Metric24.Metric.Histogram<number>, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
1596
+ declare const withS3TimingMetrics: <A, E, R>(metric: effect_Metric49.Metric.Histogram<number>, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
623
1597
  declare const withS3OperationMetrics: <A, E, R>(operation: string, uploadId: string, effect: Effect.Effect<A, E, R>, fileSize?: number) => Effect.Effect<A, E, R>;
624
1598
  declare const withS3Span: <A, E, R>(operation: string, attributes?: Record<string, unknown>) => (effect: Effect.Effect<A, E, R>) => Effect.Effect<unknown, unknown, unknown>;
625
1599
  declare const logS3Operation: (operation: string, uploadId: string, metadata?: Record<string, unknown> | undefined) => Effect.Effect<void, never, never>;
@@ -638,7 +1612,7 @@ declare const logS3UploadCompletion: (uploadId: string, metrics: {
638
1612
  retryCount?: number;
639
1613
  }) => Effect.Effect<void, never, never>;
640
1614
  declare const logS3Context: (message: string, context: Record<string, unknown>) => Effect.Effect<void, never, never>;
641
- declare const s3UploadRequestsTotal: effect_Metric24.Metric.Counter<number>, s3UploadPartsTotal: effect_Metric24.Metric.Counter<number>, s3UploadSuccessTotal: effect_Metric24.Metric.Counter<number>, s3UploadErrorsTotal: effect_Metric24.Metric.Counter<number>, s3ApiCallsTotal: effect_Metric24.Metric.Counter<number>, s3UploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, s3PartUploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, s3FileSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, s3PartSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, s3ActiveUploadsGauge: effect_Metric24.Metric.Gauge<number>, s3UploadThroughputGauge: effect_Metric24.Metric.Gauge<number>, s3UploadLatencySummary: effect_Metric24.Metric.Summary<number>;
1615
+ declare const s3UploadRequestsTotal: effect_Metric49.Metric.Counter<number>, s3UploadPartsTotal: effect_Metric49.Metric.Counter<number>, s3UploadSuccessTotal: effect_Metric49.Metric.Counter<number>, s3UploadErrorsTotal: effect_Metric49.Metric.Counter<number>, s3ApiCallsTotal: effect_Metric49.Metric.Counter<number>, s3UploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, s3PartUploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, s3FileSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, s3PartSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>, s3ActiveUploadsGauge: effect_Metric49.Metric.Gauge<number>, s3UploadThroughputGauge: effect_Metric49.Metric.Gauge<number>, s3UploadLatencySummary: effect_Metric49.Metric.Summary<number>;
642
1616
  type S3Metrics = StorageMetrics;
643
1617
  //#endregion
644
1618
  //#region src/upload/metrics.d.ts
@@ -739,21 +1713,21 @@ declare const UploadObservabilityTest: Layer.Layer<UploadObservability, never, n
739
1713
  * Get metrics for validation (useful for testing metric definitions)
740
1714
  */
741
1715
  declare const getTestMetrics: () => {
742
- uploadCreatedTotal: effect_Metric24.Metric.Counter<number>;
743
- uploadCompletedTotal: effect_Metric24.Metric.Counter<number>;
744
- uploadFailedTotal: effect_Metric24.Metric.Counter<number>;
745
- chunkUploadedTotal: effect_Metric24.Metric.Counter<number>;
746
- uploadFromUrlTotal: effect_Metric24.Metric.Counter<number>;
747
- uploadFromUrlSuccessTotal: effect_Metric24.Metric.Counter<number>;
748
- uploadFromUrlFailedTotal: effect_Metric24.Metric.Counter<number>;
749
- uploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
750
- chunkUploadDurationHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
751
- uploadFileSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
752
- chunkSizeHistogram: effect_Metric24.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
753
- activeUploadsGauge: effect_Metric24.Metric.Gauge<number>;
754
- uploadThroughputGauge: effect_Metric24.Metric.Gauge<number>;
755
- uploadLatencySummary: effect_Metric24.Metric.Summary<number>;
756
- chunkLatencySummary: effect_Metric24.Metric.Summary<number>;
1716
+ uploadCreatedTotal: effect_Metric49.Metric.Counter<number>;
1717
+ uploadCompletedTotal: effect_Metric49.Metric.Counter<number>;
1718
+ uploadFailedTotal: effect_Metric49.Metric.Counter<number>;
1719
+ chunkUploadedTotal: effect_Metric49.Metric.Counter<number>;
1720
+ uploadFromUrlTotal: effect_Metric49.Metric.Counter<number>;
1721
+ uploadFromUrlSuccessTotal: effect_Metric49.Metric.Counter<number>;
1722
+ uploadFromUrlFailedTotal: effect_Metric49.Metric.Counter<number>;
1723
+ uploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1724
+ chunkUploadDurationHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1725
+ uploadFileSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1726
+ chunkSizeHistogram: effect_Metric49.Metric<effect_MetricKeyType7.MetricKeyType.Histogram, number, effect_MetricState7.MetricState.Histogram>;
1727
+ activeUploadsGauge: effect_Metric49.Metric.Gauge<number>;
1728
+ uploadThroughputGauge: effect_Metric49.Metric.Gauge<number>;
1729
+ uploadLatencySummary: effect_Metric49.Metric.Summary<number>;
1730
+ chunkLatencySummary: effect_Metric49.Metric.Summary<number>;
757
1731
  };
758
1732
  /**
759
1733
  * Validate that all required metrics exist
@@ -785,5 +1759,5 @@ declare const withChunkContext: (context: {
785
1759
  totalSize?: number;
786
1760
  }) => Effect.Effect<void, never, never>;
787
1761
  //#endregion
788
- export { AzureMetrics, AzureObservabilityLayer, AzureTracingLayer, CircuitBreakerTracingState, 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, annotateCircuitBreakerStateChange, 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, withCircuitBreakerContext, withCircuitBreakerSpan, 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 };
1762
+ export { AzureMetrics, AzureObservabilityLayer, AzureTracingLayer, BatchLogRecordProcessor, CircuitBreakerTracingState, Environment, FilesystemMetrics, FilesystemObservabilityLayer, FilesystemTracingLayer, FlowErrorCategory, FlowMetrics, FlowObservability, FlowObservabilityDisabled, FlowObservabilityLive, FlowObservabilityService, FullObservabilityConfig, GCSMetrics, GCSObservabilityLayer, GCSTracingLayer, LoggerProvider, LogsLayerConfig, LogsSdkConfig, MeterProvider, MetricsSdkConfig, MetricsService, NoOpMetricsServiceLive, NodeSdkLive, OTLPLogExporter, OTLPMetricExporter, Observability, ObservabilityDisabled, ObservabilityService, ObservabilityTestFixture, OperationDomain, OtelLogger, OtelLoggerService, OtelMeter, OtelMeterService, OtlpAutoSdkLive, OtlpExporterConfig, OtlpFullObservabilityNodeSdkLive, OtlpFullObservabilityWebSdkLive, OtlpFullObservabilityWorkersSdkLive, OtlpLogsNodeSdkLive, OtlpLogsWebSdkLive, OtlpLogsWorkersSdkLive, OtlpMetricsNodeSdkLive, OtlpMetricsWebSdkLive, OtlpMetricsWorkersSdkLive, OtlpNodeSdkLive, OtlpSdkConfig, OtlpWebSdkLive, OtlpWorkersSdkLive, PeriodicExportingMetricReader, S3Metrics, S3ObservabilityLayer, S3TracingLayer, SeverityNumber, StorageErrorCategory, StorageMetrics, StorageObservability, StorageObservabilityDisabled, StorageObservabilityService, TraceContext, TracingService, UploadErrorCategory, UploadObservability, UploadObservabilityDisabled, UploadObservabilityLive, UploadObservabilityService, UploadObservabilityTest, UploadServerMetrics, WebSdkLive, WorkersSdkLive, annotateCircuitBreakerStateChange, azureActiveUploadsGauge, azureApiCallsTotal, azureFileSizeHistogram, azureMetrics, azurePartSizeHistogram, azurePartUploadDurationHistogram, azureUploadDurationHistogram, azureUploadErrorsTotal, azureUploadLatencySummary, azureUploadPartsTotal, azureUploadRequestsTotal, azureUploadSuccessTotal, azureUploadThroughputGauge, captureMetrics, captureTraceContext, captureTraceContextEffect, classifyFlowError, classifyStorageError, classifyUploadError, createExternalSpan, createFlowMetrics, createGauge, createOtlpAutoSdkLayer, createOtlpEffectLogger, createOtlpFullObservabilityNodeSdkLayer, createOtlpFullObservabilityWebSdkLayer, createOtlpFullObservabilityWorkersSdkLayer, createOtlpLogExporter, createOtlpLoggerProvider, createOtlpLogsNodeSdkLayer, createOtlpLogsWebSdkLayer, createOtlpLogsWorkersSdkLayer, createOtlpMeterProvider, createOtlpMetricExporter, createOtlpMetricsNodeSdkLayer, createOtlpMetricsWebSdkLayer, createOtlpMetricsWorkersSdkLayer, createOtlpNodeSdkLayer, createOtlpTraceExporter, createOtlpWebSdkLayer, createOtlpWorkersSdkLayer, createStorageErrorClassifier, createStorageErrorTracker, createStorageMetrics, createStorageTracingLayer, createTestFixture, createTracingLayer, createUploadErrorClassifier, createUploadGauges, createUploadHistograms, createUploadMetrics, createUploadServerMetrics, createUploadSummaries, detectEnvironment, emitLog, 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, getLogsExportInterval, getMetricsExportInterval, getOtlpEndpoint, getServiceName, getTestMetrics, getTraceContext, getUploadMetrics, hasActiveTraceContext, isObservabilityEnabled, isOtlpExportEnabled, logAzureContext, logAzureOperation, logAzureUploadCompletion, logAzureUploadProgress, logDebug, logError, logFatal, logFilesystemContext, logFilesystemOperation, logFilesystemUploadCompletion, logFilesystemUploadProgress, logGCSContext, logGCSOperation, logGCSUploadCompletion, logGCSUploadProgress, logInfo, logS3Context, logS3Operation, logS3UploadCompletion, logS3UploadProgress, logStorageOperation, logUploadCompletion, logUploadProgress, logWarn, logWithContext, makeFlowObservabilityLayer, makeFlowObservabilityLive, makeObservabilityLayer, makeStorageObservabilityLayer, makeTestFlowObservability, makeTestFlowObservability$1 as makeTestFlowObservabilityUtil, makeTestStorageObservability, makeTestUploadObservability, makeUploadObservabilityLayer, makeUploadObservabilityLive, mapLogLevelToSeverity, parseOtlpHeaders, parseResourceAttributes, recordCounter, recordHistogram, runWithTestFlowObservability, runWithTestObservability, s3ActiveUploadsGauge, s3ApiCallsTotal, s3FileSizeHistogram, s3Metrics, s3PartSizeHistogram, s3PartUploadDurationHistogram, s3UploadDurationHistogram, s3UploadErrorsTotal, s3UploadLatencySummary, s3UploadPartsTotal, s3UploadRequestsTotal, s3UploadSuccessTotal, s3UploadThroughputGauge, severityToText, trackActiveFlow, trackActiveNode, trackAzureError, trackFileSize, trackFilesystemError, trackFlowError, trackGCSError, trackNodeError, trackPartSize, trackS3Error, trackStorageError, trackUploadError, uploadServerMetrics, validateMetricsExist, whenObservabilityEnabled, withActiveUploadTracking, withApiMetrics, withAzureApiMetrics, withAzureOperationMetrics, withAzureSpan, withAzureTimingMetrics, withAzureUploadMetrics, withChunkContext, withChunkDuration, withCircuitBreakerContext, withCircuitBreakerSpan, withExecutionContext, withFilesystemApiMetrics, withFilesystemOperationMetrics, withFilesystemSpan, withFilesystemTimingMetrics, withFilesystemUploadMetrics, withFlowContext, withFlowDuration, withFlowSpan, withGCSApiMetrics, withGCSOperationMetrics, withGCSSpan, withGCSTimingMetrics, withGCSUploadMetrics, withMetricTracking, withNodeContext, withNodeDuration, withOperationContext, withOperationSpan, withParentContext, withS3ApiMetrics, withS3OperationMetrics, withS3Span, withS3TimingMetrics, withS3UploadMetrics, withStorageOperationMetrics, withStorageSpan, withThroughputTracking, withTimingMetrics, withUploadContext, withUploadDuration, withUploadMetrics, withUploadSpan };
789
1763
  //# sourceMappingURL=index.d.cts.map