@effect/opentelemetry 4.0.0-beta.66 → 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/src/Resource.ts CHANGED
@@ -1,5 +1,22 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Provides the OpenTelemetry resource used by the Effect OpenTelemetry layers.
3
+ *
4
+ * A resource describes the entity that produces telemetry, such as a service,
5
+ * process, deployment, or browser application. The tracing, metrics, logging,
6
+ * and SDK layers use this module's `Resource` service to configure providers
7
+ * and identify emitted telemetry with service-level metadata.
8
+ *
9
+ * Use `layer` when service metadata is known in code, `layerFromEnv` when
10
+ * deploying with `OTEL_SERVICE_NAME` and `OTEL_RESOURCE_ATTRIBUTES`, and
11
+ * `layerEmpty` when no resource attributes should be provided. Resource
12
+ * attributes are for stable process or service metadata, not per-span or
13
+ * per-log data. The explicit `layer` helper sets `service.name` and the
14
+ * `telemetry.sdk.*` attributes after merging custom attributes, so those keys
15
+ * are controlled by this integration. With `layerFromEnv`, `OTEL_SERVICE_NAME`
16
+ * overrides `service.name` from `OTEL_RESOURCE_ATTRIBUTES`, and additional
17
+ * attributes passed to the layer are merged last.
18
+ *
19
+ * @since 4.0.0
3
20
  */
4
21
  import type * as OtelApi from "@opentelemetry/api"
5
22
  import * as Resources from "@opentelemetry/resources"
@@ -11,8 +28,10 @@ import * as Effect from "effect/Effect"
11
28
  import * as Layer from "effect/Layer"
12
29
 
13
30
  /**
14
- * @since 1.0.0
15
- * @category Services
31
+ * Context service containing the OpenTelemetry `Resource` associated with emitted telemetry.
32
+ *
33
+ * @category services
34
+ * @since 4.0.0
16
35
  */
17
36
  export class Resource extends Context.Service<
18
37
  Resource,
@@ -20,8 +39,10 @@ export class Resource extends Context.Service<
20
39
  >()("@effect/opentelemetry/Resource") {}
21
40
 
22
41
  /**
23
- * @since 1.0.0
24
- * @category Layers
42
+ * Creates a `Resource` layer from service metadata and additional OpenTelemetry attributes.
43
+ *
44
+ * @category layers
45
+ * @since 4.0.0
25
46
  */
