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

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.
@@ -40,8 +40,21 @@ class OtelTelemetryProvider {
40
40
  attributes: options?.attributes,
41
41
  root: options?.isRoot,
42
42
  };
43
- // Handle parent context properly
43
+ // Handle parent context properly with debugging
44
44
  let ctx = api_1.context.active();
45
+ const activeSpan = api_1.trace.getActiveSpan();
46
+ // Debug logging for context issues
47
+ if (process.env.BL_DEBUG_TRACING === "true") {
48
+ console.log(`Creating span "${name}":`, {
49
+ hasActiveSpan: !!activeSpan,
50
+ activeSpanId: activeSpan?.spanContext().spanId,
51
+ isRoot: options?.isRoot,
52
+ hasParentContext: !!options?.parentContext,
53
+ parentContext: options?.parentContext,
54
+ activeContext: ctx,
55
+ otelOptions,
56
+ });
57
+ }
45
58
  if (options?.parentContext) {
46
59
  // If explicit parent context is provided, use it
47
60
  ctx = api_1.trace.setSpanContext(api_1.ROOT_CONTEXT, options.parentContext);
@@ -53,7 +66,17 @@ class OtelTelemetryProvider {
53
66
  // Otherwise, use the active context (default behavior)
54
67
  // Start the span with proper context
55
68
  const span = tracer.startSpan(name, otelOptions, ctx);
56
- return new OtelSpan(span);
69
+ const otelSpan = new OtelSpan(span);
70
+ // Additional debugging
71
+ if (process.env.BL_DEBUG_TRACING === "true") {
72
+ const spanContext = span.spanContext();
73
+ console.log(`Created span "${name}":`, {
74
+ spanId: spanContext.spanId,
75
+ traceId: spanContext.traceId,
76
+ parentSpanId: activeSpan?.spanContext().spanId || "none",
77
+ });
78
+ }
79
+ return otelSpan;
57
80
  }
58
81
  async flush() {
59
82
  await telemetry_1.blaxelTelemetry.flush();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/telemetry",
3
- "version": "0.2.17-dev.107",
3
+ "version": "0.2.17-dev.108",
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.107"
74
+ "@blaxel/core": "0.2.17-dev.108"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@eslint/js": "^9.26.0",