@blaxel/telemetry 0.2.17-dev.110 → 0.2.17-dev.113
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 +22 -0
- package/dist/telemetry_provider.js +2 -0
- package/package.json +2 -2
package/dist/telemetry.js
CHANGED
|
@@ -195,6 +195,28 @@ 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
|
+
// Log the span context that was created from the incoming request
|
|
212
|
+
const spanContext = span.spanContext();
|
|
213
|
+
core_1.logger.debug("HTTP span context:", {
|
|
214
|
+
traceId: spanContext.traceId,
|
|
215
|
+
spanId: spanContext.spanId,
|
|
216
|
+
traceFlags: spanContext.traceFlags,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
},
|
|
198
220
|
});
|
|
199
221
|
(0, instrumentation_1.registerInstrumentations)({
|
|
200
222
|
instrumentations: [httpInstrumentation],
|
|
@@ -53,6 +53,8 @@ class OtelTelemetryProvider {
|
|
|
53
53
|
parentContext: JSON.stringify(options?.parentContext),
|
|
54
54
|
activeContext: JSON.stringify(ctx),
|
|
55
55
|
otelOptions: JSON.stringify(otelOptions),
|
|
56
|
+
activeTraceId: activeSpan?.spanContext().traceId,
|
|
57
|
+
contextKeys: Object.keys(ctx),
|
|
56
58
|
}));
|
|
57
59
|
if (options?.parentContext) {
|
|
58
60
|
// If explicit parent context is provided, use it
|
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.113",
|
|
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.113"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@eslint/js": "^9.26.0",
|