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

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.
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OtelTelemetryProvider = void 0;
4
4
  const api_1 = require("@opentelemetry/api");
5
5
  const telemetry_1 = require("./telemetry");
6
+ const core_1 = require("@blaxel/core");
6
7
  class OtelSpan {
7
8
  span;
8
9
  constructor(span) {
@@ -44,17 +45,15 @@ class OtelTelemetryProvider {
44
45
  let ctx = api_1.context.active();
45
46
  const activeSpan = api_1.trace.getActiveSpan();
46
47
  // 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
- }
48
+ core_1.logger.info(`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
+ });
58
57
  if (options?.parentContext) {
59
58
  // If explicit parent context is provided, use it
60
59
  ctx = api_1.trace.setSpanContext(api_1.ROOT_CONTEXT, options.parentContext);
@@ -68,14 +67,12 @@ class OtelTelemetryProvider {
68
67
  const span = tracer.startSpan(name, otelOptions, ctx);
69
68
  const otelSpan = new OtelSpan(span);
70
69
  // 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
- }
70
+ const spanContext = span.spanContext();
71
+ core_1.logger.info(`Created span "${name}":`, {
72
+ spanId: spanContext.spanId,
73
+ traceId: spanContext.traceId,
74
+ parentSpanId: activeSpan?.spanContext().spanId || "none",
75
+ });
79
76
  return otelSpan;
80
77
  }
81
78
  async flush() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/telemetry",
3
- "version": "0.2.17-dev.108",
3
+ "version": "0.2.17-dev.109",
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.108"
74
+ "@blaxel/core": "0.2.17-dev.109"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@eslint/js": "^9.26.0",