@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/index.d.cts CHANGED
@@ -361,6 +361,7 @@ interface GlasstraceExporterOptions {
361
361
  environment: string | undefined;
362
362
  endpointUrl: string;
363
363
  createDelegate: ((url: string, headers: Record<string, string>) => SpanExporter) | null;
364
+ /** @deprecated No-op retained for backward compatibility. Will be removed in a future major. */
364
365
  verbose?: boolean;
365
366
  }
366
367
  /**
@@ -382,7 +383,6 @@ declare class GlasstraceExporter implements SpanExporter {
382
383
  private readonly environment;
383
384
  private readonly endpointUrl;
384
385
  private readonly createDelegateFn;
385
- private readonly verbose;
386
386
  private delegate;
387
387
  private delegateKey;
388
388
  private pendingBatches;
package/dist/index.d.ts CHANGED
@@ -361,6 +361,7 @@ interface GlasstraceExporterOptions {
361
361
  environment: string | undefined;
362
362
  endpointUrl: string;
363
363
  createDelegate: ((url: string, headers: Record<string, string>) => SpanExporter) | null;
364
+ /** @deprecated No-op retained for backward compatibility. Will be removed in a future major. */
364
365
  verbose?: boolean;
365
366
  }
366
367
  /**
@@ -382,7 +383,6 @@ declare class GlasstraceExporter implements SpanExporter {
382
383
  private readonly environment;
383
384
  private readonly endpointUrl;
384
385
  private readonly createDelegateFn;
385
- private readonly verbose;
386
386
  private delegate;
387
387
  private delegateKey;
388
388
  private pendingBatches;
package/dist/index.js CHANGED
@@ -577,7 +577,6 @@ var GlasstraceExporter = class {
577
577
  environment;
578
578
  endpointUrl;
579
579
  createDelegateFn;
580
- verbose;
581
580
  delegate = null;
582
581
  delegateKey = null;
583
582
  pendingBatches = [];
@@ -590,7 +589,6 @@ var GlasstraceExporter = class {
590
589
  this.environment = options.environment;
591
590
  this.endpointUrl = options.endpointUrl;
592
591
  this.createDelegateFn = options.createDelegate;
593
- this.verbose = options.verbose ?? false;
594
592
  }
595
593
  export(spans, resultCallback) {
596
594
  const currentKey = this.getApiKey();
@@ -599,16 +597,11 @@ var GlasstraceExporter = class {
599
597
  return;
600
598
  }
601
599
  const enrichedSpans = spans.map((span) => this.enrichSpan(span));
602
- if (this.verbose) {
603
- sdkLog("info", `[glasstrace:diag] Export batch: ${enrichedSpans.length} spans`);
604
- }
605
600
  const exporter = this.ensureDelegate();
606
601
  if (exporter) {
607
602
  exporter.export(enrichedSpans, (result) => {
608
603
  if (result.code !== 0) {
609
604
  sdkLog("warn", `[glasstrace] Span export failed: ${result.error?.message ?? "unknown error"}`);
610
- } else if (this.verbose) {
611
- sdkLog("info", `[glasstrace:diag] Export success: ${enrichedSpans.length} spans delivered`);
612
605
  }
613
606
  resultCallback(result);
614
607
  });
@@ -795,17 +788,11 @@ var GlasstraceExporter = class {
795
788
  bufferSpans(spans, resultCallback) {
796
789
  this.pendingBatches.push({ spans, resultCallback });
797
790
  this.pendingSpanCount += spans.length;
798
- if (this.verbose) {
799
- sdkLog("info", `[glasstrace:diag] Buffering ${spans.length} spans (key pending, total: ${this.pendingSpanCount})`);
800
- }
801
791
  while (this.pendingSpanCount > MAX_PENDING_SPANS && this.pendingBatches.length > 1) {
802
792
  const evicted = this.pendingBatches.shift();
803
793
  this.pendingSpanCount -= evicted.spans.length;
804
794
  recordSpansDropped(evicted.spans.length);
805
795
  evicted.resultCallback({ code: 0 });
806
- if (this.verbose) {
807
- sdkLog("info", `[glasstrace:diag] Buffer overflow: evicted ${evicted.spans.length} spans (total pending: ${this.pendingSpanCount})`);
808
- }
809
796
  if (!this.overflowLogged) {
810
797
  this.overflowLogged = true;
811
798
  console.warn(
@@ -844,8 +831,6 @@ var GlasstraceExporter = class {
844
831
  exporter.export(enriched, (result) => {
845
832
  if (result.code !== 0) {
846
833
  sdkLog("warn", `[glasstrace] Span export failed: ${result.error?.message ?? "unknown error"}`);
847
- } else if (this.verbose) {
848
- sdkLog("info", `[glasstrace:diag] Flush export success: ${enriched.length} spans delivered`);
849
834
  }
850
835
  batch.resultCallback(result);
851
836
  });
@@ -3611,8 +3596,7 @@ async function configureOtel(config, sessionManager) {
3611
3596
  getConfig: () => getActiveConfig(),
3612
3597
  environment: config.environment,
3613
3598
  endpointUrl: exporterUrl,
3614
- createDelegate: createOtlpExporter,
3615
- verbose: config.verbose
3599
+ createDelegate: createOtlpExporter
3616
3600
  });
3617
3601
  _activeExporter = glasstraceExporter;
3618
3602
  const vercelOtel = await tryImport("@vercel/otel");
@@ -3655,9 +3639,6 @@ async function configureOtel(config, sessionManager) {
3655
3639
  const processor = new BatchSpanProcessor(glasstraceExporter, {
3656
3640
  scheduledDelayMillis: 1e3
3657
3641
  });
3658
- if (config.verbose) {
3659
- sdkLog("info", "[glasstrace:diag] BatchSpanProcessor configured: scheduledDelayMillis=1000");
3660
- }
3661
3642
  const provider = new BasicTracerProvider({
3662
3643
  spanProcessors: [processor]
3663
3644
  });
@@ -3921,8 +3902,8 @@ async function backgroundInit(config, anonKeyForInit, generation) {
3921
3902
  if (config.verbose) {
3922
3903
  console.info("[glasstrace] Background init firing.");
3923
3904
  }
3924
- const healthReport = collectHealthReport("0.12.5");
3925
- const initResult = await performInit(config, anonKeyForInit, "0.12.5", healthReport);
3905
+ const healthReport = collectHealthReport("0.13.0");
3906
+ const initResult = await performInit(config, anonKeyForInit, "0.13.0", healthReport);
3926
3907
  if (generation !== registrationGeneration) return;
3927
3908
  if (initResult?.claimResult) {
3928
3909
  setResolvedApiKey(initResult.claimResult.newApiKey);
@@ -3930,7 +3911,7 @@ async function backgroundInit(config, anonKeyForInit, generation) {
3930
3911
  }
3931
3912
  maybeInstallConsoleCapture();
3932
3913
  if (didLastInitSucceed()) {
3933
- startHeartbeat(config, anonKeyForInit, "0.12.5", generation, (newApiKey) => {
3914
+ startHeartbeat(config, anonKeyForInit, "0.13.0", generation, (newApiKey) => {
3934
3915
  setResolvedApiKey(newApiKey);
3935
3916
  notifyApiKeyResolved();
3936
3917
  });