@effect/opentelemetry 4.0.0-beta.7 → 4.0.0-beta.70

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.ts CHANGED
@@ -1,28 +1,147 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
  /**
5
- * @since 1.0.0
5
+ * Connects Effect's logging system to the OpenTelemetry Logs SDK.
6
+ *
7
+ * This module provides a logger provider service, an Effect `Logger` that
8
+ * emits OpenTelemetry log records, and layers for installing that logger in an
9
+ * application. It is commonly used to send Effect logs to OTLP, console, or
10
+ * vendor-specific exporters through OpenTelemetry `LogRecordProcessor`s while
11
+ * keeping logs correlated with Effect fibers and spans. Emitted records include
12
+ * the current fiber id, span identifiers when a parent span is present, log
13
+ * annotations, log spans, severity text, and the matching OpenTelemetry
14
+ * severity number.
15
+ *
16
+ * Log export depends on the configured OpenTelemetry processors and exporters;
17
+ * this module creates the provider and logger, but does not choose an exporter.
18
+ * Use the `Resource` layer to attach service and deployment metadata to the
19
+ * provider rather than repeating that data on every log record. When using
20
+ * `layerLoggerProvider`, the provider is scoped and is force-flushed and shut
21
+ * down when the layer is released, with a configurable shutdown timeout. If you
22
+ * supply or manage an OpenTelemetry provider yourself, make sure it is flushed
23
+ * and shut down during application shutdown, especially when using batching
24
+ * processors that may otherwise drop buffered logs.
25
+ *
26
+ * @since 4.0.0
6
27
  */
7
28
  export * as Logger from "./Logger.ts";
8
29
  /**
9
- * @since 1.0.0
30
+ * Bridges Effect metrics into OpenTelemetry by exposing the current Effect
31
+ * metric snapshot as an OpenTelemetry `MetricProducer` and registering it with
32
+ * one or more SDK `MetricReader`s. Use this module when an application already
33
+ * records metrics with Effect and needs those counters, gauges, histograms,
34
+ * frequencies, or summaries exported through OTLP, Prometheus, or another
35
+ * OpenTelemetry-compatible reader/exporter.
36
+ *
37
+ * The `layer` constructor is the usual entry point, and is also used by the
38
+ * Node and Web SDK layers when `metricReader` configuration is supplied. Metric
39
+ * readers are acquired inside the layer scope and shut down when the scope is
40
+ * released, so periodic exporters need the runtime to stay alive long enough to
41
+ * collect and export data. The exporter or backend determines whether
42
+ * cumulative or delta aggregation is expected; this module defaults to
43
+ * cumulative temporality and can be configured with `temporality: "delta"` for
44
+ * backends that require interval-based values.
45
+ *
46
+ * @since 4.0.0
10
47
  */
11
48
  export * as Metrics from "./Metrics.ts";
12
49
  /**
13
- * @since 1.0.0
50
+ * Provides an Effect layer for configuring OpenTelemetry in Node.js
51
+ * processes. The module wires the Effect tracer, metrics producer, and logger
52
+ * into OpenTelemetry SDK providers when span processors, metric readers, or log
53
+ * record processors are supplied, and it builds the shared resource from
54
+ * `OTEL_SERVICE_NAME`, `OTEL_RESOURCE_ATTRIBUTES`, and optional explicit
55
+ * service metadata.
56
+ *
57
+ * Use this module in Node services, workers, CLIs, or server runtimes that need
58
+ * Effect spans, metrics, and logs exported through OpenTelemetry processors and
59
+ * exporters. Telemetry is enabled only for the configured signal types, so an
60
+ * application can install tracing alone, metrics alone, logging alone, or any
61
+ * combination of them from the same layer.
62
+ *
63
+ * The layer is scoped. Tracer and logger providers are force-flushed and shut
64
+ * down when the scope is released, metric readers are shut down with the same
65
+ * lifecycle, and all shutdown waits are bounded by `shutdownTimeout` with a
66
+ * default of three seconds. Keep the layer scope alive for the lifetime of the
67
+ * process and release it during graceful shutdown so batched exporters have a
68
+ * chance to export final telemetry. When combining this layer with Node
69
+ * auto-instrumentations, register instrumentation before importing modules that
70
+ * should be patched, because many Node instrumentations hook module loading.
71
+ *
72
+ * @since 4.0.0
14
73
  */
15
74
  export * as NodeSdk from "./NodeSdk.ts";
