@glasstrace/sdk 1.9.0 → 1.10.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/async-context/index.cjs +53 -4
- package/dist/async-context/index.cjs.map +1 -1
- package/dist/async-context/index.js +2 -2
- package/dist/{chunk-JHUNLPSS.js → chunk-6RKS3DNA.js} +45 -1
- package/dist/{chunk-JHUNLPSS.js.map → chunk-6RKS3DNA.js.map} +1 -1
- package/dist/{chunk-HD6JIFKN.js → chunk-BSVWJSVX.js} +2 -2
- package/dist/{chunk-QHV7NFON.js → chunk-D54FMQHF.js} +49 -40
- package/dist/chunk-D54FMQHF.js.map +1 -0
- package/dist/chunk-I2DVVSKW.js +419 -0
- package/dist/chunk-I2DVVSKW.js.map +1 -0
- package/dist/{chunk-H6WJ63X2.js → chunk-M5GO2SSO.js} +2 -2
- package/dist/{chunk-XEPC4NFL.js → chunk-OXA4IHQX.js} +39 -405
- package/dist/chunk-OXA4IHQX.js.map +1 -0
- package/dist/{chunk-RQ5BIWDT.js → chunk-OXM2BZMF.js} +11 -6
- package/dist/{chunk-RQ5BIWDT.js.map → chunk-OXM2BZMF.js.map} +1 -1
- package/dist/{chunk-M6EWJCAT.js → chunk-QVTONMVZ.js} +2 -2
- package/dist/{chunk-DKV53A2C.js → chunk-RL43PU2X.js} +2 -2
- package/dist/{chunk-GWIEUBFR.js → chunk-UMGZJYC4.js} +3 -3
- package/dist/{chunk-QXITSNYM.js → chunk-XG6WR2KS.js} +3 -3
- package/dist/cli/init.cjs +4 -4
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.js +7 -7
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/mcp-add.cjs +1 -1
- package/dist/cli/mcp-add.cjs.map +1 -1
- package/dist/cli/mcp-add.js +3 -3
- package/dist/cli/mcp-add.js.map +1 -1
- package/dist/cli/uninit.js +3 -3
- package/dist/cli/upgrade-instructions.cjs +1 -1
- package/dist/cli/upgrade-instructions.cjs.map +1 -1
- package/dist/cli/upgrade-instructions.js +3 -3
- package/dist/cli/upgrade-instructions.js.map +1 -1
- package/dist/cli/validate.cjs.map +1 -1
- package/dist/cli/validate.js +2 -2
- package/dist/edge-entry.cjs +100 -42
- package/dist/edge-entry.cjs.map +1 -1
- package/dist/edge-entry.js +4 -4
- package/dist/index.cjs +58 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/middleware/index.cjs +91 -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 +2 -2
- package/dist/node-entry.cjs +58 -5
- package/dist/node-entry.cjs.map +1 -1
- package/dist/node-entry.js +12 -10
- package/dist/node-subpath.cjs.map +1 -1
- package/dist/node-subpath.js +3 -3
- package/dist/{source-map-uploader-MMJ2WCL4.js → source-map-uploader-CLYCE2TZ.js} +3 -3
- package/dist/trpc/index.cjs +15164 -503
- package/dist/trpc/index.cjs.map +1 -1
- package/dist/trpc/index.d.cts +62 -1
- package/dist/trpc/index.d.ts +62 -1
- package/dist/trpc/index.js +200 -1
- package/dist/trpc/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-QHV7NFON.js.map +0 -1
- package/dist/chunk-XEPC4NFL.js.map +0 -1
- /package/dist/{chunk-HD6JIFKN.js.map → chunk-BSVWJSVX.js.map} +0 -0
- /package/dist/{chunk-H6WJ63X2.js.map → chunk-M5GO2SSO.js.map} +0 -0
- /package/dist/{chunk-M6EWJCAT.js.map → chunk-QVTONMVZ.js.map} +0 -0
- /package/dist/{chunk-DKV53A2C.js.map → chunk-RL43PU2X.js.map} +0 -0
- /package/dist/{chunk-GWIEUBFR.js.map → chunk-UMGZJYC4.js.map} +0 -0
- /package/dist/{chunk-QXITSNYM.js.map → chunk-XG6WR2KS.js.map} +0 -0
- /package/dist/{source-map-uploader-MMJ2WCL4.js.map → source-map-uploader-CLYCE2TZ.js.map} +0 -0
|
@@ -124,6 +124,14 @@ interface TracedRequestMiddlewareOptions {
|
|
|
124
124
|
* Wrap a Next.js / generic-fetch request-middleware function in an
|
|
125
125
|
* OTel span tagged with `glasstrace.causal.middleware_for_request`.
|
|
126
126
|
*
|
|
127
|
+
* **Privacy:** the value of
|
|
128
|
+
* `glasstrace.causal.middleware_for_request` is the raw URL
|
|
129
|
+
* pathname. Pathnames can carry user-controlled data (IDs, emails,
|
|
130
|
+
* opaque keys). The SDK does NOT redact this attribute. Callers MUST
|
|
131
|
+
* NOT place secrets, tokens, or other sensitive data in URL paths;
|
|
132
|
+
* the same general HTTP best practice that keeps secrets out of
|
|
133
|
+
* server logs keeps them out of Glasstrace trace evidence.
|
|
134
|
+
*
|
|
127
135
|
* Each call to the returned function:
|
|
128
136
|
*
|
|
129
137
|
* 1. Detects the SDK's registration state. When the OTel API is
|
|
@@ -124,6 +124,14 @@ interface TracedRequestMiddlewareOptions {
|
|
|
124
124
|
* Wrap a Next.js / generic-fetch request-middleware function in an
|
|
125
125
|
* OTel span tagged with `glasstrace.causal.middleware_for_request`.
|
|
126
126
|
*
|
|
127
|
+
* **Privacy:** the value of
|
|
128
|
+
* `glasstrace.causal.middleware_for_request` is the raw URL
|
|
129
|
+
* pathname. Pathnames can carry user-controlled data (IDs, emails,
|
|
130
|
+
* opaque keys). The SDK does NOT redact this attribute. Callers MUST
|
|
131
|
+
* NOT place secrets, tokens, or other sensitive data in URL paths;
|
|
132
|
+
* the same general HTTP best practice that keeps secrets out of
|
|
133
|
+
* server logs keeps them out of Glasstrace trace evidence.
|
|
134
|
+
*
|
|
127
135
|
* Each call to the returned function:
|
|
128
136
|
*
|
|
129
137
|
* 1. Detects the SDK's registration state. When the OTel API is
|
package/dist/middleware/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
_resetForTesting,
|
|
3
3
|
tracedRequestMiddleware
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-D54FMQHF.js";
|
|
5
5
|
import "../chunk-CL3OVHPO.js";
|
|
6
6
|
import "../chunk-DQ25VOKK.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-6RKS3DNA.js";
|
|
8
8
|
import "../chunk-NSBPE2FW.js";
|
|
9
9
|
export {
|
|
10
10
|
_resetForTesting,
|
package/dist/node-entry.cjs
CHANGED
|
@@ -14638,6 +14638,21 @@ var init_dist = __esm({
|
|
|
14638
14638
|
HTTP_METHOD: "glasstrace.http.method",
|
|
14639
14639
|
HTTP_STATUS_CODE: "glasstrace.http.status_code",
|
|
14640
14640
|
HTTP_DURATION_MS: "glasstrace.http.duration_ms",
|
|
14641
|
+
/**
|
|
14642
|
+
* Boolean audit attribute set to `true` only when the SDK's
|
|
14643
|
+
* boundary-masked-error heuristic at `enriching-exporter.ts`
|
|
14644
|
+
* fires (SDK-051 / DISC-1125 — same-span scope; descendant-traversal
|
|
14645
|
+
* scope is tracked in a follow-up DISC).
|
|
14646
|
+
*
|
|
14647
|
+
* Strict additivity: backend ingestion ignores unknown attributes
|
|
14648
|
+
* today; this attribute is for audit/observability. Downstream
|
|
14649
|
+
* tooling MAY surface heuristic activation rates by querying for
|
|
14650
|
+
* spans with this attribute set; the backend's status-handling
|
|
14651
|
+
* pipeline does NOT depend on it.
|
|
14652
|
+
*
|
|
14653
|
+
* Absent on spans where the heuristic did not fire.
|
|
14654
|
+
*/
|
|
14655
|
+
HTTP_BOUNDARY_MASKED: "glasstrace.http.boundary_masked",
|
|
14641
14656
|
ERROR_MESSAGE: "glasstrace.error.message",
|
|
14642
14657
|
ERROR_CODE: "glasstrace.error.code",
|
|
14643
14658
|
ERROR_CATEGORY: "glasstrace.error.category",
|
|
@@ -14677,6 +14692,35 @@ var init_dist = __esm({
|
|
|
14677
14692
|
SOURCE_LINE: "glasstrace.source.line",
|
|
14678
14693
|
SOURCE_MAPPED: "glasstrace.source.mapped",
|
|
14679
14694
|
TRPC_PROCEDURE: "glasstrace.trpc.procedure",
|
|
14695
|
+
/**
|
|
14696
|
+
* Zero-based positional index of the current member within a tRPC
|
|
14697
|
+
* HTTP-batch dispatch (SDK-052 / DISC-1534 SDK-side slice). Set on
|
|
14698
|
+
* member spans by `tracedMiddleware` when the SDK's
|
|
14699
|
+
* `wrapBatchedHttpHandler` envelope is in scope. Numeric.
|
|
14700
|
+
*
|
|
14701
|
+
* Load-bearing for batches that include the same procedure name
|
|
14702
|
+
* more than once — name-only matching cannot disambiguate, so the
|
|
14703
|
+
* positional index is the canonical disambiguator. Absent on
|
|
14704
|
+
* non-batched spans and on apps not using `wrapBatchedHttpHandler`.
|
|
14705
|
+
*/
|
|
14706
|
+
TRPC_BATCH_MEMBER_INDEX: "glasstrace.trpc.batch.member_index",
|
|
14707
|
+
/**
|
|
14708
|
+
* Ordered list of all procedure names in the current tRPC HTTP
|
|
14709
|
+
* batch (SDK-052 / DISC-1534 SDK-side slice). Stored as an OTel
|
|
14710
|
+
* typed string array (`string[]`), NOT a JSON-encoded string —
|
|
14711
|
+
* the typed-array form preserves first-class queryability in the
|
|
14712
|
+
* OTel ingest pipeline.
|
|
14713
|
+
*
|
|
14714
|
+
* Set on each member span that `tracedMiddleware` produces when a
|
|
14715
|
+
* `wrapBatchedHttpHandler` envelope is in scope. Absent on
|
|
14716
|
+
* non-batched spans, on the root HTTP server span (today's
|
|
14717
|
+
* release ships strict-additive scope only — per-root-span
|
|
14718
|
+
* attribution is deferred to a follow-up wave because changing
|
|
14719
|
+
* the root span's existing `glasstrace.trpc.procedure` shape from
|
|
14720
|
+
* comma-joined to first-member representative is non-additive),
|
|
14721
|
+
* and on apps not using `wrapBatchedHttpHandler`.
|
|
14722
|
+
*/
|
|
14723
|
+
TRPC_BATCH_MEMBER_PROCEDURES: "glasstrace.trpc.batch.member_procedures",
|
|
14680
14724
|
ERROR_RESPONSE_BODY: "glasstrace.error.response_body",
|
|
14681
14725
|
NEXT_ACTION_DETECTED: "glasstrace.next.action.detected",
|
|
14682
14726
|
// Client-side attributes
|
|
@@ -19604,6 +19648,15 @@ var GlasstraceExporter = class {
|
|
|
19604
19648
|
} else {
|
|
19605
19649
|
extra[ATTR2.HTTP_STATUS_CODE] = 500;
|
|
19606
19650
|
}
|
|
19651
|
+
extra[ATTR2.HTTP_BOUNDARY_MASKED] = true;
|
|
19652
|
+
const inferredStatus = extra[ATTR2.HTTP_STATUS_CODE];
|
|
19653
|
+
const eventDetails2 = getExceptionEventDetails(span);
|
|
19654
|
+
const exceptionMessage = eventDetails2.message ?? (typeof attrs["exception.message"] === "string" ? attrs["exception.message"] : void 0);
|
|
19655
|
+
emitLifecycleEvent("core:error_boundary_detected", {
|
|
19656
|
+
spanId: span.spanContext().spanId,
|
|
19657
|
+
inferredStatus,
|
|
19658
|
+
...exceptionMessage !== void 0 ? { exceptionMessage: exceptionMessage.slice(0, 256) } : {}
|
|
19659
|
+
});
|
|
19607
19660
|
if (this.verbose) {
|
|
19608
19661
|
sdkLog(
|
|
19609
19662
|
"info",
|
|
@@ -23559,11 +23612,11 @@ function registerGlasstrace(options) {
|
|
|
23559
23612
|
setCoreState(CoreState.REGISTERING);
|
|
23560
23613
|
maybeWarnStaleAgentInstructions({
|
|
23561
23614
|
projectRoot: process.cwd(),
|
|
23562
|
-
sdkVersion: "1.
|
|
23615
|
+
sdkVersion: "1.10.0"
|
|
23563
23616
|
});
|
|
23564
23617
|
startRuntimeStateWriter({
|
|
23565
23618
|
projectRoot: process.cwd(),
|
|
23566
|
-
sdkVersion: "1.
|
|
23619
|
+
sdkVersion: "1.10.0"
|
|
23567
23620
|
});
|
|
23568
23621
|
const config2 = resolveConfig(options);
|
|
23569
23622
|
if (config2.verbose) {
|
|
@@ -23730,8 +23783,8 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
|
|
|
23730
23783
|
if (config2.verbose) {
|
|
23731
23784
|
console.info("[glasstrace] Background init firing.");
|
|
23732
23785
|
}
|
|
23733
|
-
const healthReport = collectHealthReport("1.
|
|
23734
|
-
const initResult = await performInit(config2, anonKeyForInit, "1.
|
|
23786
|
+
const healthReport = collectHealthReport("1.10.0");
|
|
23787
|
+
const initResult = await performInit(config2, anonKeyForInit, "1.10.0", healthReport);
|
|
23735
23788
|
if (generation !== registrationGeneration) return;
|
|
23736
23789
|
const currentState = getCoreState();
|
|
23737
23790
|
if (currentState === CoreState.SHUTTING_DOWN || currentState === CoreState.SHUTDOWN) {
|
|
@@ -23754,7 +23807,7 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
|
|
|
23754
23807
|
}
|
|
23755
23808
|
maybeInstallConsoleCapture();
|
|
23756
23809
|
if (didLastInitSucceed()) {
|
|
23757
|
-
startHeartbeat(config2, anonKeyForInit, "1.
|
|
23810
|
+
startHeartbeat(config2, anonKeyForInit, "1.10.0", generation, (newApiKey, accountId) => {
|
|
23758
23811
|
setAuthState(AuthState.CLAIMING);
|
|
23759
23812
|
emitLifecycleEvent("auth:claim_started", { accountId });
|
|
23760
23813
|
setResolvedApiKey(newApiKey);
|