@glasstrace/sdk 0.13.4 → 0.13.5
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/index.cjs +5 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -20744,25 +20744,11 @@ async function configureOtel(config2, sessionManager) {
|
|
|
20744
20744
|
|
|
20745
20745
|
// src/context-manager.ts
|
|
20746
20746
|
init_cjs_shims();
|
|
20747
|
+
var import_node_async_hooks = require("async_hooks");
|
|
20747
20748
|
init_esm();
|
|
20748
|
-
var AsyncLocalStorageCtor = null;
|
|
20749
|
-
try {
|
|
20750
|
-
const importFn = Function("id", "return import(id)");
|
|
20751
|
-
importFn("node:async_hooks").then(
|
|
20752
|
-
(mod) => {
|
|
20753
|
-
AsyncLocalStorageCtor = mod.AsyncLocalStorage;
|
|
20754
|
-
},
|
|
20755
|
-
() => {
|
|
20756
|
-
}
|
|
20757
|
-
);
|
|
20758
|
-
} catch {
|
|
20759
|
-
}
|
|
20760
20749
|
function installContextManager() {
|
|
20761
|
-
if (!AsyncLocalStorageCtor) {
|
|
20762
|
-
return false;
|
|
20763
|
-
}
|
|
20764
20750
|
try {
|
|
20765
|
-
const als = new
|
|
20751
|
+
const als = new import_node_async_hooks.AsyncLocalStorage();
|
|
20766
20752
|
const contextManager = {
|
|
20767
20753
|
active: () => als.getStore() ?? ROOT_CONTEXT,
|
|
20768
20754
|
with: (context2, fn, thisArg, ...args) => als.run(context2, () => fn.apply(thisArg, args)),
|
|
@@ -21064,8 +21050,8 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
|
|
|
21064
21050
|
if (config2.verbose) {
|
|
21065
21051
|
console.info("[glasstrace] Background init firing.");
|
|
21066
21052
|
}
|
|
21067
|
-
const healthReport = collectHealthReport("0.13.
|
|
21068
|
-
const initResult = await performInit(config2, anonKeyForInit, "0.13.
|
|
21053
|
+
const healthReport = collectHealthReport("0.13.5");
|
|
21054
|
+
const initResult = await performInit(config2, anonKeyForInit, "0.13.5", healthReport);
|
|
21069
21055
|
if (generation !== registrationGeneration) return;
|
|
21070
21056
|
if (initResult?.claimResult) {
|
|
21071
21057
|
setResolvedApiKey(initResult.claimResult.newApiKey);
|
|
@@ -21073,7 +21059,7 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
|
|
|
21073
21059
|
}
|
|
21074
21060
|
maybeInstallConsoleCapture();
|
|
21075
21061
|
if (didLastInitSucceed()) {
|
|
21076
|
-
startHeartbeat(config2, anonKeyForInit, "0.13.
|
|
21062
|
+
startHeartbeat(config2, anonKeyForInit, "0.13.5", generation, (newApiKey) => {
|
|
21077
21063
|
setResolvedApiKey(newApiKey);
|
|
21078
21064
|
notifyApiKeyResolved();
|
|
21079
21065
|
});
|