16
75
  /**
17
- * @since 1.0.0
76
+ * Provides the OpenTelemetry resource used by the Effect OpenTelemetry layers.
77
+ *
78
+ * A resource describes the entity that produces telemetry, such as a service,
79
+ * process, deployment, or browser application. The tracing, metrics, logging,
80
+ * and SDK layers use this module's `Resource` service to configure providers
81
+ * and identify emitted telemetry with service-level metadata.
82
+ *
83
+ * Use `layer` when service metadata is known in code, `layerFromEnv` when
84
+ * deploying with `OTEL_SERVICE_NAME` and `OTEL_RESOURCE_ATTRIBUTES`, and
85
+ * `layerEmpty` when no resource attributes should be provided. Resource
86
+ * attributes are for stable process or service metadata, not per-span or
87
+ * per-log data. The explicit `layer` helper sets `service.name` and the
88
+ * `telemetry.sdk.*` attributes after merging custom attributes, so those keys
89
+ * are controlled by this integration. With `layerFromEnv`, `OTEL_SERVICE_NAME`
90
+ * overrides `service.name` from `OTEL_RESOURCE_ATTRIBUTES`, and additional
91
+ * attributes passed to the layer are merged last.
92
+ *
93
+ * @since 4.0.0
18
94
  */
19
95
  export * as Resource from "./Resource.ts";
20
96
  /**
21
- * @since 1.0.0
97
+ * Bridges Effect tracing into OpenTelemetry by installing an Effect `Tracer`
98
+ * that creates OpenTelemetry spans, records attributes, events, links, errors,
99
+ * and status, and keeps OpenTelemetry context active while traced effects run.
100
+ * Use this module when an application already has an OpenTelemetry
101
+ * `TracerProvider`, or when the Node and Web SDK layers should expose Effect
102
+ * spans to OTLP, console, or other OpenTelemetry-compatible exporters.
103
+ *
104
+ * The layer constructors wire Effect's tracer service to either the global
105
+ * OpenTelemetry tracer provider or an explicitly provided `OtelTracer`. This
106
+ * module does not create exporters or span processors by itself, so spans are
107
+ * exported only when the provider has been configured by the application or by
108
+ * the Node/Web SDK layers. Parentage is taken from Effect spans first and can
109
+ * also attach to the active OpenTelemetry context, while `makeExternalSpan` and
110
+ * `withSpanContext` are the entry points for continuing an incoming remote
111
+ * trace. Preserve `traceFlags` and `traceState` when building external spans;
112
+ * otherwise sampling defaults to sampled and trace state cannot be propagated.
113
+ *
114
+ * @since 4.0.0
22
115
  */
23
116
  export * as Tracer from "./Tracer.ts";
24
117
  /**
25
- * @since 1.0.0
118
+ * Provides an Effect layer for configuring OpenTelemetry in browser
119
+ * applications. The module builds a shared resource from explicit service
120
+ * metadata and wires Effect tracing, metrics, and logging into OpenTelemetry
121
+ * SDK providers when span processors, metric readers, or log record processors
122
+ * are supplied.
123
+ *
124
+ * Use this module in client-side applications that need Effect spans, metrics,
125
+ * and logs exported from browser runtimes, such as single-page apps,
126
+ * multi-page apps with hydrated Effect code, frontend workers, or UI flows
127
+ * that should be correlated with backend traces. Telemetry is enabled only for
128
+ * the configured signal types, so tracing, metrics, and logging can be
129
+ * installed independently from the same layer.
130
+ *
131
+ * Browser SDKs cannot rely on process environment resource configuration, so
132
+ * provide stable service metadata explicitly and use resource attributes for
133
+ * application, release, deployment, or page-shell identity rather than
134
+ * per-event data. This module does not create exporters; supply
135
+ * browser-compatible processors, readers, and exporters yourself, and make sure
136
+ * their endpoints are reachable from the browser with the required CORS and
137
+ * authentication behavior. The layer is scoped: tracer providers are
138
+ * force-flushed and shut down when the scope is released, while metric readers
139
+ * and logger providers follow their respective layer lifecycles. Keep the
140
+ * scope alive for the lifetime of the browser application and release it during
141
+ * application teardown when possible so batched exporters and periodic metric
142
+ * readers can deliver buffered telemetry before the page is unloaded.
143
+ *
144
+ * @since 4.0.0
26
145
  */
