@blaxel/telemetry 0.2.17-dev.106 → 0.2.17-dev.107

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.
@@ -20,7 +20,7 @@ class OtelSpan {
20
20
  }
21
21
  setStatus(status, message) {
22
22
  this.span.setStatus({
23
- code: status === 'ok' ? api_1.SpanStatusCode.OK : api_1.SpanStatusCode.ERROR,
23
+ code: status === "ok" ? api_1.SpanStatusCode.OK : api_1.SpanStatusCode.ERROR,
24
24
  message,
25
25
  });
26
26
  }
@@ -40,12 +40,18 @@ class OtelTelemetryProvider {
40
40
  attributes: options?.attributes,
41
41
  root: options?.isRoot,
42
42
  };
43
- // Handle parent context if provided
43
+ // Handle parent context properly
44
44
  let ctx = api_1.context.active();
45
45
  if (options?.parentContext) {
46
- ctx = options.parentContext;
46
+ // If explicit parent context is provided, use it
47
+ ctx = api_1.trace.setSpanContext(api_1.ROOT_CONTEXT, options.parentContext);
47
48
  }
48
- // Start the span
49
+ else if (options?.isRoot) {
50
+ // If explicitly marked as root, use ROOT_CONTEXT
51
+ ctx = api_1.ROOT_CONTEXT;
52
+ }
53
+ // Otherwise, use the active context (default behavior)
54
+ // Start the span with proper context
49
55
  const span = tracer.startSpan(name, otelOptions, ctx);
50
56
  return new OtelSpan(span);
51
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/telemetry",
3
- "version": "0.2.17-dev.106",
3
+ "version": "0.2.17-dev.107",
4
4
  "description": "Blaxel SDK for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Blaxel, INC (https://blaxel.ai)",
@@ -71,7 +71,7 @@
71
71
  "@opentelemetry/sdk-trace-base": "^2.0.0",
72
72
  "@opentelemetry/sdk-trace-node": "^2.0.0",
73
73
  "ai": "^4.3.13",
74
- "@blaxel/core": "0.2.17-dev.106"
74
+ "@blaxel/core": "0.2.17-dev.107"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@eslint/js": "^9.26.0",