26
47
  export const layer = (config: {
27
48
  readonly serviceName: string
@@ -34,8 +55,10 @@ export const layer = (config: {
34
55
  )
35
56
 
36
57
  /**
37
- * @since 1.0.0
38
- * @category Configuration
58
+ * Converts resource configuration into OpenTelemetry attributes, adding service name, optional service version, and telemetry SDK metadata.
59
+ *
60
+ * @category configuration
61
+ * @since 4.0.0
39
62
  */
40
63
  export const configToAttributes = (options: {
41
64
  readonly serviceName: string
@@ -57,8 +80,10 @@ export const configToAttributes = (options: {
57
80
  }
58
81
 
59
82
  /**
60
- * @since 1.0.0
61
- * @category Layers
83
+ * Creates a `Resource` layer from OpenTelemetry environment variables, optionally merging additional attributes.
84
+ *
85
+ * @category layers
86
+ * @since 4.0.0
62
87
  */
63
88
  export const layerFromEnv = (
64
89
  additionalAttributes?:
@@ -94,8 +119,10 @@ export const layerFromEnv = (
94
119
  )
95
120
 
96
121
  /**
97
- * @since 1.0.0
98
- * @category Layers
122
+ * Layer that provides an empty OpenTelemetry resource.
123
+ *
124
+ * @category layers
125
+ * @since 4.0.0
99
126
  */
100
127
  export const layerEmpty = Layer.succeed(
101
128
  Resource,
package/src/Tracer.ts CHANGED
@@ -1,5 +1,22 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Bridges Effect tracing into OpenTelemetry by installing an Effect `Tracer`
3
+ * that creates OpenTelemetry spans, records attributes, events, links, errors,
4
+ * and status, and keeps OpenTelemetry context active while traced effects run.
5
+ * Use this module when an application already has an OpenTelemetry
6
+ * `TracerProvider`, or when the Node and Web SDK layers should expose Effect
7
+ * spans to OTLP, console, or other OpenTelemetry-compatible exporters.
8
+ *
9
+ * The layer constructors wire Effect's tracer service to either the global
10
+ * OpenTelemetry tracer provider or an explicitly provided `OtelTracer`. This
11
+ * module does not create exporters or span processors by itself, so spans are
12
+ * exported only when the provider has been configured by the application or by
13
+ * the Node/Web SDK layers. Parentage is taken from Effect spans first and can
14
+ * also attach to the active OpenTelemetry context, while `makeExternalSpan` and
15
+ * `withSpanContext` are the entry points for continuing an incoming remote
16
+ * trace. Preserve `traceFlags` and `traceState` when building external spans;
17
+ * otherwise sampling defaults to sampled and trace state cannot be propagated.
18
+ *
19
+ * @since 4.0.0
3
20
  */
4
21
  import * as Otel from "@opentelemetry/api"
5
22
  import * as OtelSemConv from "@opentelemetry/semantic-conventions"
@@ -21,8 +38,10 @@ import { Resource } from "./Resource.ts"
21
38
  // =============================================================================
22
39
 
23
40
  /**
24
- * @since 1.0.0
25
- * @category Services
41
+ * Context service containing the OpenTelemetry `Tracer` used to create spans for Effect tracing.
42
+ *
43
+ * @category services
44
+ * @since 4.0.0
26
45
  */
27
46
  export class OtelTracer extends Context.Service<
28
47
  OtelTracer,
@@ -30,8 +49,10 @@ export class OtelTracer extends Context.Service<
30
49
  >()("@effect/opentelemetry/Tracer") {}
31
50
 
32
51
  /**
33
- * @since 1.0.0
34
- * @category Services
52
+ * Context service containing the OpenTelemetry `TracerProvider` used to obtain tracers.
53
+ *
54
+ * @category services
55
+ * @since 4.0.0
35
56
  */
36
57
  export class OtelTracerProvider extends Context.Service<
37
58
  OtelTracerProvider,
@@ -39,8 +60,10 @@ export class OtelTracerProvider extends Context.Service<
39
60
  >()("@effect/opentelemetry/Tracer/OtelTracerProvider") {}
40
61
 
41
62
  /**
42
- * @since 1.0.0
43
- * @category Services
63
+ * Context service containing OpenTelemetry trace flags used when constructing external span contexts.
64
+ *
65
+ * @category services
66
+ * @since 4.0.0
44
67
  */
45
68
  export class OtelTraceFlags extends Context.Service<
46
69
  OtelTraceFlags,
@@ -48,8 +71,10 @@ export class OtelTraceFlags extends Context.Service<
48
71
  >()("@effect/opentelemetry/Tracer/OtelTraceFlags") {}
49
72
 
50
73
  /**
51
- * @since 1.0.0
52
- * @category Services
74
+ * Context service containing OpenTelemetry trace state used when constructing external span contexts.
75
+ *
76
+ * @category services
77
+ * @since 4.0.0
53
78
  */
54
79
  export class OtelTraceState extends Context.Service<
55
80
  OtelTraceState,
@@ -61,8 +86,10 @@ export class OtelTraceState extends Context.Service<
61
86
  // =============================================================================
62
87
 
63
88
  /**
64
- * @since 1.0.0
65
- * @category Constructors
89
+ * Creates an Effect `Tracer` implementation backed by the configured OpenTelemetry tracer.
90
+ *
91
+ * @category constructors
92
+ * @since 4.0.0
66
93
  */
67
94
  export const make: Effect.Effect<Tracer.Tracer, never, OtelTracer> = Effect.map(
68
95
  Effect.service(OtelTracer),
@@ -92,8 +119,10 @@ export const make: Effect.Effect<Tracer.Tracer, never, OtelTracer> = Effect.map(
92
119
  )
93
120
 
94
121
  /**
95
- * @since 1.0.0
96
- * @category Constructors
122
+ * Creates an Effect external span from an OpenTelemetry span context, preserving trace flags and trace state when provided.
123
+ *
124
+ * @category constructors
125
+ * @since 4.0.0
97
126
  */
98
127
  export const makeExternalSpan = (options: {
99
128
  readonly traceId: string
@@ -134,8 +163,10 @@ export const makeExternalSpan = (options: {
134
163
  // =============================================================================
135
164
 
136
165
  /**
137
- * @since 1.0.0
138
- * @category Layers
166
+ * Layer that provides the current global OpenTelemetry tracer provider.
167
+ *
168
+ * @category layers
169
+ * @since 4.0.0
139
170
  */
140
171
  export const layerGlobalProvider: Layer.Layer<OtelTracerProvider> = Layer.sync(
141
172
  OtelTracerProvider,
@@ -143,8 +174,10 @@ export const layerGlobalProvider: Layer.Layer<OtelTracerProvider> = Layer.sync(
143
174
  )
144
175
 
145
176
  /**
146
- * @since 1.0.0
147
- * @category Layers
177
+ * Layer that creates an OpenTelemetry tracer from the provided tracer provider and resource metadata.
178
+ *
179
+ * @category layers
180
+ * @since 4.0.0
148
181
  */
149
182
  export const layerTracer: Layer.Layer<OtelTracer, never, OtelTracerProvider | Resource> = Layer.effect(
150
183
  OtelTracer,
@@ -159,30 +192,38 @@ export const layerTracer: Layer.Layer<OtelTracer, never, OtelTracerProvider | Re
159
192
  )
160
193
 
161
194
  /**
162
- * @since 1.0.0
163
- * @category Layers
195
+ * Layer that creates an OpenTelemetry tracer from the global tracer provider and the current resource.
196
+ *
197
+ * @category layers
198
+ * @since 4.0.0
164
199
  */
165
200
  export const layerGlobalTracer: Layer.Layer<OtelTracer, never, Resource> = layerTracer.pipe(
166
201
  Layer.provide(layerGlobalProvider)
167
202
  )
168
203
 
169
204
  /**
170
- * @since 1.0.0
171
- * @category Layers
205
+ * Layer that installs an Effect tracer backed by the global OpenTelemetry tracer provider.
206
+ *
207
+ * @category layers
208
+ * @since 4.0.0
172
209
  */
173
210
  export const layerGlobal: Layer.Layer<OtelTracer, never, Resource> = Layer.effect(Tracer.Tracer, make).pipe(
174
211
  Layer.provideMerge(layerGlobalTracer)
175
212
  )
176
213
 
177
214
  /**
178
- * @since 1.0.0
179
- * @category Layers
215
+ * Layer that installs the Effect tracer using an `OtelTracer` already provided in the environment.
216
+ *
217
+ * @category layers
218
+ * @since 4.0.0
180
219
  */
181
220
  export const layerWithoutOtelTracer: Layer.Layer<never, never, OtelTracer> = Layer.effect(Tracer.Tracer, make)
182
221
 
183
222
  /**
184
- * @since 1.0.0
185
- * @category Layers
223
+ * Layer that creates an OpenTelemetry tracer from a provider and resource, then installs it as the Effect tracer.
224
+ *
225
+ * @category layers
226
+ * @since 4.0.0
186
227
  */
187
228
  export const layer: Layer.Layer<OtelTracer, never, OtelTracerProvider | Resource> = layerWithoutOtelTracer.pipe(
188
229
  Layer.provideMerge(layerTracer)
@@ -204,8 +245,8 @@ const bigint1e9 = BigInt(1_000_000_000)
204
245
  * When using OTLP, the returned span is a wrapper that conforms to the
205
246
  * OpenTelemetry `Span` interface.
206
247
  *
207
- * @since 1.0.0
208
248
  * @category accessors
249
+ * @since 4.0.0
209
250
  */
210
251
  export const currentOtelSpan: Effect.Effect<Otel.Span, Cause.NoSuchElementError> = Effect.clockWith((clock) =>
211
252
  Effect.map(Effect.currentSpan, (span) =>
@@ -307,8 +348,8 @@ const convertOtelTimeInput = (input: Otel.TimeInput | undefined, clock: Clock.Cl
307
348
  * This is handy when you set up OpenTelemetry outside of Effect and want to
308
349
  * attach to a parent span.
309
350
  *
310
- * @since 1.0.0
311
351
  * @category Propagation
352
+ * @since 4.0.0
312
353
  */
313
354
  export const withSpanContext: {
314
355
  /**
@@ -317,8 +358,8 @@ export const withSpanContext: {
317
358
  * This is handy when you set up OpenTelemetry outside of Effect and want to
318
359
  * attach to a parent span.
319
360
  *
320
- * @since 1.0.0
321
361
  * @category Propagation
362
+ * @since 4.0.0
322
363
  */
323
364
  (spanContext: Otel.SpanContext): <A, E, R>(
324
365
  self: Effect.Effect<A, E, R>
@@ -329,8 +370,8 @@ export const withSpanContext: {
329
370
  * This is handy when you set up OpenTelemetry outside of Effect and want to
330
371
  * attach to a parent span.
331
372
  *
332
- * @since 1.0.0
333
373
  * @category Propagation
374
+ * @since 4.0.0
334
375
  */
335
376
  <A, E, R>(self: Effect.Effect<A, E, R>, spanContext: Otel.SpanContext): Effect.Effect<A, E, Exclude<R, Tracer.ParentSpan>>
336
377
  } = dual(2, <A, E, R>(
package/src/WebSdk.ts CHANGED
@@ -1,5 +1,31 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Provides an Effect layer for configuring OpenTelemetry in browser
3
+ * applications. The module builds a shared resource from explicit service
4
+ * metadata and wires Effect tracing, metrics, and logging into OpenTelemetry
5
+ * SDK providers when span processors, metric readers, or log record processors
6
+ * are supplied.
7
+ *
8
+ * Use this module in client-side applications that need Effect spans, metrics,
9
+ * and logs exported from browser runtimes, such as single-page apps,
10
+ * multi-page apps with hydrated Effect code, frontend workers, or UI flows
11
+ * that should be correlated with backend traces. Telemetry is enabled only for
12
+ * the configured signal types, so tracing, metrics, and logging can be
13
+ * installed independently from the same layer.
14
+ *
15
+ * Browser SDKs cannot rely on process environment resource configuration, so
16
+ * provide stable service metadata explicitly and use resource attributes for
17
+ * application, release, deployment, or page-shell identity rather than
18
+ * per-event data. This module does not create exporters; supply
19
+ * browser-compatible processors, readers, and exporters yourself, and make sure
20
+ * their endpoints are reachable from the browser with the required CORS and
21
+ * authentication behavior. The layer is scoped: tracer providers are
22
+ * force-flushed and shut down when the scope is released, while metric readers
23
+ * and logger providers follow their respective layer lifecycles. Keep the
24
+ * scope alive for the lifetime of the browser application and release it during
25
+ * application teardown when possible so batched exporters and periodic metric
26
+ * readers can deliver buffered telemetry before the page is unloaded.
27
+ *
28
+ * @since 4.0.0
3
29
  */
4
30
  import type * as Otel from "@opentelemetry/api"
5
31
  import type { LoggerProviderConfig, LogRecordProcessor } from "@opentelemetry/sdk-logs"
@@ -17,8 +43,10 @@ import * as Resource from "./Resource.ts"
17
43
  import * as Tracer from "./Tracer.ts"
18
44
 
19
45
  /**
20
- * @since 1.0.0
21
- * @category Models
46
+ * Configuration for the Web OpenTelemetry layer, including resource metadata and optional tracing, metrics, and logging settings.
47
+ *
48
+ * @category models
49
+ * @since 4.0.0
22
50
  */
23
51
  export interface Configuration {
24
52
  readonly spanProcessor?: SpanProcessor | ReadonlyArray<SpanProcessor> | undefined
@@ -36,8 +64,10 @@ export interface Configuration {
36
64
  }
37
65
 
38
66
  /**
39
- * @since 1.0.0
40
- * @category Layers
67
+ * Creates a scoped Web OpenTelemetry tracer provider from one or more span processors and shuts it down when the layer is released.
68
+ *
69
+ * @category layers
70
+ * @since 4.0.0
41
71
  */
42
72
  export const layerTracerProvider = (
43
73
  processor: SpanProcessor | NonEmptyReadonlyArray<SpanProcessor>,
@@ -65,18 +95,24 @@ export const layerTracerProvider = (
65
95
  )
66
96
 
67
97
  /**
68
- * @since 1.0.0
69
- * @category Layers
98
+ * Creates a Web OpenTelemetry layer from configuration, providing the resource and enabling tracing, metrics, and logging when configured.
99
+ *
100
+ * @category layers
101
+ * @since 4.0.0
70
102
  */
71
103
  export const layer: {
72
104
  /**
73
- * @since 1.0.0
74
- * @category Layers
105
+ * Creates a Web OpenTelemetry layer from configuration, providing the resource and enabling tracing, metrics, and logging when configured.
106
+ *
107
+ * @category layers
108
+ * @since 4.0.0
75
109
  */
76
110
  (evaluate: LazyArg<Configuration>): Layer.Layer<Resource.Resource>
77
111
  /**
78
- * @since 1.0.0
79
- * @category Layers
112
+ * Creates a Web OpenTelemetry layer from configuration, providing the resource and enabling tracing, metrics, and logging when configured.
113
+ *
114
+ * @category layers
115
+ * @since 4.0.0
80
116
  */
81
117
  <E, R>(evaluate: Effect.Effect<Configuration, E, R>): Layer.Layer<Resource.Resource, E, R>
82
118
  } = (
package/src/index.ts CHANGED
@@ -1,35 +1,154 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
 
5
5
  // @barrel: Auto-generated exports. Do not edit manually.
6
6
 
7
7
  /**
8
- * @since 1.0.0
8
+ * Connects Effect's logging system to the OpenTelemetry Logs SDK.
9
+ *
10
+ * This module provides a logger provider service, an Effect `Logger` that
11
+ * emits OpenTelemetry log records, and layers for installing that logger in an
12
+ * application. It is commonly used to send Effect logs to OTLP, console, or
13
+ * vendor-specific exporters through OpenTelemetry `LogRecordProcessor`s while
14
+ * keeping logs correlated with Effect fibers and spans. Emitted records include
15
+ * the current fiber id, span identifiers when a parent span is present, log
16
+ * annotations, log spans, severity text, and the matching OpenTelemetry
17
+ * severity number.
18
+ *
19
+ * Log export depends on the configured OpenTelemetry processors and exporters;
20
+ * this module creates the provider and logger, but does not choose an exporter.
21
+ * Use the `Resource` layer to attach service and deployment metadata to the
22
+ * provider rather than repeating that data on every log record. When using
23
+ * `layerLoggerProvider`, the provider is scoped and is force-flushed and shut
24
+ * down when the layer is released, with a configurable shutdown timeout. If you
25
+ * supply or manage an OpenTelemetry provider yourself, make sure it is flushed
26
+ * and shut down during application shutdown, especially when using batching
27
+ * processors that may otherwise drop buffered logs.
28
+ *
29
+ * @since 4.0.0
9
30
  */
10
31
  export * as Logger from "./Logger.ts"
11
32
 
12
33
  /**
13
- * @since 1.0.0
34
+ * Bridges Effect metrics into OpenTelemetry by exposing the current Effect
35
+ * metric snapshot as an OpenTelemetry `MetricProducer` and registering it with
36
+ * one or more SDK `MetricReader`s. Use this module when an application already
37
+ * records metrics with Effect and needs those counters, gauges, histograms,
38
+ * frequencies, or summaries exported through OTLP, Prometheus, or another
39
+ * OpenTelemetry-compatible reader/exporter.
40
+ *
41
+ * The `layer` constructor is the usual entry point, and is also used by the
42
+ * Node and Web SDK layers when `metricReader` configuration is supplied. Metric
43
+ * readers are acquired inside the layer scope and shut down when the scope is
44
+ * released, so periodic exporters need the runtime to stay alive long enough to
45
+ * collect and export data. The exporter or backend determines whether
46
+ * cumulative or delta aggregation is expected; this module defaults to
47
+ * cumulative temporality and can be configured with `temporality: "delta"` for
48
+ * backends that require interval-based values.
49
+ *
50
+ * @since 4.0.0
14
51
  */
15
52
  export * as Metrics from "./Metrics.ts"
16
53
 
17
54
  /**
18
- * @since 1.0.0
55
+ * Provides an Effect layer for configuring OpenTelemetry in Node.js
56
+ * processes. The module wires the Effect tracer, metrics producer, and logger
57
+ * into OpenTelemetry SDK providers when span processors, metric readers, or log
58
+ * record processors are supplied, and it builds the shared resource from
59
+ * `OTEL_SERVICE_NAME`, `OTEL_RESOURCE_ATTRIBUTES`, and optional explicit
60
+ * service metadata.
61
+ *
62
+ * Use this module in Node services, workers, CLIs, or server runtimes that need
63
+ * Effect spans, metrics, and logs exported through OpenTelemetry processors and
64
+ * exporters. Telemetry is enabled only for the configured signal types, so an
65
+ * application can install tracing alone, metrics alone, logging alone, or any
66
+ * combination of them from the same layer.
67
+ *
68
+ * The layer is scoped. Tracer and logger providers are force-flushed and shut
69
+ * down when the scope is released, metric readers are shut down with the same
70
+ * lifecycle, and all shutdown waits are bounded by `shutdownTimeout` with a
71
+ * default of three seconds. Keep the layer scope alive for the lifetime of the
72
+ * process and release it during graceful shutdown so batched exporters have a
73
+ * chance to export final telemetry. When combining this layer with Node
74
+ * auto-instrumentations, register instrumentation before importing modules that
75
+ * should be patched, because many Node instrumentations hook module loading.
76
+ *
77
+ * @since 4.0.0
19
78
  */
20
79
  export * as NodeSdk from "./NodeSdk.ts"
21
80
 
22
81
  /**
23
- * @since 1.0.0
82
+ * Provides the OpenTelemetry resource used by the Effect OpenTelemetry layers.
83
+ *
84
+ * A resource describes the entity that produces telemetry, such as a service,
85
+ * process, deployment, or browser application. The tracing, metrics, logging,
86
+ * and SDK layers use this module's `Resource` service to configure providers
87
+ * and identify emitted telemetry with service-level metadata.
88
+ *
89
+ * Use `layer` when service metadata is known in code, `layerFromEnv` when
90
+ * deploying with `OTEL_SERVICE_NAME` and `OTEL_RESOURCE_ATTRIBUTES`, and
91
+ * `layerEmpty` when no resource attributes should be provided. Resource
92
+ * attributes are for stable process or service metadata, not per-span or
93
+ * per-log data. The explicit `layer` helper sets `service.name` and the
94
+ * `telemetry.sdk.*` attributes after merging custom attributes, so those keys
95
+ * are controlled by this integration. With `layerFromEnv`, `OTEL_SERVICE_NAME`
96
+ * overrides `service.name` from `OTEL_RESOURCE_ATTRIBUTES`, and additional
97
+ * attributes passed to the layer are merged last.
98
+ *
99
+ * @since 4.0.0
24
100
  */
25
101
  export * as Resource from "./Resource.ts"
26
102
 
27
103
  /**
28
- * @since 1.0.0
104
+ * Bridges Effect tracing into OpenTelemetry by installing an Effect `Tracer`
105
+ * that creates OpenTelemetry spans, records attributes, events, links, errors,
106
+ * and status, and keeps OpenTelemetry context active while traced effects run.
107
+ * Use this module when an application already has an OpenTelemetry
108
+ * `TracerProvider`, or when the Node and Web SDK layers should expose Effect
109
+ * spans to OTLP, console, or other OpenTelemetry-compatible exporters.
110
+ *
111
+ * The layer constructors wire Effect's tracer service to either the global
112
+ * OpenTelemetry tracer provider or an explicitly provided `OtelTracer`. This
113
+ * module does not create exporters or span processors by itself, so spans are
114
+ * exported only when the provider has been configured by the application or by
115
+ * the Node/Web SDK layers. Parentage is taken from Effect spans first and can
116
+ * also attach to the active OpenTelemetry context, while `makeExternalSpan` and
117
+ * `withSpanContext` are the entry points for continuing an incoming remote
118
+ * trace. Preserve `traceFlags` and `traceState` when building external spans;
119
+ * otherwise sampling defaults to sampled and trace state cannot be propagated.
120
+ *
121
+ * @since 4.0.0
29
122
  */
30
123
  export * as Tracer from "./Tracer.ts"
31
124
 
32
125
  /**
33
- * @since 1.0.0
126
+ * Provides an Effect layer for configuring OpenTelemetry in browser
127
+ * applications. The module builds a shared resource from explicit service
128
+ * metadata and wires Effect tracing, metrics, and logging into OpenTelemetry
129
+ * SDK providers when span processors, metric readers, or log record processors
130
+ * are supplied.
131
+ *
132
+ * Use this module in client-side applications that need Effect spans, metrics,
133
+ * and logs exported from browser runtimes, such as single-page apps,
134
+ * multi-page apps with hydrated Effect code, frontend workers, or UI flows
135
+ * that should be correlated with backend traces. Telemetry is enabled only for
136
+ * the configured signal types, so tracing, metrics, and logging can be
137
+ * installed independently from the same layer.
138
+ *
139
+ * Browser SDKs cannot rely on process environment resource configuration, so
140
+ * provide stable service metadata explicitly and use resource attributes for
141
+ * application, release, deployment, or page-shell identity rather than
142
+ * per-event data. This module does not create exporters; supply
143
+ * browser-compatible processors, readers, and exporters yourself, and make sure
144
+ * their endpoints are reachable from the browser with the required CORS and
145
+ * authentication behavior. The layer is scoped: tracer providers are
146
+ * force-flushed and shut down when the scope is released, while metric readers
147
+ * and logger providers follow their respective layer lifecycles. Keep the
148
+ * scope alive for the lifetime of the browser application and release it during
149
+ * application teardown when possible so batched exporters and periodic metric
150
+ * readers can deliver buffered telemetry before the page is unloaded.
151
+ *
152
+ * @since 4.0.0
34
153
  */
35
154
  export * as WebSdk from "./WebSdk.ts"