27
146
  export * as WebSdk from "./WebSdk.ts";
28
147
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC;;GAEG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA"}
package/dist/index.js CHANGED
@@ -1,29 +1,148 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
  // @barrel: Auto-generated exports. Do not edit manually.
5
5
  /**
6
- * @since 1.0.0
6
+ * Connects Effect's logging system to the OpenTelemetry Logs SDK.
7
+ *
8
+ * This module provides a logger provider service, an Effect `Logger` that
9
+ * emits OpenTelemetry log records, and layers for installing that logger in an
10
+ * application. It is commonly used to send Effect logs to OTLP, console, or
11
+ * vendor-specific exporters through OpenTelemetry `LogRecordProcessor`s while
12
+ * keeping logs correlated with Effect fibers and spans. Emitted records include
13
+ * the current fiber id, span identifiers when a parent span is present, log
14
+ * annotations, log spans, severity text, and the matching OpenTelemetry
15
+ * severity number.
16
+ *
17
+ * Log export depends on the configured OpenTelemetry processors and exporters;
18
+ * this module creates the provider and logger, but does not choose an exporter.
19
+ * Use the `Resource` layer to attach service and deployment metadata to the
20
+ * provider rather than repeating that data on every log record. When using
21
+ * `layerLoggerProvider`, the provider is scoped and is force-flushed and shut
22
+ * down when the layer is released, with a configurable shutdown timeout. If you
23
+ * supply or manage an OpenTelemetry provider yourself, make sure it is flushed
24
+ * and shut down during application shutdown, especially when using batching
25
+ * processors that may otherwise drop buffered logs.
26
+ *
27
+ * @since 4.0.0
7
28
  */
8
29
  export * as Logger from "./Logger.js";
9
30
  /**
10
- * @since 1.0.0
31
+ * Bridges Effect metrics into OpenTelemetry by exposing the current Effect
32
+ * metric snapshot as an OpenTelemetry `MetricProducer` and registering it with
33
+ * one or more SDK `MetricReader`s. Use this module when an application already
34
+ * records metrics with Effect and needs those counters, gauges, histograms,
35
+ * frequencies, or summaries exported through OTLP, Prometheus, or another
36
+ * OpenTelemetry-compatible reader/exporter.
37
+ *
38
+ * The `layer` constructor is the usual entry point, and is also used by the
39
+ * Node and Web SDK layers when `metricReader` configuration is supplied. Metric
40
+ * readers are acquired inside the layer scope and shut down when the scope is
41
+ * released, so periodic exporters need the runtime to stay alive long enough to
42
+ * collect and export data. The exporter or backend determines whether
43
+ * cumulative or delta aggregation is expected; this module defaults to
44
+ * cumulative temporality and can be configured with `temporality: "delta"` for
45
+ * backends that require interval-based values.
46
+ *
47
+ * @since 4.0.0
11
48
  */
12
49
  export * as Metrics from "./Metrics.js";
13
50
  /**
14
- * @since 1.0.0
51
+ * Provides an Effect layer for configuring OpenTelemetry in Node.js
52
+ * processes. The module wires the Effect tracer, metrics producer, and logger
53
+ * into OpenTelemetry SDK providers when span processors, metric readers, or log
54
+ * record processors are supplied, and it builds the shared resource from
55
+ * `OTEL_SERVICE_NAME`, `OTEL_RESOURCE_ATTRIBUTES`, and optional explicit
56
+ * service metadata.
57
+ *
58
+ * Use this module in Node services, workers, CLIs, or server runtimes that need
59
+ * Effect spans, metrics, and logs exported through OpenTelemetry processors and
60
+ * exporters. Telemetry is enabled only for the configured signal types, so an
61
+ * application can install tracing alone, metrics alone, logging alone, or any
62
+ * combination of them from the same layer.
63
+ *
64
+ * The layer is scoped. Tracer and logger providers are force-flushed and shut
65
+ * down when the scope is released, metric readers are shut down with the same
66
+ * lifecycle, and all shutdown waits are bounded by `shutdownTimeout` with a
67
+ * default of three seconds. Keep the layer scope alive for the lifetime of the
68
+ * process and release it during graceful shutdown so batched exporters have a
69
+ * chance to export final telemetry. When combining this layer with Node
70
+ * auto-instrumentations, register instrumentation before importing modules that
71
+ * should be patched, because many Node instrumentations hook module loading.
72
+ *
73
+ * @since 4.0.0
15
74
  */
