@effect/opentelemetry 4.0.0-beta.67 → 4.0.0-beta.68
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/Logger.d.ts +5 -5
- package/dist/Logger.js +5 -5
- package/dist/Metrics.d.ts +4 -4
- package/dist/Metrics.js +3 -3
- package/dist/NodeSdk.d.ts +6 -6
- package/dist/NodeSdk.js +3 -3
- package/dist/Resource.d.ts +5 -5
- package/dist/Resource.js +5 -5
- package/dist/Tracer.d.ts +12 -12
- package/dist/Tracer.js +12 -12
- package/dist/WebSdk.d.ts +5 -5
- package/dist/WebSdk.js +2 -2
- package/dist/index.d.ts +119 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +119 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/Logger.ts +5 -5
- package/src/Metrics.ts +4 -4
- package/src/NodeSdk.ts +6 -6
- package/src/Resource.ts +5 -5
- package/src/Tracer.ts +12 -12
- package/src/WebSdk.ts +5 -5
- package/src/index.ts +119 -0
package/dist/index.d.ts
CHANGED
|
@@ -2,26 +2,145 @@
|
|
|
2
2
|
* @since 4.0.0
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
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
|
+
*
|
|
5
26
|
* @since 4.0.0
|
|
6
27
|
*/
|
|
7
28
|
export * as Logger from "./Logger.ts";
|
|
8
29
|
/**
|
|
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
|
+
*
|
|
9
46
|
* @since 4.0.0
|
|
10
47
|
*/
|
|
11
48
|
export * as Metrics from "./Metrics.ts";
|
|
12
49
|
/**
|
|
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
|
+
*
|
|
13
72
|
* @since 4.0.0
|
|
14
73
|
*/
|
|
15
74
|
export * as NodeSdk from "./NodeSdk.ts";
|
|
16
75
|
/**
|
|
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
|
+
*
|
|
17
93
|
* @since 4.0.0
|
|
18
94
|
*/
|
|
19
95
|
export * as Resource from "./Resource.ts";
|
|
20
96
|
/**
|
|
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
|
+
*
|
|
21
114
|
* @since 4.0.0
|
|
22
115
|
*/
|
|
23
116
|
export * as Tracer from "./Tracer.ts";
|
|
24
117
|
/**
|
|
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
|
+
*
|
|
25
144
|
* @since 4.0.0
|
|
26
145
|
*/
|
|
27
146
|
export * as WebSdk from "./WebSdk.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH
|
|
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
|
@@ -3,26 +3,145 @@
|
|
|
3
3
|
*/
|
|
4
4
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
5
5
|
/**
|
|
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
|
+
*
|
|
6
27
|
* @since 4.0.0
|
|
7
28
|
*/
|
|
8
29
|
export * as Logger from "./Logger.js";
|
|
9
30
|
/**
|
|
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
|
+
*
|
|
10
47
|
* @since 4.0.0
|
|
11
48
|
*/
|
|
12
49
|
export * as Metrics from "./Metrics.js";
|
|
13
50
|
/**
|
|
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
|
+
*
|
|
14
73
|
* @since 4.0.0
|
|
15
74
|
*/
|
|
16
75
|
export * as NodeSdk from "./NodeSdk.js";
|
|
17
76
|
/**
|
|
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
|
+
*
|
|
18
94
|
* @since 4.0.0
|
|
19
95
|
*/
|
|
20
96
|
export * as Resource from "./Resource.js";
|
|
21
97
|
/**
|
|
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
|
+
*
|
|
22
115
|
* @since 4.0.0
|
|
23
116
|
*/
|
|
24
117
|
export * as Tracer from "./Tracer.js";
|
|
25
118
|
/**
|
|
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
|
+
*
|
|
26
145
|
* @since 4.0.0
|
|
27
146
|
*/
|
|
28
147
|
export * as WebSdk from "./WebSdk.js";
|
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
|
|
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":[]}
|
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.
|
|
4
|
+
"version": "4.0.0-beta.68",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "OpenTelemetry integration for Effect",
|
|
7
7
|
"homepage": "https://effect.website",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@opentelemetry/sdk-trace-node": "^2.0.0",
|
|
64
64
|
"@opentelemetry/sdk-trace-web": "^2.0.0",
|
|
65
65
|
"@opentelemetry/semantic-conventions": "^1.33.0",
|
|
66
|
-
"effect": "^4.0.0-beta.
|
|
66
|
+
"effect": "^4.0.0-beta.68"
|
|
67
67
|
},
|
|
68
68
|
"peerDependenciesMeta": {
|
|
69
69
|
"@opentelemetry/api": {
|
package/src/Logger.ts
CHANGED
|
@@ -42,7 +42,7 @@ import { Resource } from "./Resource.ts"
|
|
|
42
42
|
/**
|
|
43
43
|
* Context service containing the OpenTelemetry `LoggerProvider` used to emit Effect log records.
|
|
44
44
|
*
|
|
45
|
-
* @category
|
|
45
|
+
* @category services
|
|
46
46
|
* @since 4.0.0
|
|
47
47
|
*/
|
|
48
48
|
export class OtelLoggerProvider extends Context.Service<
|
|
@@ -58,7 +58,7 @@ export class OtelLoggerProvider extends Context.Service<
|
|
|
58
58
|
* (e.g. Info=20000), which falls outside the OTel spec — backends that
|
|
59
59
|
* validate the field map such values to `UNSPECIFIED`.
|
|
60
60
|
*
|
|
61
|
-
* @category
|
|
61
|
+
* @category converting
|
|
62
62
|
* @since 4.0.0
|
|
63
63
|
*/
|
|
64
64
|
export const logLevelToSeverityNumber = (level: LogLevel.LogLevel): SeverityNumber => {
|
|
@@ -83,7 +83,7 @@ export const logLevelToSeverityNumber = (level: LogLevel.LogLevel): SeverityNumb
|
|
|
83
83
|
/**
|
|
84
84
|
* Creates an Effect logger that emits log records through the configured OpenTelemetry logger provider.
|
|
85
85
|
*
|
|
86
|
-
* @category
|
|
86
|
+
* @category constructors
|
|
87
87
|
* @since 4.0.0
|
|
88
88
|
*/
|
|
89
89
|
export const make: Effect.Effect<
|
|
@@ -131,7 +131,7 @@ export const make: Effect.Effect<
|
|
|
131
131
|
/**
|
|
132
132
|
* Creates a layer that installs the OpenTelemetry-backed Effect logger, merging with existing loggers by default.
|
|
133
133
|
*
|
|
134
|
-
* @category
|
|
134
|
+
* @category layers
|
|
135
135
|
* @since 4.0.0
|
|
136
136
|
*/
|
|
137
137
|
export const layer = (options: {
|
|
@@ -153,7 +153,7 @@ export const layer = (options: {
|
|
|
153
153
|
/**
|
|
154
154
|
* Creates a scoped OpenTelemetry logger provider from one or more log record processors, using the current `Resource` and flushing and shutting down the provider when the layer is released.
|
|
155
155
|
*
|
|
156
|
-
* @category
|
|
156
|
+
* @category layers
|
|
157
157
|
* @since 4.0.0
|
|
158
158
|
*/
|
|
159
159
|
export const layerLoggerProvider = (
|
package/src/Metrics.ts
CHANGED
|
@@ -37,7 +37,7 @@ import { Resource } from "./Resource.ts"
|
|
|
37
37
|
* - `delta`: Reports changes since the last export. Each interval is
|
|
38
38
|
* independent with no dependency on previous measurements.
|
|
39
39
|
*
|
|
40
|
-
* @category
|
|
40
|
+
* @category models
|
|
41
41
|
* @since 4.0.0
|
|
42
42
|
*/
|
|
43
43
|
export type TemporalityPreference = "cumulative" | "delta"
|
|
@@ -45,7 +45,7 @@ export type TemporalityPreference = "cumulative" | "delta"
|
|
|
45
45
|
/**
|
|
46
46
|
* Creates an OpenTelemetry metric producer from Effect metrics.
|
|
47
47
|
*
|
|
48
|
-
* @category
|
|
48
|
+
* @category constructors
|
|
49
49
|
* @since 4.0.0
|
|
50
50
|
*/
|
|
51
51
|
export const makeProducer = (temporality?: TemporalityPreference): Effect.Effect<MetricProducer, never, Resource> =>
|
|
@@ -58,7 +58,7 @@ export const makeProducer = (temporality?: TemporalityPreference): Effect.Effect
|
|
|
58
58
|
/**
|
|
59
59
|
* Registers a metric producer with one or more metric readers.
|
|
60
60
|
*
|
|
61
|
-
* @category
|
|
61
|
+
* @category constructors
|
|
62
62
|
* @since 4.0.0
|
|
63
63
|
*/
|
|
64
64
|
export const registerProducer = (
|
|
@@ -115,7 +115,7 @@ export const registerProducer = (
|
|
|
115
115
|
* )
|
|
116
116
|
* ```
|
|
117
117
|
*
|
|
118
|
-
* @category
|
|
118
|
+
* @category layers
|
|
119
119
|
* @since 4.0.0
|
|
120
120
|
*/
|
|
121
121
|
export const layer = (
|
package/src/NodeSdk.ts
CHANGED
|
@@ -42,7 +42,7 @@ import * as Tracer from "./Tracer.ts"
|
|
|
42
42
|
/**
|
|
43
43
|
* Configuration for the Node OpenTelemetry layer, including optional tracing, metrics, logging, resource, and shutdown settings.
|
|
44
44
|
*
|
|
45
|
-
* @category
|
|
45
|
+
* @category models
|
|
46
46
|
* @since 4.0.0
|
|
47
47
|
*/
|
|
48
48
|
export interface Configuration {
|
|
@@ -64,7 +64,7 @@ export interface Configuration {
|
|
|
64
64
|
/**
|
|
65
65
|
* Creates a scoped Node OpenTelemetry tracer provider from one or more span processors and shuts it down when the layer is released.
|
|
66
66
|
*
|
|
67
|
-
* @category
|
|
67
|
+
* @category layers
|
|
68
68
|
* @since 4.0.0
|
|
69
69
|
*/
|
|
70
70
|
export const layerTracerProvider = (
|
|
@@ -99,21 +99,21 @@ export const layerTracerProvider = (
|
|
|
99
99
|
/**
|
|
100
100
|
* Creates a Node OpenTelemetry layer from configuration, enabling tracing, metrics, and logging only when their processors or readers are supplied.
|
|
101
101
|
*
|
|
102
|
-
* @category
|
|
102
|
+
* @category layers
|
|
103
103
|
* @since 4.0.0
|
|
104
104
|
*/
|
|
105
105
|
export const layer: {
|
|
106
106
|
/**
|
|
107
107
|
* Creates a Node OpenTelemetry layer from configuration, enabling tracing, metrics, and logging only when their processors or readers are supplied.
|
|
108
108
|
*
|
|
109
|
-
* @category
|
|
109
|
+
* @category layers
|
|
110
110
|
* @since 4.0.0
|
|
111
111
|
*/
|
|
112
112
|
(evaluate: LazyArg<Configuration>): Layer.Layer<Resource.Resource>
|
|
113
113
|
/**
|
|
114
114
|
* Creates a Node OpenTelemetry layer from configuration, enabling tracing, metrics, and logging only when their processors or readers are supplied.
|
|
115
115
|
*
|
|
116
|
-
* @category
|
|
116
|
+
* @category layers
|
|
117
117
|
* @since 4.0.0
|
|
118
118
|
*/
|
|
119
119
|
<R, E>(evaluate: Effect.Effect<Configuration, E, R>): Layer.Layer<Resource.Resource, E, R>
|
|
@@ -164,7 +164,7 @@ export const layer: {
|
|
|
164
164
|
/**
|
|
165
165
|
* Layer that provides an empty OpenTelemetry `Resource`.
|
|
166
166
|
*
|
|
167
|
-
* @category
|
|
167
|
+
* @category layers
|
|
168
168
|
* @since 2.0.0
|
|
169
169
|
*/
|
|
170
170
|
export const layerEmpty: Layer.Layer<Resource.Resource> = Resource.layerEmpty
|
package/src/Resource.ts
CHANGED
|
@@ -30,7 +30,7 @@ import * as Layer from "effect/Layer"
|
|
|
30
30
|
/**
|
|
31
31
|
* Context service containing the OpenTelemetry `Resource` associated with emitted telemetry.
|
|
32
32
|
*
|
|
33
|
-
* @category
|
|
33
|
+
* @category services
|
|
34
34
|
* @since 4.0.0
|
|
35
35
|
*/
|
|
36
36
|
export class Resource extends Context.Service<
|
|
@@ -41,7 +41,7 @@ export class Resource extends Context.Service<
|
|
|
41
41
|
/**
|
|
42
42
|
* Creates a `Resource` layer from service metadata and additional OpenTelemetry attributes.
|
|
43
43
|
*
|
|
44
|
-
* @category
|
|
44
|
+
* @category layers
|
|
45
45
|
* @since 4.0.0
|
|
46
46
|
*/
|
|
47
47
|
export const layer = (config: {
|
|
@@ -57,7 +57,7 @@ export const layer = (config: {
|
|
|
57
57
|
/**
|
|
58
58
|
* Converts resource configuration into OpenTelemetry attributes, adding service name, optional service version, and telemetry SDK metadata.
|
|
59
59
|
*
|
|
60
|
-
* @category
|
|
60
|
+
* @category configuration
|
|
61
61
|
* @since 4.0.0
|
|
62
62
|
*/
|
|
63
63
|
export const configToAttributes = (options: {
|
|
@@ -82,7 +82,7 @@ export const configToAttributes = (options: {
|
|
|
82
82
|
/**
|
|
83
83
|
* Creates a `Resource` layer from OpenTelemetry environment variables, optionally merging additional attributes.
|
|
84
84
|
*
|
|
85
|
-
* @category
|
|
85
|
+
* @category layers
|
|
86
86
|
* @since 4.0.0
|
|
87
87
|
*/
|
|
88
88
|
export const layerFromEnv = (
|
|
@@ -121,7 +121,7 @@ export const layerFromEnv = (
|
|
|
121
121
|
/**
|
|
122
122
|
* Layer that provides an empty OpenTelemetry resource.
|
|
123
123
|
*
|
|
124
|
-
* @category
|
|
124
|
+
* @category layers
|
|
125
125
|
* @since 4.0.0
|
|
126
126
|
*/
|
|
127
127
|
export const layerEmpty = Layer.succeed(
|
package/src/Tracer.ts
CHANGED
|
@@ -40,7 +40,7 @@ import { Resource } from "./Resource.ts"
|
|
|
40
40
|
/**
|
|
41
41
|
* Context service containing the OpenTelemetry `Tracer` used to create spans for Effect tracing.
|
|
42
42
|
*
|
|
43
|
-
* @category
|
|
43
|
+
* @category services
|
|
44
44
|
* @since 4.0.0
|
|
45
45
|
*/
|
|
46
46
|
export class OtelTracer extends Context.Service<
|
|
@@ -51,7 +51,7 @@ export class OtelTracer extends Context.Service<
|
|
|
51
51
|
/**
|
|
52
52
|
* Context service containing the OpenTelemetry `TracerProvider` used to obtain tracers.
|
|
53
53
|
*
|
|
54
|
-
* @category
|
|
54
|
+
* @category services
|
|
55
55
|
* @since 4.0.0
|
|
56
56
|
*/
|
|
57
57
|
export class OtelTracerProvider extends Context.Service<
|
|
@@ -62,7 +62,7 @@ export class OtelTracerProvider extends Context.Service<
|
|
|
62
62
|
/**
|
|
63
63
|
* Context service containing OpenTelemetry trace flags used when constructing external span contexts.
|
|
64
64
|
*
|
|
65
|
-
* @category
|
|
65
|
+
* @category services
|
|
66
66
|
* @since 4.0.0
|
|
67
67
|
*/
|
|
68
68
|
export class OtelTraceFlags extends Context.Service<
|
|
@@ -73,7 +73,7 @@ export class OtelTraceFlags extends Context.Service<
|
|
|
73
73
|
/**
|
|
74
74
|
* Context service containing OpenTelemetry trace state used when constructing external span contexts.
|
|
75
75
|
*
|
|
76
|
-
* @category
|
|
76
|
+
* @category services
|
|
77
77
|
* @since 4.0.0
|
|
78
78
|
*/
|
|
79
79
|
export class OtelTraceState extends Context.Service<
|
|
@@ -88,7 +88,7 @@ export class OtelTraceState extends Context.Service<
|
|
|
88
88
|
/**
|
|
89
89
|
* Creates an Effect `Tracer` implementation backed by the configured OpenTelemetry tracer.
|
|
90
90
|
*
|
|
91
|
-
* @category
|
|
91
|
+
* @category constructors
|
|
92
92
|
* @since 4.0.0
|
|
93
93
|
*/
|
|
94
94
|
export const make: Effect.Effect<Tracer.Tracer, never, OtelTracer> = Effect.map(
|
|
@@ -121,7 +121,7 @@ export const make: Effect.Effect<Tracer.Tracer, never, OtelTracer> = Effect.map(
|
|
|
121
121
|
/**
|
|
122
122
|
* Creates an Effect external span from an OpenTelemetry span context, preserving trace flags and trace state when provided.
|
|
123
123
|
*
|
|
124
|
-
* @category
|
|
124
|
+
* @category constructors
|
|
125
125
|
* @since 4.0.0
|
|
126
126
|
*/
|
|
127
127
|
export const makeExternalSpan = (options: {
|
|
@@ -165,7 +165,7 @@ export const makeExternalSpan = (options: {
|
|
|
165
165
|
/**
|
|
166
166
|
* Layer that provides the current global OpenTelemetry tracer provider.
|
|
167
167
|
*
|
|
168
|
-
* @category
|
|
168
|
+
* @category layers
|
|
169
169
|
* @since 4.0.0
|
|
170
170
|
*/
|
|
171
171
|
export const layerGlobalProvider: Layer.Layer<OtelTracerProvider> = Layer.sync(
|
|
@@ -176,7 +176,7 @@ export const layerGlobalProvider: Layer.Layer<OtelTracerProvider> = Layer.sync(
|
|
|
176
176
|
/**
|
|
177
177
|
* Layer that creates an OpenTelemetry tracer from the provided tracer provider and resource metadata.
|
|
178
178
|
*
|
|
179
|
-
* @category
|
|
179
|
+
* @category layers
|
|
180
180
|
* @since 4.0.0
|
|
181
181
|
*/
|
|
182
182
|
export const layerTracer: Layer.Layer<OtelTracer, never, OtelTracerProvider | Resource> = Layer.effect(
|
|
@@ -194,7 +194,7 @@ export const layerTracer: Layer.Layer<OtelTracer, never, OtelTracerProvider | Re
|
|
|
194
194
|
/**
|
|
195
195
|
* Layer that creates an OpenTelemetry tracer from the global tracer provider and the current resource.
|
|
196
196
|
*
|
|
197
|
-
* @category
|
|
197
|
+
* @category layers
|
|
198
198
|
* @since 4.0.0
|
|
199
199
|
*/
|
|
200
200
|
export const layerGlobalTracer: Layer.Layer<OtelTracer, never, Resource> = layerTracer.pipe(
|
|
@@ -204,7 +204,7 @@ export const layerGlobalTracer: Layer.Layer<OtelTracer, never, Resource> = layer
|
|
|
204
204
|
/**
|
|
205
205
|
* Layer that installs an Effect tracer backed by the global OpenTelemetry tracer provider.
|
|
206
206
|
*
|
|
207
|
-
* @category
|
|
207
|
+
* @category layers
|
|
208
208
|
* @since 4.0.0
|
|
209
209
|
*/
|
|
210
210
|
export const layerGlobal: Layer.Layer<OtelTracer, never, Resource> = Layer.effect(Tracer.Tracer, make).pipe(
|
|
@@ -214,7 +214,7 @@ export const layerGlobal: Layer.Layer<OtelTracer, never, Resource> = Layer.effec
|
|
|
214
214
|
/**
|
|
215
215
|
* Layer that installs the Effect tracer using an `OtelTracer` already provided in the environment.
|
|
216
216
|
*
|
|
217
|
-
* @category
|
|
217
|
+
* @category layers
|
|
218
218
|
* @since 4.0.0
|
|
219
219
|
*/
|
|
220
220
|
export const layerWithoutOtelTracer: Layer.Layer<never, never, OtelTracer> = Layer.effect(Tracer.Tracer, make)
|
|
@@ -222,7 +222,7 @@ export const layerWithoutOtelTracer: Layer.Layer<never, never, OtelTracer> = Lay
|
|
|
222
222
|
/**
|
|
223
223
|
* Layer that creates an OpenTelemetry tracer from a provider and resource, then installs it as the Effect tracer.
|
|
224
224
|
*
|
|
225
|
-
* @category
|
|
225
|
+
* @category layers
|
|
226
226
|
* @since 4.0.0
|
|
227
227
|
*/
|
|
228
228
|
export const layer: Layer.Layer<OtelTracer, never, OtelTracerProvider | Resource> = layerWithoutOtelTracer.pipe(
|
package/src/WebSdk.ts
CHANGED
|
@@ -45,7 +45,7 @@ import * as Tracer from "./Tracer.ts"
|
|
|
45
45
|
/**
|
|
46
46
|
* Configuration for the Web OpenTelemetry layer, including resource metadata and optional tracing, metrics, and logging settings.
|
|
47
47
|
*
|
|
48
|
-
* @category
|
|
48
|
+
* @category models
|
|
49
49
|
* @since 4.0.0
|
|
50
50
|
*/
|
|
51
51
|
export interface Configuration {
|
|
@@ -66,7 +66,7 @@ export interface Configuration {
|
|
|
66
66
|
/**
|
|
67
67
|
* Creates a scoped Web OpenTelemetry tracer provider from one or more span processors and shuts it down when the layer is released.
|
|
68
68
|
*
|
|
69
|
-
* @category
|
|
69
|
+
* @category layers
|
|
70
70
|
* @since 4.0.0
|
|
71
71
|
*/
|
|
72
72
|
export const layerTracerProvider = (
|
|
@@ -97,21 +97,21 @@ export const layerTracerProvider = (
|
|
|
97
97
|
/**
|
|
98
98
|
* Creates a Web OpenTelemetry layer from configuration, providing the resource and enabling tracing, metrics, and logging when configured.
|
|
99
99
|
*
|
|
100
|
-
* @category
|
|
100
|
+
* @category layers
|
|
101
101
|
* @since 4.0.0
|
|
102
102
|
*/
|
|
103
103
|
export const layer: {
|
|
104
104
|
/**
|
|
105
105
|
* Creates a Web OpenTelemetry layer from configuration, providing the resource and enabling tracing, metrics, and logging when configured.
|
|
106
106
|
*
|
|
107
|
-
* @category
|
|
107
|
+
* @category layers
|
|
108
108
|
* @since 4.0.0
|
|
109
109
|
*/
|
|
110
110
|
(evaluate: LazyArg<Configuration>): Layer.Layer<Resource.Resource>
|
|
111
111
|
/**
|
|
112
112
|
* Creates a Web OpenTelemetry layer from configuration, providing the resource and enabling tracing, metrics, and logging when configured.
|
|
113
113
|
*
|
|
114
|
-
* @category
|
|
114
|
+
* @category layers
|
|
115
115
|
* @since 4.0.0
|
|
116
116
|
*/
|
|
117
117
|
<E, R>(evaluate: Effect.Effect<Configuration, E, R>): Layer.Layer<Resource.Resource, E, R>
|