@blaxel/telemetry 0.2.17-dev.109 → 0.2.17-dev.112
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/dist/telemetry.js +15 -0
- package/dist/telemetry_provider.js +7 -7
- package/package.json +2 -2
package/dist/telemetry.js
CHANGED
|
@@ -195,6 +195,21 @@ class TelemetryManager {
|
|
|
195
195
|
core_1.telemetryRegistry.registerProvider(new telemetry_provider_1.OtelTelemetryProvider());
|
|
196
196
|
const httpInstrumentation = new instrumentation_http_1.HttpInstrumentation({
|
|
197
197
|
requireParentforOutgoingSpans: true,
|
|
198
|
+
requestHook: (span, request) => {
|
|
199
|
+
// Log incoming headers for debugging
|
|
200
|
+
if ("headers" in request && request.headers) {
|
|
201
|
+
core_1.logger.debug("Incoming HTTP headers:", JSON.stringify(request.headers));
|
|
202
|
+
// Specifically log trace context headers
|
|
203
|
+
const headers = request.headers;
|
|
204
|
+
const traceHeaders = {
|
|
205
|
+
traceparent: headers.traceparent,
|
|
206
|
+
tracestate: headers.tracestate,
|
|
207
|
+
"x-blaxel-authorization": headers["x-blaxel-authorization"],
|
|
208
|
+
"x-blaxel-workspace": headers["x-blaxel-workspace"],
|
|
209
|
+
};
|
|
210
|
+
core_1.logger.debug("Trace context headers:", JSON.stringify(traceHeaders));
|
|
211
|
+
}
|
|
212
|
+
},
|
|
198
213
|
});
|
|
199
214
|
(0, instrumentation_1.registerInstrumentations)({
|
|
200
215
|
instrumentations: [httpInstrumentation],
|
|
@@ -45,15 +45,15 @@ class OtelTelemetryProvider {
|
|
|
45
45
|
let ctx = api_1.context.active();
|
|
46
46
|
const activeSpan = api_1.trace.getActiveSpan();
|
|
47
47
|
// Debug logging for context issues
|
|
48
|
-
core_1.logger.info(`Creating span "${name}":`, {
|
|
48
|
+
core_1.logger.info(`Creating span "${name}":`, JSON.stringify({
|
|
49
49
|
hasActiveSpan: !!activeSpan,
|
|
50
50
|
activeSpanId: activeSpan?.spanContext().spanId,
|
|
51
51
|
isRoot: options?.isRoot,
|
|
52
52
|
hasParentContext: !!options?.parentContext,
|
|
53
|
-
parentContext: options?.parentContext,
|
|
54
|
-
activeContext: ctx,
|
|
55
|
-
otelOptions,
|
|
56
|
-
});
|
|
53
|
+
parentContext: JSON.stringify(options?.parentContext),
|
|
54
|
+
activeContext: JSON.stringify(ctx),
|
|
55
|
+
otelOptions: JSON.stringify(otelOptions),
|
|
56
|
+
}));
|
|
57
57
|
if (options?.parentContext) {
|
|
58
58
|
// If explicit parent context is provided, use it
|
|
59
59
|
ctx = api_1.trace.setSpanContext(api_1.ROOT_CONTEXT, options.parentContext);
|
|
@@ -68,11 +68,11 @@ class OtelTelemetryProvider {
|
|
|
68
68
|
const otelSpan = new OtelSpan(span);
|
|
69
69
|
// Additional debugging
|
|
70
70
|
const spanContext = span.spanContext();
|
|
71
|
-
core_1.logger.info(`Created span "${name}":`, {
|
|
71
|
+
core_1.logger.info(`Created span "${name}":`, JSON.stringify({
|
|
72
72
|
spanId: spanContext.spanId,
|
|
73
73
|
traceId: spanContext.traceId,
|
|
74
74
|
parentSpanId: activeSpan?.spanContext().spanId || "none",
|
|
75
|
-
});
|
|
75
|
+
}));
|
|
76
76
|
return otelSpan;
|
|
77
77
|
}
|
|
78
78
|
async flush() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaxel/telemetry",
|
|
3
|
-
"version": "0.2.17-dev.
|
|
3
|
+
"version": "0.2.17-dev.112",
|
|
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.
|
|
74
|
+
"@blaxel/core": "0.2.17-dev.112"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@eslint/js": "^9.26.0",
|