@glasstrace/sdk 1.15.0 → 1.15.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/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  recordSideEffect,
11
11
  registerGlasstrace,
12
12
  withGlasstraceConfig
13
- } from "./chunk-PSMSSLQY.js";
13
+ } from "./chunk-T4ETJJSK.js";
14
14
  import {
15
15
  getStatus,
16
16
  isReady,
@@ -23712,6 +23712,13 @@ async function tryImport(moduleId) {
23712
23712
  return null;
23713
23713
  }
23714
23714
  }
23715
+ function warnPrismaInstrumentationUnavailable(verbose, detail) {
23716
+ if (!verbose) return;
23717
+ sdkLog(
23718
+ "warn",
23719
+ `[glasstrace] @prisma/instrumentation ${detail}; Prisma query spans will not be captured. If you use Prisma and expect database spans, add @prisma/instrumentation as a direct dependency (some package managers, e.g. pnpm, do not expose transitive copies).`
23720
+ );
23721
+ }
23715
23722
  async function configureOtel(config2, sessionManager) {
23716
23723
  setOtelState(OtelState.CONFIGURING);
23717
23724
  await new Promise((resolve3) => {
@@ -23819,7 +23826,14 @@ async function runRegistrationPath(config2, sessionManager) {
23819
23826
  const PrismaInstrumentation = prismaModule2.PrismaInstrumentation;
23820
23827
  if (PrismaInstrumentation) {
23821
23828
  otelConfig.instrumentations = [new PrismaInstrumentation()];
23829
+ } else {
23830
+ warnPrismaInstrumentationUnavailable(
23831
+ config2.verbose,
23832
+ "was loaded but did not export PrismaInstrumentation"
23833
+ );
23822
23834
  }
23835
+ } else {
23836
+ warnPrismaInstrumentationUnavailable(config2.verbose, "could not be loaded");
23823
23837
  }
23824
23838
  vercelOtel.registerOTel(otelConfig);
23825
23839
  const vercelProxy = trace.getTracerProvider();
@@ -23874,9 +23888,22 @@ async function runRegistrationPath(config2, sessionManager) {
23874
23888
  const inst = new PrismaInstrumentation();
23875
23889
  inst.setTracerProvider(provider);
23876
23890
  inst.enable();
23877
- } catch {
23891
+ } catch (err) {
23892
+ if (config2.verbose) {
23893
+ sdkLog(
23894
+ "warn",
23895
+ `[glasstrace] @prisma/instrumentation failed to initialize: ${err instanceof Error ? err.message : String(err)}. Prisma query spans will not be captured.`
23896
+ );
23897
+ }
23878
23898
  }
23899
+ } else {
23900
+ warnPrismaInstrumentationUnavailable(
23901
+ config2.verbose,
23902
+ "was loaded but did not export PrismaInstrumentation"
23903
+ );
23879
23904
  }
23905
+ } else {
23906
+ warnPrismaInstrumentationUnavailable(config2.verbose, "could not be loaded");
23880
23907
  }
23881
23908
  setOtelState(OtelState.OWNS_PROVIDER);
23882
23909
  emitLifecycleEvent("otel:configured", { state: OtelState.OWNS_PROVIDER, scenario: "A" });
@@ -24396,11 +24423,11 @@ function registerGlasstrace(options) {
24396
24423
  setCoreState(CoreState.REGISTERING);
24397
24424
  maybeWarnStaleAgentInstructions({
24398
24425
  projectRoot: process.cwd(),
24399
- sdkVersion: "1.15.0"
24426
+ sdkVersion: "1.15.1"
24400
24427
  });
24401
24428
  startRuntimeStateWriter({
24402
24429
  projectRoot: process.cwd(),
24403
- sdkVersion: "1.15.0"
24430
+ sdkVersion: "1.15.1"
24404
24431
  });
24405
24432
  const config2 = resolveConfig(options);
24406
24433
  setSideEffectVerboseFlag(config2.verbose);
@@ -24568,8 +24595,8 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
24568
24595
  if (config2.verbose) {
24569
24596
  console.info("[glasstrace] Background init firing.");
24570
24597
  }
24571
- const healthReport = collectHealthReport("1.15.0");
24572
- const initResult = await performInit(config2, anonKeyForInit, "1.15.0", healthReport);
24598
+ const healthReport = collectHealthReport("1.15.1");
24599
+ const initResult = await performInit(config2, anonKeyForInit, "1.15.1", healthReport);
24573
24600
  if (generation !== registrationGeneration) return;
24574
24601
  const currentState = getCoreState();
24575
24602
  if (currentState === CoreState.SHUTTING_DOWN || currentState === CoreState.SHUTDOWN) {
@@ -24592,7 +24619,7 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
24592
24619
  }
24593
24620
  maybeInstallConsoleCapture();
24594
24621
  if (didLastInitSucceed()) {
24595
- startHeartbeat(config2, anonKeyForInit, "1.15.0", generation, (newApiKey, accountId) => {
24622
+ startHeartbeat(config2, anonKeyForInit, "1.15.1", generation, (newApiKey, accountId) => {
24596
24623
  setAuthState(AuthState.CLAIMING);
24597
24624
  emitLifecycleEvent("auth:claim_started", { accountId });
24598
24625
  setResolvedApiKey(newApiKey);