16
75
  export * as NodeSdk from "./NodeSdk.js";
17
76
  /**
18
- * @since 1.0.0
77
+ * Provides the OpenTelemetry resource used by the Effect OpenTelemetry layers.
78
+ *
79
+ * A resource describes the entity that produces telemetry, such as a service,
80
+ * process, deployment, or browser application. The tracing, metrics, logging,
81
+ * and SDK layers use this module's `Resource` service to configure providers
82
+ * and identify emitted telemetry with service-level metadata.
83
+ *
84
+ * Use `layer` when service metadata is known in code, `layerFromEnv` when
85
+ * deploying with `OTEL_SERVICE_NAME` and `OTEL_RESOURCE_ATTRIBUTES`, and
86
+ * `layerEmpty` when no resource attributes should be provided. Resource
87
+ * attributes are for stable process or service metadata, not per-span or
88
+ * per-log data. The explicit `layer` helper sets `service.name` and the
89
+ * `telemetry.sdk.*` attributes after merging custom attributes, so those keys
90
+ * are controlled by this integration. With `layerFromEnv`, `OTEL_SERVICE_NAME`
91
+ * overrides `service.name` from `OTEL_RESOURCE_ATTRIBUTES`, and additional
92
+ * attributes passed to the layer are merged last.
93
+ *
94
+ * @since 4.0.0
19
95
  */
20
96
  export * as Resource from "./Resource.js";
21
97
  /**
22
- * @since 1.0.0
98
+ * Bridges Effect tracing into OpenTelemetry by installing an Effect `Tracer`
99
+ * that creates OpenTelemetry spans, records attributes, events, links, errors,
100
+ * and status, and keeps OpenTelemetry context active while traced effects run.
101
+ * Use this module when an application already has an OpenTelemetry
102
+ * `TracerProvider`, or when the Node and Web SDK layers should expose Effect
103
+ * spans to OTLP, console, or other OpenTelemetry-compatible exporters.
104
+ *
105
+ * The layer constructors wire Effect's tracer service to either the global
106
+ * OpenTelemetry tracer provider or an explicitly provided `OtelTracer`. This
107
+ * module does not create exporters or span processors by itself, so spans are
108
+ * exported only when the provider has been configured by the application or by
109
+ * the Node/Web SDK layers. Parentage is taken from Effect spans first and can
110
+ * also attach to the active OpenTelemetry context, while `makeExternalSpan` and
111
+ * `withSpanContext` are the entry points for continuing an incoming remote
112
+ * trace. Preserve `traceFlags` and `traceState` when building external spans;
113
+ * otherwise sampling defaults to sampled and trace state cannot be propagated.
114
+ *
115
+ * @since 4.0.0
23
116
  */
24
117
  export * as Tracer from "./Tracer.js";
25
118
  /**
26
- * @since 1.0.0
119
+ * Provides an Effect layer for configuring OpenTelemetry in browser
120
+ * applications. The module builds a shared resource from explicit service
121
+ * metadata and wires Effect tracing, metrics, and logging into OpenTelemetry
122
+ * SDK providers when span processors, metric readers, or log record processors
123
+ * are supplied.
124
+ *
125
+ * Use this module in client-side applications that need Effect spans, metrics,
126
+ * and logs exported from browser runtimes, such as single-page apps,
127
+ * multi-page apps with hydrated Effect code, frontend workers, or UI flows
128
+ * that should be correlated with backend traces. Telemetry is enabled only for
129
+ * the configured signal types, so tracing, metrics, and logging can be
130
+ * installed independently from the same layer.
131
+ *
132
+ * Browser SDKs cannot rely on process environment resource configuration, so
133
+ * provide stable service metadata explicitly and use resource attributes for
134
+ * application, release, deployment, or page-shell identity rather than
135
+ * per-event data. This module does not create exporters; supply
136
+ * browser-compatible processors, readers, and exporters yourself, and make sure
137
+ * their endpoints are reachable from the browser with the required CORS and
138
+ * authentication behavior. The layer is scoped: tracer providers are
139
+ * force-flushed and shut down when the scope is released, while metric readers
140
+ * and logger providers follow their respective layer lifecycles. Keep the
141
+ * scope alive for the lifetime of the browser application and release it during
142
+ * application teardown when possible so batched exporters and periodic metric
143
+ * readers can deliver buffered telemetry before the page is unloaded.
144
+ *
145
+ * @since 4.0.0
27
146
  */
