@atrim/instrument-node 0.7.1-dev.14fdea7.20260108232056 → 0.7.1-dev.14fdea7.20260108232436

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atrim/instrument-node",
3
- "version": "0.7.1-dev.14fdea7.20260108232056",
3
+ "version": "0.7.1-dev.14fdea7.20260108232436",
4
4
  "description": "OpenTelemetry instrumentation for Node.js with centralized YAML configuration",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -810,11 +810,21 @@ var AutoTracingSupervisor = class extends effect.Supervisor.AbstractSupervisor {
810
810
  const parentSpan = this.fiberSpans.get(parent.value);
811
811
  if (parentSpan) {
812
812
  parentContext = OtelApi__namespace.trace.setSpan(OtelApi__namespace.ROOT_CONTEXT, parentSpan);
813
+ } else {
814
+ const activeSpan = OtelApi__namespace.trace.getSpan(OtelApi__namespace.context.active());
815
+ if (activeSpan) {
816
+ parentContext = OtelApi__namespace.context.active();
817
+ } else if (this._rootSpan) {
818
+ parentContext = OtelApi__namespace.trace.setSpan(OtelApi__namespace.ROOT_CONTEXT, this._rootSpan);
819
+ }
820
+ }
821
+ } else {
822
+ const activeSpan = OtelApi__namespace.trace.getSpan(OtelApi__namespace.context.active());
823
+ if (activeSpan) {
824
+ parentContext = OtelApi__namespace.context.active();
813
825
  } else if (this._rootSpan) {
814
826
  parentContext = OtelApi__namespace.trace.setSpan(OtelApi__namespace.ROOT_CONTEXT, this._rootSpan);
815
827
  }
816
- } else if (this._rootSpan) {
817
- parentContext = OtelApi__namespace.trace.setSpan(OtelApi__namespace.ROOT_CONTEXT, this._rootSpan);
818
828
  }
819
829
  const span = this.tracer.startSpan(
820
830
  spanName,
@@ -1225,7 +1235,7 @@ var createCombinedTracingLayer = () => {
1225
1235
  logger.log("@atrim/auto-trace: Combined layer created");
1226
1236
  logger.log(" - HTTP requests: auto-traced via Effect platform");
1227
1237
  logger.log(" - Forked fibers: auto-traced via Supervisor");
1228
- return effect.Layer.mergeAll(effect.Layer.discard(sdkLayer), supervisorLayer);
1238
+ return supervisorLayer.pipe(effect.Layer.provideMerge(effect.Layer.discard(sdkLayer)));
1229
1239
  })
1230
1240
  );
1231
1241
  };