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

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/Tracer.d.ts CHANGED
@@ -1,49 +1,78 @@
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 Cause from "effect/Cause";
23
+ import * as Context from "effect/Context";
6
24
  import * as Effect from "effect/Effect";
7
25
  import * as Layer from "effect/Layer";
8
- import * as ServiceMap from "effect/ServiceMap";
9
26
  import * as Tracer from "effect/Tracer";
10
27
  import { Resource } from "./Resource.ts";
11
- declare const OtelTracer_base: ServiceMap.ServiceClass<OtelTracer, "@effect/opentelemetry/Tracer", Otel.Tracer>;
28
+ declare const OtelTracer_base: Context.ServiceClass<OtelTracer, "@effect/opentelemetry/Tracer", Otel.Tracer>;
12
29
  /**
13
- * @since 1.0.0
14
- * @category Services
30
+ * Context service containing the OpenTelemetry `Tracer` used to create spans for Effect tracing.
31
+ *
32
+ * @category services
33
+ * @since 4.0.0
15
34
  */
16
35
  export declare class OtelTracer extends OtelTracer_base {
17
36
  }
18
- declare const OtelTracerProvider_base: ServiceMap.ServiceClass<OtelTracerProvider, "@effect/opentelemetry/Tracer/OtelTracerProvider", Otel.TracerProvider>;
37
+ declare const OtelTracerProvider_base: Context.ServiceClass<OtelTracerProvider, "@effect/opentelemetry/Tracer/OtelTracerProvider", Otel.TracerProvider>;
19
38
  /**
20
- * @since 1.0.0
21
- * @category Services
39
+ * Context service containing the OpenTelemetry `TracerProvider` used to obtain tracers.
40
+ *
41
+ * @category services
42
+ * @since 4.0.0
22
43
  */
23
44
  export declare class OtelTracerProvider extends OtelTracerProvider_base {
24
45
  }
25
- declare const OtelTraceFlags_base: ServiceMap.ServiceClass<OtelTraceFlags, "@effect/opentelemetry/Tracer/OtelTraceFlags", Otel.TraceFlags>;
46
+ declare const OtelTraceFlags_base: Context.ServiceClass<OtelTraceFlags, "@effect/opentelemetry/Tracer/OtelTraceFlags", Otel.TraceFlags>;
26
47
  /**
27
- * @since 1.0.0
28
- * @category Services
48
+ * Context service containing OpenTelemetry trace flags used when constructing external span contexts.
49
+ *
50
+ * @category services
51
+ * @since 4.0.0
29
52
  */
30
53
  export declare class OtelTraceFlags extends OtelTraceFlags_base {
31
54
  }
32
- declare const OtelTraceState_base: ServiceMap.ServiceClass<OtelTraceState, "@effect/opentelemetry/Tracer/OtelTraceState", Otel.TraceState>;
55
+ declare const OtelTraceState_base: Context.ServiceClass<OtelTraceState, "@effect/opentelemetry/Tracer/OtelTraceState", Otel.TraceState>;
33
56
  /**
34
- * @since 1.0.0
35
- * @category Services
57
+ * Context service containing OpenTelemetry trace state used when constructing external span contexts.
58
+ *
59
+ * @category services
60
+ * @since 4.0.0
36
61
  */
37
62
  export declare class OtelTraceState extends OtelTraceState_base {
38
63
  }
39
64
  /**
40
- * @since 1.0.0
41
- * @category Constructors
65
+ * Creates an Effect `Tracer` implementation backed by the configured OpenTelemetry tracer.
66
+ *
67
+ * @category constructors
68
+ * @since 4.0.0
42
69
  */
43
70
  export declare const make: Effect.Effect<Tracer.Tracer, never, OtelTracer>;
44
71
  /**
45
- * @since 1.0.0
46
- * @category Constructors
72
+ * Creates an Effect external span from an OpenTelemetry span context, preserving trace flags and trace state when provided.
73
+ *
74
+ * @category constructors
75
+ * @since 4.0.0
47
76
  */
