@glasstrace/sdk 0.12.5 → 0.13.0
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/chunk-RFSCWIVN.js +242 -0
- package/dist/chunk-RFSCWIVN.js.map +1 -0
- package/dist/cli/init.cjs +489 -306
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.js +76 -265
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/status.cjs +162 -0
- package/dist/cli/status.cjs.map +1 -0
- package/dist/cli/status.d.cts +34 -0
- package/dist/cli/status.d.ts +34 -0
- package/dist/cli/status.js +127 -0
- package/dist/cli/status.js.map +1 -0
- package/dist/index.cjs +4 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -23
- package/dist/index.js.map +1 -1
- package/dist/monorepo-7SBKH7RP.js +15 -0
- package/dist/monorepo-7SBKH7RP.js.map +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -17357,7 +17357,6 @@ var GlasstraceExporter = class {
|
|
|
17357
17357
|
environment;
|
|
17358
17358
|
endpointUrl;
|
|
17359
17359
|
createDelegateFn;
|
|
17360
|
-
verbose;
|
|
17361
17360
|
delegate = null;
|
|
17362
17361
|
delegateKey = null;
|
|
17363
17362
|
pendingBatches = [];
|
|
@@ -17370,7 +17369,6 @@ var GlasstraceExporter = class {
|
|
|
17370
17369
|
this.environment = options.environment;
|
|
17371
17370
|
this.endpointUrl = options.endpointUrl;
|
|
17372
17371
|
this.createDelegateFn = options.createDelegate;
|
|
17373
|
-
this.verbose = options.verbose ?? false;
|
|
17374
17372
|
}
|
|
17375
17373
|
export(spans, resultCallback) {
|
|
17376
17374
|
const currentKey = this.getApiKey();
|
|
@@ -17379,16 +17377,11 @@ var GlasstraceExporter = class {
|
|
|
17379
17377
|
return;
|
|
17380
17378
|
}
|
|
17381
17379
|
const enrichedSpans = spans.map((span) => this.enrichSpan(span));
|
|
17382
|
-
if (this.verbose) {
|
|
17383
|
-
sdkLog("info", `[glasstrace:diag] Export batch: ${enrichedSpans.length} spans`);
|
|
17384
|
-
}
|
|
17385
17380
|
const exporter = this.ensureDelegate();
|
|
17386
17381
|
if (exporter) {
|
|
17387
17382
|
exporter.export(enrichedSpans, (result) => {
|
|
17388
17383
|
if (result.code !== 0) {
|
|
17389
17384
|
sdkLog("warn", `[glasstrace] Span export failed: ${result.error?.message ?? "unknown error"}`);
|
|
17390
|
-
} else if (this.verbose) {
|
|
17391
|
-
sdkLog("info", `[glasstrace:diag] Export success: ${enrichedSpans.length} spans delivered`);
|
|
17392
17385
|
}
|
|
17393
17386
|
resultCallback(result);
|
|
17394
17387
|
});
|
|
@@ -17575,17 +17568,11 @@ var GlasstraceExporter = class {
|
|
|
17575
17568
|
bufferSpans(spans, resultCallback) {
|
|
17576
17569
|
this.pendingBatches.push({ spans, resultCallback });
|
|
17577
17570
|
this.pendingSpanCount += spans.length;
|
|
17578
|
-
if (this.verbose) {
|
|
17579
|
-
sdkLog("info", `[glasstrace:diag] Buffering ${spans.length} spans (key pending, total: ${this.pendingSpanCount})`);
|
|
17580
|
-
}
|
|
17581
17571
|
while (this.pendingSpanCount > MAX_PENDING_SPANS && this.pendingBatches.length > 1) {
|
|
17582
17572
|
const evicted = this.pendingBatches.shift();
|
|
17583
17573
|
this.pendingSpanCount -= evicted.spans.length;
|
|
17584
17574
|
recordSpansDropped(evicted.spans.length);
|
|
17585
17575
|
evicted.resultCallback({ code: 0 });
|
|
17586
|
-
if (this.verbose) {
|
|
17587
|
-
sdkLog("info", `[glasstrace:diag] Buffer overflow: evicted ${evicted.spans.length} spans (total pending: ${this.pendingSpanCount})`);
|
|
17588
|
-
}
|
|
17589
17576
|
if (!this.overflowLogged) {
|
|
17590
17577
|
this.overflowLogged = true;
|
|
17591
17578
|
console.warn(
|
|
@@ -17624,8 +17611,6 @@ var GlasstraceExporter = class {
|
|
|
17624
17611
|
exporter.export(enriched, (result) => {
|
|
17625
17612
|
if (result.code !== 0) {
|
|
17626
17613
|
sdkLog("warn", `[glasstrace] Span export failed: ${result.error?.message ?? "unknown error"}`);
|
|
17627
|
-
} else if (this.verbose) {
|
|
17628
|
-
sdkLog("info", `[glasstrace:diag] Flush export success: ${enriched.length} spans delivered`);
|
|
17629
17614
|
}
|
|
17630
17615
|
batch.resultCallback(result);
|
|
17631
17616
|
});
|
|
@@ -20425,8 +20410,7 @@ async function configureOtel(config2, sessionManager) {
|
|
|
20425
20410
|
getConfig: () => getActiveConfig(),
|
|
20426
20411
|
environment: config2.environment,
|
|
20427
20412
|
endpointUrl: exporterUrl,
|
|
20428
|
-
createDelegate: createOtlpExporter
|
|
20429
|
-
verbose: config2.verbose
|
|
20413
|
+
createDelegate: createOtlpExporter
|
|
20430
20414
|
});
|
|
20431
20415
|
_activeExporter = glasstraceExporter;
|
|
20432
20416
|
const vercelOtel = await tryImport("@vercel/otel");
|
|
@@ -20469,9 +20453,6 @@ async function configureOtel(config2, sessionManager) {
|
|
|
20469
20453
|
const processor = new BatchSpanProcessor(glasstraceExporter, {
|
|
20470
20454
|
scheduledDelayMillis: 1e3
|
|
20471
20455
|
});
|
|
20472
|
-
if (config2.verbose) {
|
|
20473
|
-
sdkLog("info", "[glasstrace:diag] BatchSpanProcessor configured: scheduledDelayMillis=1000");
|
|
20474
|
-
}
|
|
20475
20456
|
const provider = new BasicTracerProvider({
|
|
20476
20457
|
spanProcessors: [processor]
|
|
20477
20458
|
});
|
|
@@ -20739,8 +20720,8 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
|
|
|
20739
20720
|
if (config2.verbose) {
|
|
20740
20721
|
console.info("[glasstrace] Background init firing.");
|
|
20741
20722
|
}
|
|
20742
|
-
const healthReport = collectHealthReport("0.
|
|
20743
|
-
const initResult = await performInit(config2, anonKeyForInit, "0.
|
|
20723
|
+
const healthReport = collectHealthReport("0.13.0");
|
|
20724
|
+
const initResult = await performInit(config2, anonKeyForInit, "0.13.0", healthReport);
|
|
20744
20725
|
if (generation !== registrationGeneration) return;
|
|
20745
20726
|
if (initResult?.claimResult) {
|
|
20746
20727
|
setResolvedApiKey(initResult.claimResult.newApiKey);
|
|
@@ -20748,7 +20729,7 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
|
|
|
20748
20729
|
}
|
|
20749
20730
|
maybeInstallConsoleCapture();
|
|
20750
20731
|
if (didLastInitSucceed()) {
|
|
20751
|
-
startHeartbeat(config2, anonKeyForInit, "0.
|
|
20732
|
+
startHeartbeat(config2, anonKeyForInit, "0.13.0", generation, (newApiKey) => {
|
|
20752
20733
|
setResolvedApiKey(newApiKey);
|
|
20753
20734
|
notifyApiKeyResolved();
|
|
20754
20735
|
});
|