@glasstrace/sdk 1.9.0 → 1.9.1
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/async-context/index.cjs +9 -4
- package/dist/async-context/index.cjs.map +1 -1
- package/dist/async-context/index.js +1 -1
- package/dist/{chunk-XEPC4NFL.js → chunk-2F2MGFLO.js} +6 -6
- package/dist/{chunk-RQ5BIWDT.js → chunk-QEXRCXSY.js} +10 -5
- package/dist/{chunk-RQ5BIWDT.js.map → chunk-QEXRCXSY.js.map} +1 -1
- package/dist/{chunk-QHV7NFON.js → chunk-QOHKZOKB.js} +48 -39
- package/dist/chunk-QOHKZOKB.js.map +1 -0
- package/dist/cli/init.cjs +4 -4
- package/dist/cli/init.js +2 -2
- package/dist/cli/mcp-add.cjs +1 -1
- package/dist/cli/mcp-add.js +1 -1
- package/dist/cli/upgrade-instructions.cjs +1 -1
- package/dist/cli/upgrade-instructions.js +1 -1
- package/dist/edge-entry.cjs +56 -42
- package/dist/edge-entry.cjs.map +1 -1
- package/dist/edge-entry.js +2 -2
- package/dist/index.cjs +5 -5
- package/dist/index.js +1 -1
- package/dist/middleware/index.cjs +47 -38
- package/dist/middleware/index.cjs.map +1 -1
- package/dist/middleware/index.d.cts +8 -0
- package/dist/middleware/index.d.ts +8 -0
- package/dist/middleware/index.js +1 -1
- package/dist/node-entry.cjs +5 -5
- package/dist/node-entry.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-QHV7NFON.js.map +0 -1
- /package/dist/{chunk-XEPC4NFL.js.map → chunk-2F2MGFLO.js.map} +0 -0
package/dist/edge-entry.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -23523,11 +23523,11 @@ function registerGlasstrace(options) {
|
|
|
23523
23523
|
setCoreState(CoreState.REGISTERING);
|
|
23524
23524
|
maybeWarnStaleAgentInstructions({
|
|
23525
23525
|
projectRoot: process.cwd(),
|
|
23526
|
-
sdkVersion: "1.9.
|
|
23526
|
+
sdkVersion: "1.9.1"
|
|
23527
23527
|
});
|
|
23528
23528
|
startRuntimeStateWriter({
|
|
23529
23529
|
projectRoot: process.cwd(),
|
|
23530
|
-
sdkVersion: "1.9.
|
|
23530
|
+
sdkVersion: "1.9.1"
|
|
23531
23531
|
});
|
|
23532
23532
|
const config2 = resolveConfig(options);
|
|
23533
23533
|
if (config2.verbose) {
|
|
@@ -23694,8 +23694,8 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
|
|
|
23694
23694
|
if (config2.verbose) {
|
|
23695
23695
|
console.info("[glasstrace] Background init firing.");
|
|
23696
23696
|
}
|
|
23697
|
-
const healthReport = collectHealthReport("1.9.
|
|
23698
|
-
const initResult = await performInit(config2, anonKeyForInit, "1.9.
|
|
23697
|
+
const healthReport = collectHealthReport("1.9.1");
|
|
23698
|
+
const initResult = await performInit(config2, anonKeyForInit, "1.9.1", healthReport);
|
|
23699
23699
|
if (generation !== registrationGeneration) return;
|
|
23700
23700
|
const currentState = getCoreState();
|
|
23701
23701
|
if (currentState === CoreState.SHUTTING_DOWN || currentState === CoreState.SHUTDOWN) {
|
|
@@ -23718,7 +23718,7 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
|
|
|
23718
23718
|
}
|
|
23719
23719
|
maybeInstallConsoleCapture();
|
|
23720
23720
|
if (didLastInitSucceed()) {
|
|
23721
|
-
startHeartbeat(config2, anonKeyForInit, "1.9.
|
|
23721
|
+
startHeartbeat(config2, anonKeyForInit, "1.9.1", generation, (newApiKey, accountId) => {
|
|
23722
23722
|
setAuthState(AuthState.CLAIMING);
|
|
23723
23723
|
emitLifecycleEvent("auth:claim_started", { accountId });
|
|
23724
23724
|
setResolvedApiKey(newApiKey);
|
package/dist/index.js
CHANGED
|
@@ -14942,49 +14942,58 @@ function tracedRequestMiddleware(options, handler) {
|
|
|
14942
14942
|
}
|
|
14943
14943
|
const wrapped = ((req, ...rest) => {
|
|
14944
14944
|
const tracer = trace.getTracer(TRACER_NAME);
|
|
14945
|
-
|
|
14946
|
-
|
|
14947
|
-
|
|
14948
|
-
|
|
14949
|
-
|
|
14945
|
+
let callbackInvoked = false;
|
|
14946
|
+
try {
|
|
14947
|
+
return tracer.startActiveSpan(options.name, (span) => {
|
|
14948
|
+
callbackInvoked = true;
|
|
14949
|
+
if (isNoopSpan(span)) {
|
|
14950
|
+
if (!_skippedUninstalledEmitted) {
|
|
14951
|
+
_skippedUninstalledEmitted = true;
|
|
14952
|
+
tryEmitLifecycleEvent("middleware:skipped_uninstalled", {});
|
|
14953
|
+
}
|
|
14954
|
+
endSpanSafely(span);
|
|
14955
|
+
return handler(req, ...rest);
|
|
14950
14956
|
}
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
|
|
14954
|
-
|
|
14955
|
-
|
|
14956
|
-
|
|
14957
|
+
try {
|
|
14958
|
+
if (options.attributes) {
|
|
14959
|
+
span.setAttributes(options.attributes);
|
|
14960
|
+
}
|
|
14961
|
+
const path = extractRequestPath(req);
|
|
14962
|
+
if (path !== void 0) {
|
|
14963
|
+
span.setAttribute(ATTR.CAUSAL_MIDDLEWARE_FOR_REQUEST, path);
|
|
14964
|
+
}
|
|
14965
|
+
} catch {
|
|
14957
14966
|
}
|
|
14958
|
-
|
|
14959
|
-
|
|
14960
|
-
|
|
14967
|
+
let result;
|
|
14968
|
+
try {
|
|
14969
|
+
result = handler(req, ...rest);
|
|
14970
|
+
} catch (error48) {
|
|
14971
|
+
recordSpanError(span, error48);
|
|
14972
|
+
endSpanSafely(span);
|
|
14973
|
+
throw error48;
|
|
14974
|
+
}
|
|
14975
|
+
if (result !== null && typeof result === "object" && typeof result.then === "function") {
|
|
14976
|
+
return result.then(
|
|
14977
|
+
(value) => {
|
|
14978
|
+
endSpanSafely(span);
|
|
14979
|
+
return value;
|
|
14980
|
+
},
|
|
14981
|
+
(error48) => {
|
|
14982
|
+
recordSpanError(span, error48);
|
|
14983
|
+
endSpanSafely(span);
|
|
14984
|
+
throw error48;
|
|
14985
|
+
}
|
|
14986
|
+
);
|
|
14961
14987
|
}
|
|
14962
|
-
} catch {
|
|
14963
|
-
}
|
|
14964
|
-
let result;
|
|
14965
|
-
try {
|
|
14966
|
-
result = handler(req, ...rest);
|
|
14967
|
-
} catch (error48) {
|
|
14968
|
-
recordSpanError(span, error48);
|
|
14969
14988
|
endSpanSafely(span);
|
|
14970
|
-
|
|
14971
|
-
}
|
|
14972
|
-
|
|
14973
|
-
|
|
14974
|
-
|
|
14975
|
-
endSpanSafely(span);
|
|
14976
|
-
return value;
|
|
14977
|
-
},
|
|
14978
|
-
(error48) => {
|
|
14979
|
-
recordSpanError(span, error48);
|
|
14980
|
-
endSpanSafely(span);
|
|
14981
|
-
throw error48;
|
|
14982
|
-
}
|
|
14983
|
-
);
|
|
14989
|
+
return result;
|
|
14990
|
+
});
|
|
14991
|
+
} catch (err) {
|
|
14992
|
+
if (callbackInvoked) {
|
|
14993
|
+
throw err;
|
|
14984
14994
|
}
|
|
14985
|
-
|
|
14986
|
-
|
|
14987
|
-
});
|
|
14995
|
+
return handler(req, ...rest);
|
|
14996
|
+
}
|
|
14988
14997
|
});
|
|
14989
14998
|
return wrapped;
|
|
14990
14999
|
}
|