28
147
  export * as WebSdk from "./WebSdk.js";
29
148
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Logger","Metrics","NodeSdk","Resource","Tracer","WebSdk"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;AAGA,OAAO,KAAKA,MAAM,MAAM,aAAa;AAErC;;;AAGA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;AAGA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;AAGA,OAAO,KAAKC,QAAQ,MAAM,eAAe;AAEzC;;;AAGA,OAAO,KAAKC,MAAM,MAAM,aAAa;AAErC;;;AAGA,OAAO,KAAKC,MAAM,MAAM,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Logger","Metrics","NodeSdk","Resource","Tracer","WebSdk"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,OAAO,KAAKA,MAAM,MAAM,aAAa;AAErC;;;;;;;;;;;;;;;;;;;AAmBA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;;;;;;;;;;;;;;;;;;AAoBA,OAAO,KAAKC,QAAQ,MAAM,eAAe;AAEzC;;;;;;;;;;;;;;;;;;;;AAoBA,OAAO,KAAKC,MAAM,MAAM,aAAa;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,OAAO,KAAKC,MAAM,MAAM,aAAa","ignoreList":[]}
@@ -1,4 +1,9 @@
1
1
  import * as Inspectable from "effect/Inspectable";
2
+ const bigint1e9 = /*#__PURE__*/BigInt(1_000_000_000);
3
+ /** @internal */
4
+ export const nanosToHrTime = timestamp => {
5
+ return [Number(timestamp / bigint1e9), Number(timestamp % bigint1e9)];
6
+ };
2
7
  /** @internal */