48
77
  export declare const makeExternalSpan: (options: {
49
78
  readonly traceId: string;
@@ -52,76 +81,105 @@ export declare const makeExternalSpan: (options: {
52
81
  readonly traceState?: string | Otel.TraceState | undefined;
53
82
  }) => Tracer.ExternalSpan;
54
83
  /**
55
- * @since 1.0.0
56
- * @category Layers
84
+ * Layer that provides the current global OpenTelemetry tracer provider.
85
+ *
86
+ * @category layers
87
+ * @since 4.0.0
57
88
  */
58
89
  export declare const layerGlobalProvider: Layer.Layer<OtelTracerProvider>;
59
90
  /**
60
- * @since 1.0.0
61
- * @category Layers
91
+ * Layer that creates an OpenTelemetry tracer from the provided tracer provider and resource metadata.
92
+ *
93
+ * @category layers
94
+ * @since 4.0.0
62
95
  */
63
96
  export declare const layerTracer: Layer.Layer<OtelTracer, never, OtelTracerProvider | Resource>;
64
97
  /**
65
- * @since 1.0.0
66
- * @category Layers
98
+ * Layer that creates an OpenTelemetry tracer from the global tracer provider and the current resource.
99
+ *
100
+ * @category layers
101
+ * @since 4.0.0
67
102
  */
68
103
  export declare const layerGlobalTracer: Layer.Layer<OtelTracer, never, Resource>;
69
104
  /**
70
- * @since 1.0.0
71
- * @category Layers
105
+ * Layer that installs an Effect tracer backed by the global OpenTelemetry tracer provider.
106
+ *
107
+ * @category layers
108
+ * @since 4.0.0
72
109
  */
73
110
  export declare const layerGlobal: Layer.Layer<OtelTracer, never, Resource>;
74
111
  /**
75
- * @since 1.0.0
76
- * @category Layers
112
+ * Layer that installs the Effect tracer using an `OtelTracer` already provided in the environment.
113
+ *
114
+ * @category layers
115
+ * @since 4.0.0
77
116
  */
78
117
  export declare const layerWithoutOtelTracer: Layer.Layer<never, never, OtelTracer>;
79
118
  /**
80
- * @since 1.0.0
81
- * @category Layers
119
+ * Layer that creates an OpenTelemetry tracer from a provider and resource, then installs it as the Effect tracer.
120
+ *
121
+ * **When to use**
122
+ *
123
+ * Use when your application already supplies an `OtelTracerProvider` and a
124
+ * `Resource`, and you want Effect spans to be created by an OpenTelemetry
125
+ * tracer derived from those services.
126
+ *
127
+ * @see {@link layerTracer} for creating only the OpenTelemetry tracer service
128
+ * @see {@link layerGlobal} for installing the Effect tracer from the global provider
129
+ * @see {@link layerWithoutOtelTracer} for installing an already-provided `OtelTracer`
130
+ *
131
+ * @category layers
132
+ * @since 4.0.0
82
133
  */
83
134
  export declare const layer: Layer.Layer<OtelTracer, never, OtelTracerProvider | Resource>;
84
135
  /**
85
- * Get the current OpenTelemetry span.
136
+ * Gets the current OpenTelemetry span.
86
137
  *
87
- * Works with both the official OpenTelemetry API (via `Tracer.layer`,
88
- * `NodeSdk.layer`, etc.) and the lightweight OTLP module (`OtlpTracer.layer`).
138
+ * **Details**
89
139
  *
90
- * When using OTLP, the returned span is a wrapper that conforms to the
91
- * OpenTelemetry `Span` interface.
140
+ * This accessor works with both the official OpenTelemetry API, such as
141
+ * `Tracer.layer` and `NodeSdk.layer`, and the lightweight OTLP module, such as
142
+ * `OtlpTracer.layer`. When using OTLP, the returned span is a wrapper that
143
+ * conforms to the OpenTelemetry `Span` interface.
92
144
  *
93
- * @since 1.0.0
94
145
  * @category accessors
146
+ * @since 4.0.0
95
147
  */
96
148
  export declare const currentOtelSpan: Effect.Effect<Otel.Span, Cause.NoSuchElementError>;
97
149
  /**
98
- * Set the effect's parent span from the given opentelemetry `SpanContext`.
150
+ * Sets an effect's parent span from the given OpenTelemetry `SpanContext`.
151
+ *
152
+ * **When to use**
99
153
  *
100
- * This is handy when you set up OpenTelemetry outside of Effect and want to
101
- * attach to a parent span.
154
+ * Use when OpenTelemetry instrumentation outside Effect has already
155
+ * produced a parent span context and an effect should continue that trace.
102
156
  *
103
- * @since 1.0.0
104
- * @category Propagation
157
+ * @category propagation
158
+ * @since 4.0.0
105
159
  */
106
160
  export declare const withSpanContext: {
107
161
  /**
108
- * Set the effect's parent span from the given opentelemetry `SpanContext`.
162
+ * Sets an effect's parent span from the given OpenTelemetry `SpanContext`.
109
163
  *
110
- * This is handy when you set up OpenTelemetry outside of Effect and want to
111
- * attach to a parent span.
164
+ * **When to use**
112
165
  *
113
- * @since 1.0.0
114
- * @category Propagation
166
+ * Use when OpenTelemetry instrumentation outside Effect has already
167
+ * produced a parent span context and an effect should continue that trace.
168
+ *
169
+ * @category propagation
170
+ * @since 4.0.0
115
171
  */
116
172
  (spanContext: Otel.SpanContext): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Tracer.ParentSpan>>;
117
173
  /**
118
- * Set the effect's parent span from the given opentelemetry `SpanContext`.
174
+ * Sets an effect's parent span from the given OpenTelemetry `SpanContext`.
175
+ *
176
+ * **When to use**
119
177
  *
120
- * This is handy when you set up OpenTelemetry outside of Effect and want to
121
- * attach to a parent span.
178
+ * Use when OpenTelemetry instrumentation outside Effect has already
179
+ * produced a parent span context and an effect should continue that trace.
122
180
  *
123
- * @since 1.0.0
124
- * @category Propagation
181
+ * @category propagation
182
+ * @since 4.0.0
125
183
  */
126
184
  <A, E, R>(self: Effect.Effect<A, E, R>, spanContext: Otel.SpanContext): Effect.Effect<A, E, Exclude<R, Tracer.ParentSpan>>;
127
185
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Tracer.d.ts","sourceRoot":"","sources":["../src/Tracer.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,IAAI,MAAM,oBAAoB,CAAA;AAE1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;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ing 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";
6
23
  import * as Cause from "effect/Cause";
24
+ import * as Context from "effect/Context";
7
25
  import * as Effect from "effect/Effect";
8
26
  import * as Exit from "effect/Exit";
9
27
  import { constTrue, dual } from "effect/Function";
10
28
  import * as Layer from "effect/Layer";
29
+ import * as Option from "effect/Option";
11
30
  import * as Predicate from "effect/Predicate";
12
- import * as ServiceMap from "effect/ServiceMap";
13
31
  import * as Tracer from "effect/Tracer";
14
- import { recordToAttributes, unknownToAttributeValue } from "./internal/attributes.js";
32
+ import { nanosToHrTime, recordToAttributes, unknownToAttributeValue } from "./internal/attributes.js";
15
33
  import { Resource } from "./Resource.js";
16
34
  // =============================================================================
17
35
  // Service Definitions
18
36
  // =============================================================================
19
37
  /**
20
- * @since 1.0.0
21
- * @category Services
38
+ * Context service containing the OpenTelemetry `Tracer` used to create spans for Effect tracing.
39
+ *
40
+ * @category services
41
+ * @since 4.0.0
22
42
  */
23
- export class OtelTracer extends /*#__PURE__*/ServiceMap.Service()("@effect/opentelemetry/Tracer") {}
43
+ export class OtelTracer extends /*#__PURE__*/Context.Service()("@effect/opentelemetry/Tracer") {}
24
44
  /**
25
- * @since 1.0.0
26
- * @category Services
45
+ * Context service containing the OpenTelemetry `TracerProvider` used to obtain tracers.
46
+ *
47
+ * @category services
48
+ * @since 4.0.0
27
49
  */
28
- export class OtelTracerProvider extends /*#__PURE__*/ServiceMap.Service()("@effect/opentelemetry/Tracer/OtelTracerProvider") {}
50
+ export class OtelTracerProvider extends /*#__PURE__*/Context.Service()("@effect/opentelemetry/Tracer/OtelTracerProvider") {}
29
51
  /**
30
- * @since 1.0.0
31
- * @category Services
52
+ * Context service containing OpenTelemetry trace flags used when constructing external span contexts.
53
+ *
54
+ * @category services
55
+ * @since 4.0.0
32
56
  */
33
- export class OtelTraceFlags extends /*#__PURE__*/ServiceMap.Service()("@effect/opentelemetry/Tracer/OtelTraceFlags") {}
57
+ export class OtelTraceFlags extends /*#__PURE__*/Context.Service()("@effect/opentelemetry/Tracer/OtelTraceFlags") {}
34
58
  /**
35
- * @since 1.0.0
36
- * @category Services
59
+ * Context service containing OpenTelemetry trace state used when constructing external span contexts.
60
+ *
61
+ * @category services
62
+ * @since 4.0.0
37
63
  */
38
- export class OtelTraceState extends /*#__PURE__*/ServiceMap.Service()("@effect/opentelemetry/Tracer/OtelTraceState") {}
64
+ export class OtelTraceState extends /*#__PURE__*/Context.Service()("@effect/opentelemetry/Tracer/OtelTraceState") {}
39
65
  // =============================================================================
40
66
  // Constructors
41
67
  // =============================================================================
42
68
  /**
43
- * @since 1.0.0
44
- * @category Constructors
69
+ * Creates an Effect `Tracer` implementation backed by the configured OpenTelemetry tracer.
70
+ *
71
+ * @category constructors
72
+ * @since 4.0.0
45
73
  */
46
74
  export const make = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.service(OtelTracer), tracer => Tracer.make({
47
75
  span(options) {
@@ -56,24 +84,28 @@ export const make = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.service(OtelTrac
56
84
  }
57
85
  }));
58
86
  /**
59
- * @since 1.0.0
60
- * @category Constructors
87
+ * Creates an Effect external span from an OpenTelemetry span context, preserving trace flags and trace state when provided.
88
+ *
89
+ * @category constructors
90
+ * @since 4.0.0
61
91
  */
62
92
  export const makeExternalSpan = options => {
63
- let annotations = ServiceMap.empty();
64
- if (options.traceFlags !== undefined) {
65
- annotations = ServiceMap.add(annotations, OtelTraceFlags, options.traceFlags);
66
- }
67
- if (typeof options.traceState === "string") {
68
- try {
69
- const traceState = Otel.createTraceState(options.traceState);
70
- annotations = ServiceMap.add(annotations, OtelTraceState, traceState);
71
- } catch {
72
- //
93
+ const annotations = Context.mutate(Context.empty(), annotations => {
94
+ let next = annotations;
95
+ if (options.traceFlags !== undefined) {
96
+ next = Context.add(next, OtelTraceFlags, options.traceFlags);
73
97
  }
74
- } else if (options.traceState) {
75
- annotations = ServiceMap.add(annotations, OtelTraceState, options.traceState);
76
- }
98
+ if (typeof options.traceState === "string") {
99
+ try {
100
+ next = Context.add(next, OtelTraceState, Otel.createTraceState(options.traceState));
101
+ } catch {
102
+ //
103
+ }
104
+ } else if (options.traceState) {
105
+ next = Context.add(next, OtelTraceState, options.traceState);
106
+ }
107
+ return next;
108
+ });
77
109
  return {
78
110
  _tag: "ExternalSpan",
79
111
  traceId: options.traceId,
@@ -86,13 +118,17 @@ export const makeExternalSpan = options => {
86
118
  // Layers
87
119
  // =============================================================================
88
120
  /**
89
- * @since 1.0.0
90
- * @category Layers
121
+ * Layer that provides the current global OpenTelemetry tracer provider.
122
+ *
123
+ * @category layers
124
+ * @since 4.0.0
91
125
  */
92
126
  export const layerGlobalProvider = /*#__PURE__*/Layer.sync(OtelTracerProvider, () => Otel.trace.getTracerProvider());
93
127
  /**
94
- * @since 1.0.0
95
- * @category Layers
128
+ * Layer that creates an OpenTelemetry tracer from the provided tracer provider and resource metadata.
129
+ *
130
+ * @category layers
131
+ * @since 4.0.0
96
132
  */
97
133
  export const layerTracer = /*#__PURE__*/Layer.effect(OtelTracer, /*#__PURE__*/Effect.gen(function* () {
98
134
  const resource = yield* Resource;
@@ -100,23 +136,41 @@ export const layerTracer = /*#__PURE__*/Layer.effect(OtelTracer, /*#__PURE__*/Ef
100
136
  return provider.getTracer(resource.attributes[OtelSemConv.ATTR_SERVICE_NAME], resource.attributes[OtelSemConv.ATTR_SERVICE_VERSION]);
101
137
  }));
102
138
  /**
103
- * @since 1.0.0
104
- * @category Layers
139
+ * Layer that creates an OpenTelemetry tracer from the global tracer provider and the current resource.
140
+ *
141
+ * @category layers
142
+ * @since 4.0.0
105
143
  */
106
144
  export const layerGlobalTracer = /*#__PURE__*/layerTracer.pipe(/*#__PURE__*/Layer.provide(layerGlobalProvider));
107
145
  /**
108
- * @since 1.0.0
109
- * @category Layers
146
+ * Layer that installs an Effect tracer backed by the global OpenTelemetry tracer provider.
147
+ *
148
+ * @category layers
149
+ * @since 4.0.0
110
150
  */
111
151
  export const layerGlobal = /*#__PURE__*/Layer.effect(Tracer.Tracer, make).pipe(/*#__PURE__*/Layer.provideMerge(layerGlobalTracer));
112
152
  /**
113
- * @since 1.0.0
114
- * @category Layers
153
+ * Layer that installs the Effect tracer using an `OtelTracer` already provided in the environment.
154
+ *
155
+ * @category layers
156
+ * @since 4.0.0
115
157
  */
116
158
  export const layerWithoutOtelTracer = /*#__PURE__*/Layer.effect(Tracer.Tracer, make);
117
159
  /**
118
- * @since 1.0.0
119
- * @category Layers
160
+ * Layer that creates an OpenTelemetry tracer from a provider and resource, then installs it as the Effect tracer.
161
+ *
162
+ * **When to use**
163
+ *
164
+ * Use when your application already supplies an `OtelTracerProvider` and a
165
+ * `Resource`, and you want Effect spans to be created by an OpenTelemetry
166
+ * tracer derived from those services.
167
+ *
168
+ * @see {@link layerTracer} for creating only the OpenTelemetry tracer service
169
+ * @see {@link layerGlobal} for installing the Effect tracer from the global provider
170
+ * @see {@link layerWithoutOtelTracer} for installing an already-provided `OtelTracer`
171
+ *
172
+ * @category layers
173
+ * @since 4.0.0
120
174
  */
121
175
  export const layer = /*#__PURE__*/layerWithoutOtelTracer.pipe(/*#__PURE__*/Layer.provideMerge(layerTracer));
122
176
  // =============================================================================
@@ -125,16 +179,17 @@ export const layer = /*#__PURE__*/layerWithoutOtelTracer.pipe(/*#__PURE__*/Layer
125
179
  const bigint1e6 = /*#__PURE__*/BigInt(1_000_000);
126
180
  const bigint1e9 = /*#__PURE__*/BigInt(1_000_000_000);
127
181
  /**
128
- * Get the current OpenTelemetry span.
182
+ * Gets the current OpenTelemetry span.
129
183
  *
130
- * Works with both the official OpenTelemetry API (via `Tracer.layer`,
131
- * `NodeSdk.layer`, etc.) and the lightweight OTLP module (`OtlpTracer.layer`).
184
+ * **Details**
132
185
  *
133
- * When using OTLP, the returned span is a wrapper that conforms to the
134
- * OpenTelemetry `Span` interface.
186
+ * This accessor works with both the official OpenTelemetry API, such as
187
+ * `Tracer.layer` and `NodeSdk.layer`, and the lightweight OTLP module, such as
188
+ * `OtlpTracer.layer`. When using OTLP, the returned span is a wrapper that
189
+ * conforms to the OpenTelemetry `Span` interface.
135
190
  *
136
- * @since 1.0.0
137
191
  * @category accessors
192
+ * @since 4.0.0
138
193
  */
139
194
  export const currentOtelSpan = /*#__PURE__*/Effect.clockWith(clock => Effect.map(Effect.currentSpan, span => OtelSpanTypeId in span ? span.span : makeOtelSpan(span, clock)));
140
195
  const makeOtelSpan = (span, clock) => {
@@ -219,13 +274,15 @@ const convertOtelTimeInput = (input, clock) => {
219
274
  return BigInt(seconds) * bigint1e9 + BigInt(nanos);
220
275
  };
221
276
  /**
222
- * Set the effect's parent span from the given opentelemetry `SpanContext`.
277
+ * Sets an effect's parent span from the given OpenTelemetry `SpanContext`.
223
278
  *
224
- * This is handy when you set up OpenTelemetry outside of Effect and want to
225
- * attach to a parent span.
279
+ * **When to use**
226
280
  *
227
- * @since 1.0.0
228
- * @category Propagation
281
+ * Use when OpenTelemetry instrumentation outside Effect has already
282
+ * produced a parent span context and an effect should continue that trace.
283
+ *
284
+ * @category propagation
285
+ * @since 4.0.0
229
286
  */
230
287
  export const withSpanContext = /*#__PURE__*/dual(2, (self, spanContext) => Effect.withParentSpan(self, makeExternalSpan(spanContext)));
231
288
  // =============================================================================
@@ -261,7 +318,7 @@ export class OtelSpan {
261
318
  this.links = options.links;
262
319
  this.kind = options.kind;
263
320
  const active = contextApi.active();
264
- this.parent = options.parent ?? options?.root !== true ? getOtelParent(traceApi, active, options.annotations) : undefined;
321
+ this.parent = options.root !== true ? Option.orElse(options.parent, () => getOtelParent(traceApi, active, options.annotations)) : options.parent;
265
322
  this.span = tracer.startSpan(options.name, {
266
323
  startTime: nanosToHrTime(options.startTime),
267
324
  links: options.links.length > 0 ? options.links.map(link => ({
@@ -269,7 +326,7 @@ export class OtelSpan {
269
326
  attributes: recordToAttributes(link.attributes)
270
327
  })) : undefined,
271
328
  kind: kindMap[this.kind]
272
- }, this.parent ? populateContext(active, this.parent, options.annotations) : Otel.trace.deleteSpan(active));
329
+ }, Option.isSome(this.parent) ? populateContext(active, this.parent.value, options.annotations) : Otel.trace.deleteSpan(active));
273
330
  const spanContext = this.span.spanContext();
274
331
  this.spanId = spanContext.spanId;
275
332
  this.traceId = spanContext.traceId;
@@ -336,18 +393,15 @@ export class OtelSpan {
336
393
  }
337
394
  }
338
395
  const isSampled = traceFlags => (traceFlags & Otel.TraceFlags.SAMPLED) === Otel.TraceFlags.SAMPLED;
339
- const nanosToHrTime = timestamp => {
340
- return [Number(timestamp / bigint1e9), Number(timestamp % bigint1e9)];
341
- };
342
396
  const getOtelParent = (tracer, context, annotations) => {
343
- const active = tracer.getSpan(context);
344
- const otelParent = active ? active.spanContext() : undefined;
345
- return otelParent ? Tracer.externalSpan({
397
+ const otelParent = tracer.getSpan(context)?.spanContext();
398
+ if (!otelParent) return Option.none();
399
+ return Option.some(Tracer.externalSpan({
346
400
  spanId: otelParent.spanId,
347
401
  traceId: otelParent.traceId,
348
402
  sampled: (otelParent.traceFlags & 1) === 1,
349
403
  annotations
350
- }) : undefined;
404
+ }));
351
405
  };
352
406
  const makeSpanContext = (span, annotations) => {
353
407
  const traceFlags = makeTraceFlags(span, annotations);
@@ -365,7 +419,7 @@ const makeTraceFlags = (span, annotations) => {
365
419
  if (Predicate.isNotUndefined(annotations)) {
366
420
  traceFlags = extractTraceService(span, annotations, OtelTraceFlags);
367
421
  if (Predicate.isUndefined(traceFlags)) {
368
- traceFlags = ServiceMap.getOrUndefined(span.annotations, OtelTraceFlags);
422
+ traceFlags = Context.getOrUndefined(span.annotations, OtelTraceFlags);
369
423
  }
370
424
  }
371
425
  return traceFlags ?? Otel.TraceFlags.SAMPLED;
@@ -375,17 +429,17 @@ const makeTraceState = (span, annotations) => {
375
429
  if (Predicate.isNotUndefined(annotations)) {
376
430
  traceState = extractTraceService(span, annotations, OtelTraceState);
377
431
  if (Predicate.isUndefined(traceState)) {
378
- traceState = ServiceMap.getOrUndefined(span.annotations, OtelTraceState);
432
+ traceState = Context.getOrUndefined(span.annotations, OtelTraceState);
379
433
  }
380
434
  }
381
435
  return traceState;
382
436
  };
383
437
  const extractTraceService = (parent, annotations, service) => {
384
- const instance = ServiceMap.getOrUndefined(annotations, service);
438
+ const instance = Context.getOrUndefined(annotations, service);
385
439
  if (Predicate.isNotUndefined(instance)) {
386
440
  return instance;
387
441
  }
388
- return ServiceMap.getOrUndefined(parent.annotations, service);
442
+ return Context.getOrUndefined(parent.annotations, service);
389
443
  };
390
444
  const populateContext = (context, span, annotations) => span instanceof OtelSpan ? Otel.trace.setSpan(context, span.span) : Otel.trace.setSpanContext(context, makeSpanContext(span, annotations));
391
445
  //# sourceMappingURL=Tracer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tracer.js","names":["Otel","OtelSemConv","Cause","Effect","Exit","constTrue","dual","Layer","Predicate","ServiceMap","Tracer","recordToAttributes","unknownToAttributeValue","Resource","OtelTracer","Service","OtelTracerProvider","OtelTraceFlags","OtelTraceState","make","map","service","tracer","span","options","OtelSpan","context","trace","primitive","fiber","currentSpan","undefined","with","populateContext","active","makeExternalSpan","annotations","empty","traceFlags","add","traceState","createTraceState","_tag","traceId","spanId","sampled","isNotUndefined","isSampled","layerGlobalProvider","sync","getTracerProvider","layerTracer","effect","gen","resource","provider","getTracer","attributes","ATTR_SERVICE_NAME","ATTR_SERVICE_VERSION","layerGlobalTracer","pipe","provide","layerGlobal","provideMerge","layerWithoutOtelTracer","layer","bigint1e6","BigInt","bigint1e9","currentOtelSpan","clockWith","clock","OtelSpanTypeId","makeOtelSpan","spanContext","TraceFlags","SAMPLED","NONE","isRemote","exit","void","self","setAttribute","key","value","attribute","setAttributes","Object","entries","addEvent","name","startTime","arguments","length","event","convertOtelTimeInput","addLink","link","addLinks","links","setStatus","status","SpanStatusCode","ERROR","die","message","updateName","end","endTime","time","isRecording","recordException","exception","timeInput","cause","fail","error","prettyErrors","stack","input","currentTimeNanosUnsafe","Math","round","Date","getTime","seconds","nanos","withSpanContext","withParentSpan","kindMap","SpanKind","INTERNAL","CLIENT","SERVER","PRODUCER","CONSUMER","kind","Map","parent","constructor","contextApi","traceApi","root","getOtelParent","startSpan","nanosToHrTime","makeSpanContext","deleteSpan","set","push","hrTime","code","OK","hasInterruptsOnly","pretty","errors","timestamp","Number","getSpan","otelParent","externalSpan","makeTraceFlags","makeTraceState","extractTraceService","isUndefined","getOrUndefined","instance","setSpan","setSpanContext"],"sources":["../src/Tracer.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,IAAI,MAAM,oBAAoB;AAC1C,OAAO,KAAKC,WAAW,MAAM,qCAAqC;AAClE,OAAO,KAAKC,KAAK,MAAM,cAAc;AAErC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,IAAI,MAAM,aAAa;AACnC,SAASC,SAAS,EAAEC,IAAI,QAAQ,iBAAiB;AACjD,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,SAAS,MAAM,kBAAkB;AAC7C,OAAO,KAAK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a,WAAW,EAAElB,cAAc,CAAC;IAC1E;EACF;EACA,OAAOsB,UAAU;AACnB,CAAC;AAED,MAAM4H,mBAAmB,GAAGA,CAC1BzB,MAAsB,EACtBvG,WAAyC,EACzCf,OAAiC,KAC/B;EACF,MAAMkJ,QAAQ,GAAG9J,UAAU,CAAC6J,cAAc,CAAClI,WAAW,EAAEf,OAAO,CAAC;EAChE,IAAIb,SAAS,CAACsC,cAAc,CAACyH,QAAQ,CAAC,EAAE;IACtC,OAAOA,QAAQ;EACjB;EACA,OAAO9J,UAAU,CAAC6J,cAAc,CAAC3B,MAAM,CAACvG,WAAW,EAAEf,OAAO,CAAC;AAC/D,CAAC;AAED,MAAMY,eAAe,GAAGA,CACtBP,OAAqB,EACrBH,IAAoB,EACpBa,WAAsD,KAEtDb,IAAI,YAAYE,QAAQ,GACtBzB,IAAI,CAAC2B,KAAK,CAAC6I,OAAO,CAAC9I,OAAO,EAAEH,IAAI,CAACA,IAAI,CAAC,GACtCvB,IAAI,CAAC2B,KAAK,CAAC8I,cAAc,CAAC/I,OAAO,EAAEyH,eAAe,CAAC5H,IAAI,EAAEa,WAAW,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Tracer.js","names":["Otel","OtelSemConv","Cause","Context","Effect","Exit","constTrue","dual","Layer","Option","Predicate","Tracer","nanosToHrTime","recordToAttributes","unknownToAttributeValue","Resource","OtelTracer","Service","OtelTracerProvider","OtelTraceFlags","OtelTraceState","make","map","service","tracer","span","options","OtelSpan","context","trace","primitive","fiber","currentSpan","undefined","with","populateContext","active","makeExternalSpan","annotations","mutate","empty","next","traceFlags","add","traceState","createTraceState","_tag","traceId","spanId","sampled","isNotUndefined","isSampled","layerGlobalProvider","sync","getTracerProvider","layerTracer","effect","gen","resource","provider","getTracer","attributes","ATTR_SERVICE_NAME","ATTR_SERVICE_VERSION","layerGlobalTracer","pipe","provide","layerGlobal","provideMerge","layerWithoutOtelTracer","layer","bigint1e6","BigInt","bigint1e9","currentOtelSpan","clockWith","clock","OtelSpanTypeId","makeOtelSpan","spanContext","TraceFlags","SAMPLED","NONE","isRemote","exit","void","self","setAttribute","key","value","attribute","setAttributes","Object","entries","addEvent","name","startTime","arguments","length","event","convertOtelTimeInput","addLink","link","addLinks","links","setStatus","status","SpanStatusCode","ERROR","die","message","updateName","end","endTime","time","isRecording","recordException","exception","timeInput","cause","fail","error","prettyErrors","stack","input","currentTimeNanosUnsafe","Math","round","Date","getTime","seconds","nanos","withSpanContext","withParentSpan","kindMap","SpanKind","INTERNAL","CLIENT","SERVER","PRODUCER","CONSUMER","kind","Map","parent","constructor","contextApi","traceApi","root","orElse","getOtelParent","startSpan","makeSpanContext","isSome","deleteSpan","set","push","hrTime","code","OK","hasInterruptsOnly","pretty","errors","otelParent","getSpan","none","some","externalSpan","makeTraceFlags","makeTraceState","extractTraceService","isUndefined","getOrUndefined","instance","setSpan","setSpanContext"],"sources":["../src/Tracer.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;AAoBA,OAAO,KAAKA,IAAI,MAAM,oBAAoB;AAC1C,OAAO,KAAKC,WAAW,MAAM,qCAAqC;AAClE,OAAO,KAAKC,KAAK,MAAM,cAAc;AAErC,OAAO,KAAKC,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,IAAI,MAAM,aAAa;AACnC,SAASC,SAAS,EAAEC,IAAI,QAAQ,iBAAiB;AACjD,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,SAAS,MAAM,kBAAkB;AAC7C,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,SAASC,aAAa,EAAEC,kBAAkB,EAAEC,uBAAuB,QAAQ,0BAA0B;AACrG,SAASC,QAAQ,QAAQ,eAAe;AAExC;AACA;AACA;AAEA;;;;;;AAMA,OAAM,MAAOC,UAAW,sBAAQb,OAAO,CAACc,O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