@atrim/instrument-node 0.7.0-14fdea7-20260108231930 → 0.7.0-14fdea7-20260108235538
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/package.json
CHANGED
|
@@ -805,7 +805,18 @@ var AutoTracingSupervisor = class extends effect.Supervisor.AbstractSupervisor {
|
|
|
805
805
|
}
|
|
806
806
|
let parentContext = OtelApi__namespace.ROOT_CONTEXT;
|
|
807
807
|
let parentFiberId;
|
|
808
|
-
|
|
808
|
+
const maybeEffectParentSpan = effect.Context.getOption(_context, effect.Tracer.ParentSpan);
|
|
809
|
+
if (effect.Option.isSome(maybeEffectParentSpan)) {
|
|
810
|
+
const effectSpan = maybeEffectParentSpan.value;
|
|
811
|
+
const otelSpanContext = {
|
|
812
|
+
traceId: effectSpan.traceId,
|
|
813
|
+
spanId: effectSpan.spanId,
|
|
814
|
+
traceFlags: effectSpan.sampled ? OtelApi__namespace.TraceFlags.SAMPLED : OtelApi__namespace.TraceFlags.NONE,
|
|
815
|
+
isRemote: false
|
|
816
|
+
};
|
|
817
|
+
const wrappedSpan = OtelApi__namespace.trace.wrapSpanContext(otelSpanContext);
|
|
818
|
+
parentContext = OtelApi__namespace.trace.setSpan(OtelApi__namespace.ROOT_CONTEXT, wrappedSpan);
|
|
819
|
+
} else if (effect.Option.isSome(parent)) {
|
|
809
820
|
parentFiberId = parent.value.id().id;
|
|
810
821
|
const parentSpan = this.fiberSpans.get(parent.value);
|
|
811
822
|
if (parentSpan) {
|
|
@@ -816,6 +827,9 @@ var AutoTracingSupervisor = class extends effect.Supervisor.AbstractSupervisor {
|
|
|
816
827
|
} else if (this._rootSpan) {
|
|
817
828
|
parentContext = OtelApi__namespace.trace.setSpan(OtelApi__namespace.ROOT_CONTEXT, this._rootSpan);
|
|
818
829
|
}
|
|
830
|
+
if (effect.Option.isSome(parent)) {
|
|
831
|
+
parentFiberId = parent.value.id().id;
|
|
832
|
+
}
|
|
819
833
|
const span = this.tracer.startSpan(
|
|
820
834
|
spanName,
|
|
821
835
|
{
|
|
@@ -1225,7 +1239,7 @@ var createCombinedTracingLayer = () => {
|
|
|
1225
1239
|
logger.log("@atrim/auto-trace: Combined layer created");
|
|
1226
1240
|
logger.log(" - HTTP requests: auto-traced via Effect platform");
|
|
1227
1241
|
logger.log(" - Forked fibers: auto-traced via Supervisor");
|
|
1228
|
-
return effect.Layer.
|
|
1242
|
+
return supervisorLayer.pipe(effect.Layer.provideMerge(effect.Layer.discard(sdkLayer)));
|
|
1229
1243
|
})
|
|
1230
1244
|
);
|
|
1231
1245
|
};
|