3
8
  export const recordToAttributes = record => {
4
9
  const attributes = {};
@@ -1 +1 @@
1
- {"version":3,"file":"attributes.js","names":["Inspectable","recordToAttributes","record","attributes","key","value","Object","entries","unknownToAttributeValue","toString","toStringUnknown"],"sources":["../../src/internal/attributes.ts"],"sourcesContent":[null],"mappings":"AACA,OAAO,KAAKA,WAAW,MAAM,oBAAoB;AAEjD;AACA,OAAO,MAAMC,kBAAkB,GAAIC,MAA+B,IAAqB;EACrF,MAAMC,UAAU,GAAoB,EAAE;EACtC,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,MAAM,CAAC,EAAE;IACjDC,UAAU,CAACC,GAAG,CAAC,GAAGI,uBAAuB,CAACH,KAAK,CAAC;EAClD;EACA,OAAOF,UAAU;AACnB,CAAC;AAED;AACA,OAAO,MAAMK,uBAAuB,GAAIH,KAAc,IAAyB;EAC7E,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,SAAS,EAAE;IACxF,OAAOA,KAAK;EACd,CAAC,MAAM,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACpC,OAAOA,KAAK,CAACI,QAAQ,EAAE;EACzB;EACA,OAAOT,WAAW,CAACU,eAAe,CAACL,KAAK,CAAC;AAC3C,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"attributes.js","names":["Inspectable","bigint1e9","BigInt","nanosToHrTime","timestamp","Number","recordToAttributes","record","attributes","key","value","Object","entries","unknownToAttributeValue","toString","toStringUnknown"],"sources":["../../src/internal/attributes.ts"],"sourcesContent":[null],"mappings":"AACA,OAAO,KAAKA,WAAW,MAAM,oBAAoB;AAEjD,MAAMC,SAAS,gBAAGC,MAAM,CAAC,aAAa,CAAC;AAEvC;AACA,OAAO,MAAMC,aAAa,GAAIC,SAAiB,IAAiB;EAC9D,OAAO,CAACC,MAAM,CAACD,SAAS,GAAGH,SAAS,CAAC,EAAEI,MAAM,CAACD,SAAS,GAAGH,SAAS,CAAC,CAAC;AACvE,CAAC;AAED;AACA,OAAO,MAAMK,kBAAkB,GAAIC,MAA+B,IAAqB;EACrF,MAAMC,UAAU,GAAoB,EAAE;EACtC,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,MAAM,CAAC,EAAE;IACjDC,UAAU,CAACC,GAAG,CAAC,GAAGI,uBAAuB,CAACH,KAAK,CAAC;EAClD;EACA,OAAOF,UAAU;AACnB,CAAC;AAED;AACA,OAAO,MAAMK,uBAAuB,GAAIH,KAAc,IAAyB;EAC7E,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,SAAS,EAAE;IACxF,OAAOA,KAAK;EACd,CAAC,MAAM,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACpC,OAAOA,KAAK,CAACI,QAAQ,EAAE;EACzB;EACA,OAAOd,WAAW,CAACe,eAAe,CAACL,KAAK,CAAC;AAC3C,CAAC","ignoreList":[]}
@@ -6,7 +6,7 @@ const sdkName = "@effect/opentelemetry/Metrics";
6
6
  /** @internal */
7
7
  export class MetricProducerImpl {
8
8
  resource;
9
- services;
9
+ context;
10
10
  temporality;
11
11
  startTimes;
12
12
  startTimeNanos;
@@ -15,9 +15,9 @@ export class MetricProducerImpl {
15
15
  previousHistogramState;
16
16
  previousFrequencyState;
17
17
  previousSummaryState;
18
- constructor(resource, services, temporality = "cumulative") {
18
+ constructor(resource, context, temporality = "cumulative") {
19
19
  this.resource = resource;
20
- this.services = services;
20
+ this.context = context;
21
21
  this.temporality = temporality;
22
22
  this.startTimes = new Map();
23
23
  this.startTimeNanos = currentHrTime();
@@ -35,7 +35,7 @@ export class MetricProducerImpl {
35
35
  return hrTime;
36
36
  }
37
37
  collect(_options) {
38
- const snapshot = Metric.snapshotUnsafe(this.services);
38
+ const snapshot = Metric.snapshotUnsafe(this.context);
39
39
  const hrTimeNow = currentHrTime();
40
40
  const metricData = [];
41
41
  const metricDataByName = new Map();
@@ -64,7 +64,7 @@ export class MetricProducerImpl {
64
64
  if (typeof currentCount === "bigint" && typeof previousCount === "bigint") {
65
65
  reportValue = currentCount - previousCount;
66
66
  // Handle reset: if current < previous, report current value
67
- if (reportValue < 0n) {
67
+ if (reportValue < BigInt(0)) {
68
68
  reportValue = currentCount;
69
69
  }
70
70
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.js","names":["ValueType","AggregationTemporality","DataPointType","InstrumentType","Arr","Metric","sdkName","MetricProducerImpl","resource","services","temporality","startTimes","startTimeNanos","previousExportTimeNanos","previousCounterState","previousHistogramState","previousFrequencyState","previousSummaryState","constructor","Map","currentHrTime","startTimeFor","name","hrTime","has","get","set","collect","_options","snapshot","snapshotUnsafe","hrTimeNow","metricData","metricDataByName","addMetricData","data","push","descriptor","isDelta","aggregationTemporality","DELTA","CUMULATIVE","intervalStartTime","i","len","length","state","attributes","reduce","Object","entries","acc","key","value","String","metricKey","makeMetricKey","id","type","currentCount","count","reportValue","previousCount","undefined","curr","Number","prev","descriptorFromState","startTime","dataPoint","endTime","dataPoints","dataPointType","SUM","isMonotonic","incremental","GAUGE","size","buckets","currentBuckets","boundaries","allocate","counts","idx","boundary","reportCount","reportSum","sum","reportBucketCounts","reportMin","min","reportMax","max","previousState","map","c","Math","bucketCounts","slice","HISTOGRAM","currentOccurrences","freqKey","occurrences","previousOccurrences","previousValue","quantile","quantiles","toString","countDataPoint","sumDataPoint","description","unit","COUNTER","valueType","INT","advice","DOUBLE","Promise","resolve","resourceMetrics","scopeMetrics","scope","metrics","errors","keys","sortedEntries","sort","a","b","localeCompare","JSON","stringify","now","Date","floor","time_unit","instrumentTypeFromSnapshot","determineValueType","OBSERVABLE_GAUGE","UP_DOWN_COUNTER"],"sources":["../../src/internal/metrics.ts"],"sourcesContent":[null],"mappings":"AAAA,SAAsBA,SAAS,QAAQ,oBAAoB;AAU3D,SAASC,sBAAsB,EAAEC,aAAa,EAAEC,cAAc,QAAQ,4BAA4B;AAElG,OAAO,KAAKC,GAAG,MAAM,cAAc;AACnC,OAAO,KAAKC,MAAM,MAAM,eAAe;AAIvC,MAAMC,OAAO,GAAG,+BAA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AAK,OAAO;MACV,OAAOhG,cAAc,CAACuI,gBAAgB;IACxC,KAAK,WAAW;MACd,OAAOvI,cAAc,CAAC6G,OAAO;IAC/B,KAAK,SAAS;MACZ,OAAOlE,KAAK,CAACA,KAAK,CAAC6B,WAAW,GAAGxE,cAAc,CAAC6G,OAAO,GAAG7G,cAAc,CAACwI,eAAe;IAC1F,KAAK,SAAS;MACZ,OAAOxI,cAAc,CAAC6G,OAAO;EACjC;AACF,CAAC;AAED,MAAMyB,kBAAkB,GAAI3F,KAA6B,IAAe;EACtE,IAAIA,KAAK,CAACY,IAAI,KAAK,SAAS,EAAE;IAC5B,OAAO,OAAOZ,KAAK,CAACA,KAAK,CAACc,KAAK,KAAK,QAAQ,GAAG5D,SAAS,CAACkH,GAAG,GAAGlH,SAAS,CAACoH,MAAM;EACjF,CAAC,MAAM,IAAItE,KAAK,CAACY,IAAI,KAAK,OAAO,EAAE;IACjC,OAAO,OAAOZ,KAAK,CAACA,KAAK,CAACO,KAAK,KAAK,QAAQ,GAAGrD,SAAS,CAACkH,GAAG,GAAGlH,SAAS,CAACoH,MAAM;EACjF;EACA,OAAOpH,SAAS,CAACoH,MAAM;AACzB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"metrics.js","names":["ValueType","AggregationTemporality","DataPointType","InstrumentType","Arr","Metric","sdkName","MetricProducerImpl","resource","context","temporality","startTimes","startTimeNanos","previousExportTimeNanos","previousCounterState","previousHistogramState","previousFrequencyState","previousSummaryState","constructor","Map","currentHrTime","startTimeFor","name","hrTime","has","get","set","collect","_options","snapshot","snapshotUnsafe","hrTimeNow","metricData","metricDataByName","addMetricData","data","push","descriptor","isDelta","aggregationTemporality","DELTA","CUMULATIVE","intervalStartTime","i","len","length","state","attributes","reduce","Object","entries","acc","key","value","String","metricKey","makeMetricKey","id","type","currentCount","count","reportValue","previousCount","undefined","BigInt","curr","Number","prev","descriptorFromState","startTime","dataPoint","endTime","dataPoints","dataPointType","SUM","isMonotonic","incremental","GAUGE","size","buckets","currentBuckets","boundaries","allocate","counts","idx","boundary","reportCount","reportSum","sum","reportBucketCounts","reportMin","min","reportMax","max","previousState","map","c","Math","bucketCounts","slice","HISTOGRAM","currentOccurrences","freqKey","occurrences","previousOccurrences","previousValue","quantile","quantiles","toString","countDataPoint","sumDataPoint","description","unit","COUNTER","valueType","INT","advice","DOUBLE","Promise","resolve","resourceMetrics","scopeMetrics","scope","metrics","errors","keys","sortedEntries","sort","a","b","localeCompare","JSON","stringify","now","Date","floor","time_unit","instrumentTypeFromSnapshot","determineValueType","OBSERVABLE_GAUGE","UP_DOWN_COUNTER"],"sources":["../../src/internal/metrics.ts"],"sourcesContent":[null],"mappings":"AAAA,SAAsBA,SAAS,QAAQ,oBAAoB;AAU3D,SAASC,sBAAsB,EAAEC,aAAa,EAAEC,cAAc,QAAQ,4BAA4B;AAElG,OAAO,KAAKC,GAAG,MAAM,cAAc;AAEnC,OAAO,KAAKC,MAAM,MAAM,eAAe;AAGvC,MAAMC,OAAO,GAAG,+BAA+B;AAmB/C;AACA,OAAM,MAAOC,kBAAkB;EAC7BC,QAAQ;EACRC,OAAO;EACPC,WAAW;EACXC,UAAU;EACVC,cAAc;EACdC,uBAAuB;EACvBC,oBAAoB;EACpBC,sBAAsB;EACtBC,sBAAsB;EACtBC,oBAAoB;EAEpBC,YACEV,QAA4B,EAC5BC,OAA+B,EAC/BC,WAAA,GAA6C,YAAY;IAEzD,IAAI,CAACF,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,UAAU,GAAG,IAAIQ,GAAG,EAAE;IAC3B,IAAI,CAACP,cAAc,GAAGQ,aAAa,EAAE;IACrC,IAAI,CAACP,uBAAuB,GAAG,IAAI,CAACD,cAAc;IAClD,IAAI,CAACE,oBAAoB,GAAG,IAAIK,GAAG,EAAE;IACrC,IAAI,CAACJ,sBAAsB,GAAG,IAAII,GAAG,E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K,CAACO,KAAK,KAAK,QAAQ,GAAGrD,SAAS,CAACmH,GAAG,GAAGnH,SAAS,CAACqH,MAAM;EACjF;EACA,OAAOrH,SAAS,CAACqH,MAAM;AACzB,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@effect/opentelemetry",
3
3
  "type": "module",
4
- "version": "4.0.0-beta.7",
4
+ "version": "4.0.0-beta.70",
5
5
  "license": "MIT",
6
6
  "description": "OpenTelemetry integration for Effect",
7
7
  "homepage": "https://effect.website",
@@ -55,6 +55,7 @@
55
55
  },
56
56
  "peerDependencies": {
57
57
  "@opentelemetry/api": "^1.9",
58
+ "@opentelemetry/api-logs": ">=0.203.0 <0.300.0",
58
59
  "@opentelemetry/resources": "^2.0.0",
59
60
  "@opentelemetry/sdk-logs": ">=0.203.0 <0.300.0",
60
61
  "@opentelemetry/sdk-metrics": "^2.0.0",
@@ -62,7 +63,7 @@
62
63
  "@opentelemetry/sdk-trace-node": "^2.0.0",
63
64
  "@opentelemetry/sdk-trace-web": "^2.0.0",
64
65
  "@opentelemetry/semantic-conventions": "^1.33.0",
65
- "effect": "^4.0.0-beta.7"
66
+ "effect": "^4.0.0-beta.70"
66
67
  },
67
68
  "peerDependenciesMeta": {
68
69
  "@opentelemetry/api": {
@@ -85,22 +86,26 @@
85
86
  },
86
87
  "@opentelemetry/sdk-logs": {
87
88
  "optional": true
89
+ },
90
+ "@opentelemetry/api-logs": {
91
+ "optional": true
88
92
  }
89
93
  },
90
94
  "devDependencies": {
91
- "@opentelemetry/api": "^1.9.0",
92
- "@opentelemetry/context-async-hooks": "^2.5.0",
93
- "@opentelemetry/exporter-metrics-otlp-http": "0.211.0",
94
- "@opentelemetry/exporter-prometheus": "^0.211.0",
95
- "@opentelemetry/exporter-trace-otlp-http": "^0.211.0",
96
- "@opentelemetry/otlp-exporter-base": "^0.211.0",
97
- "@opentelemetry/resources": "^2.5.0",
98
- "@opentelemetry/sdk-logs": "^0.211.0",
99
- "@opentelemetry/sdk-metrics": "^2.5.0",
100
- "@opentelemetry/sdk-trace-base": "^2.5.0",
101
- "@opentelemetry/sdk-trace-node": "^2.5.0",
102
- "@opentelemetry/sdk-trace-web": "^2.5.0",
103
- "@opentelemetry/semantic-conventions": "^1.39.0"
95
+ "@opentelemetry/api": "^1.9.1",
96
+ "@opentelemetry/api-logs": "^0.217.0",
97
+ "@opentelemetry/context-async-hooks": "^2.7.1",
98
+ "@opentelemetry/exporter-metrics-otlp-http": "0.217.0",
99
+ "@opentelemetry/exporter-prometheus": "^0.217.0",
100
+ "@opentelemetry/exporter-trace-otlp-http": "^0.217.0",
101
+ "@opentelemetry/otlp-exporter-base": "^0.217.0",
102
+ "@opentelemetry/resources": "^2.7.1",
103
+ "@opentelemetry/sdk-logs": "^0.217.0",
104
+ "@opentelemetry/sdk-metrics": "^2.7.1",
105
+ "@opentelemetry/sdk-trace-base": "^2.7.1",
106
+ "@opentelemetry/sdk-trace-node": "^2.7.1",
107
+ "@opentelemetry/sdk-trace-web": "^2.7.1",
108
+ "@opentelemetry/semantic-conventions": "^1.40.0"
104
109
  },
105
110
  "scripts": {
106
111
  "codegen": "effect-utils codegen",