@glasstrace/sdk 1.2.1 → 1.3.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/README.md +47 -0
- package/dist/{chunk-HV5ID2WJ.js → chunk-A63WX7NR.js} +3 -3
- package/dist/{chunk-2GCN27SI.js → chunk-AGCYKZFY.js} +2 -2
- package/dist/{chunk-47B2G3FE.js → chunk-AKZGMT33.js} +2 -2
- package/dist/{chunk-MD5XPCTQ.js → chunk-AYUL5QMZ.js} +2 -2
- package/dist/{chunk-YMLMZCPR.js → chunk-FMEWG3FY.js} +2 -2
- package/dist/{chunk-NFPDYME5.js → chunk-FVHVDBGX.js} +3 -3
- package/dist/{chunk-EBYISKQP.js → chunk-GTPTKN5A.js} +2 -1
- package/dist/{chunk-EBYISKQP.js.map → chunk-GTPTKN5A.js.map} +1 -1
- package/dist/{chunk-CTJO7PUZ.js → chunk-JMYKR5Z3.js} +75 -9
- package/dist/chunk-JMYKR5Z3.js.map +1 -0
- package/dist/cli/init.cjs +1 -1
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.js +6 -6
- package/dist/cli/mcp-add.cjs.map +1 -1
- package/dist/cli/mcp-add.js +2 -2
- package/dist/cli/uninit.js +3 -3
- package/dist/cli/validate.cjs.map +1 -1
- package/dist/cli/validate.js +2 -2
- package/dist/edge-entry.cjs +1 -0
- package/dist/edge-entry.cjs.map +1 -1
- package/dist/edge-entry.js +2 -2
- package/dist/index.cjs +74 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/node-entry.cjs +74 -4
- package/dist/node-entry.cjs.map +1 -1
- package/dist/node-entry.js +7 -7
- package/dist/node-subpath.cjs.map +1 -1
- package/dist/node-subpath.js +3 -3
- package/dist/{source-map-uploader-RA4Z7TWA.js → source-map-uploader-M2P5CDOB.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-CTJO7PUZ.js.map +0 -1
- /package/dist/{chunk-HV5ID2WJ.js.map → chunk-A63WX7NR.js.map} +0 -0
- /package/dist/{chunk-2GCN27SI.js.map → chunk-AGCYKZFY.js.map} +0 -0
- /package/dist/{chunk-47B2G3FE.js.map → chunk-AKZGMT33.js.map} +0 -0
- /package/dist/{chunk-MD5XPCTQ.js.map → chunk-AYUL5QMZ.js.map} +0 -0
- /package/dist/{chunk-YMLMZCPR.js.map → chunk-FMEWG3FY.js.map} +0 -0
- /package/dist/{chunk-NFPDYME5.js.map → chunk-FVHVDBGX.js.map} +0 -0
- /package/dist/{source-map-uploader-RA4Z7TWA.js.map → source-map-uploader-M2P5CDOB.js.map} +0 -0
package/README.md
CHANGED
|
@@ -199,6 +199,53 @@ body data. If your account enables the flag but a span never carries
|
|
|
199
199
|
the internal attribute (no adapter set it), the public attribute is
|
|
200
200
|
still absent. The default is "off, twice".
|
|
201
201
|
|
|
202
|
+
## Source maps
|
|
203
|
+
|
|
204
|
+
Glasstrace uploads server-side source maps at build time and resolves
|
|
205
|
+
compiled-output stack frames back to original source on the dashboard
|
|
206
|
+
and in agent prompts. Three span attributes connect the runtime trace
|
|
207
|
+
to the build-time manifest:
|
|
208
|
+
|
|
209
|
+
| Attribute | When stamped | Source |
|
|
210
|
+
|---|---|---|
|
|
211
|
+
| `glasstrace.build.hash` | every server span | `process.env.GLASSTRACE_BUILD_HASH` (read once at module load) |
|
|
212
|
+
| `glasstrace.source.file` | error spans only | top user-attributable frame of `Error.stack` |
|
|
213
|
+
| `glasstrace.source.line` | error spans only | top user-attributable frame of `Error.stack` |
|
|
214
|
+
|
|
215
|
+
The build hash links a runtime span to the source maps uploaded
|
|
216
|
+
during the same build. Set the env var in your deploy step:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
# Vercel / GitHub Actions / any CI
|
|
220
|
+
GLASSTRACE_BUILD_HASH=$(git rev-parse HEAD) npm run start
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
The Glasstrace `next.config.ts` wrapper (`withGlasstraceConfig`) and
|
|
224
|
+
the `@glasstrace/sdk/node` upload helpers compute the same hash via
|
|
225
|
+
`computeBuildHash()` (preferring `git rev-parse HEAD`, falling back
|
|
226
|
+
to a deterministic content hash). When the runtime env var is unset,
|
|
227
|
+
the SDK silently omits the attribute — no crash, no diagnostic — so
|
|
228
|
+
projects that have not adopted the convention behave exactly as
|
|
229
|
+
before; their stored traces simply do not render mapped frames in
|
|
230
|
+
the dashboard.
|
|
231
|
+
|
|
232
|
+
The error-source attributes are stamped only by the manual
|
|
233
|
+
`captureError()` API, on the `glasstrace.error` span event. They
|
|
234
|
+
report the compiled-output `file:line` from the top user-attributable
|
|
235
|
+
frame; ingestion's resolver then maps that pair back to original
|
|
236
|
+
source via the uploaded source map manifest. The SDK skips frames
|
|
237
|
+
inside Node's built-in modules (`node:internal/*`, `node:fs`, etc.)
|
|
238
|
+
and inside its own `node_modules/@glasstrace/sdk/` closure, so the
|
|
239
|
+
reported frame is always the caller of `captureError()`. If
|
|
240
|
+
`Error.stack` is absent, malformed, or contains only internal frames,
|
|
241
|
+
the attributes are silently omitted and only the existing
|
|
242
|
+
`error.message` / `error.type` / `error.stack` event attributes are
|
|
243
|
+
recorded.
|
|
244
|
+
|
|
245
|
+
These attributes are additive: any consumer that does not understand
|
|
246
|
+
them ignores them. Existing trace pipelines and dashboards continue
|
|
247
|
+
to work unchanged.
|
|
248
|
+
|
|
202
249
|
## Browser-extension discovery
|
|
203
250
|
|
|
204
251
|
`glasstrace init` writes a small static file at
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
atomicWriteFile,
|
|
3
3
|
refreshGenericMcpConfigAtRuntime,
|
|
4
4
|
resolveEffectiveMcpCredential
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AYUL5QMZ.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_CAPTURE_CONFIG,
|
|
8
8
|
SdkCachedConfigSchema,
|
|
9
9
|
SdkInitResponseSchema
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GTPTKN5A.js";
|
|
11
11
|
import {
|
|
12
12
|
__require
|
|
13
13
|
} from "./chunk-NSBPE2FW.js";
|
|
@@ -692,4 +692,4 @@ export {
|
|
|
692
692
|
didLastInitSucceed,
|
|
693
693
|
verifyInitReachable
|
|
694
694
|
};
|
|
695
|
-
//# sourceMappingURL=chunk-
|
|
695
|
+
//# sourceMappingURL=chunk-A63WX7NR.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-DQ25VOKK.js";
|
|
4
4
|
import {
|
|
5
5
|
GLASSTRACE_ATTRIBUTE_NAMES
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GTPTKN5A.js";
|
|
7
7
|
|
|
8
8
|
// src/errors.ts
|
|
9
9
|
var SdkError = class extends Error {
|
|
@@ -102,4 +102,4 @@ export {
|
|
|
102
102
|
GlasstraceSpanProcessor,
|
|
103
103
|
captureCorrelationId
|
|
104
104
|
};
|
|
105
|
-
//# sourceMappingURL=chunk-
|
|
105
|
+
//# sourceMappingURL=chunk-AGCYKZFY.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PresignedUploadResponseSchema,
|
|
6
6
|
SourceMapManifestResponseSchema,
|
|
7
7
|
SourceMapUploadResponseSchema
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GTPTKN5A.js";
|
|
9
9
|
|
|
10
10
|
// src/source-map-uploader.ts
|
|
11
11
|
import * as fs from "node:fs/promises";
|
|
@@ -331,4 +331,4 @@ export {
|
|
|
331
331
|
uploadSourceMapsPresigned,
|
|
332
332
|
uploadSourceMapsAuto
|
|
333
333
|
};
|
|
334
|
-
//# sourceMappingURL=chunk-
|
|
334
|
+
//# sourceMappingURL=chunk-AKZGMT33.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
AnonApiKeySchema,
|
|
3
3
|
DevApiKeySchema,
|
|
4
4
|
createAnonApiKey
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GTPTKN5A.js";
|
|
6
6
|
import {
|
|
7
7
|
__require
|
|
8
8
|
} from "./chunk-NSBPE2FW.js";
|
|
@@ -605,4 +605,4 @@ export {
|
|
|
605
605
|
writeMcpMarker,
|
|
606
606
|
refreshGenericMcpConfigAtRuntime
|
|
607
607
|
};
|
|
608
|
-
//# sourceMappingURL=chunk-
|
|
608
|
+
//# sourceMappingURL=chunk-AYUL5QMZ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createBuildHash
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GTPTKN5A.js";
|
|
4
4
|
|
|
5
5
|
// src/import-graph.ts
|
|
6
6
|
import * as fs from "node:fs/promises";
|
|
@@ -175,4 +175,4 @@ export {
|
|
|
175
175
|
extractImports,
|
|
176
176
|
buildImportGraph
|
|
177
177
|
};
|
|
178
|
-
//# sourceMappingURL=chunk-
|
|
178
|
+
//# sourceMappingURL=chunk-FMEWG3FY.js.map
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
isDevApiKey,
|
|
6
6
|
readEnvLocalApiKey,
|
|
7
7
|
writeAndFsyncTempSync
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AYUL5QMZ.js";
|
|
9
9
|
import {
|
|
10
10
|
AnonApiKeySchema
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GTPTKN5A.js";
|
|
12
12
|
import {
|
|
13
13
|
NEXT_CONFIG_NAMES
|
|
14
14
|
} from "./chunk-NB7GJE4S.js";
|
|
@@ -914,4 +914,4 @@ export {
|
|
|
914
914
|
writeShutdownMarker,
|
|
915
915
|
runUninit
|
|
916
916
|
};
|
|
917
|
-
//# sourceMappingURL=chunk-
|
|
917
|
+
//# sourceMappingURL=chunk-FVHVDBGX.js.map
|
|
@@ -13932,6 +13932,7 @@ var GLASSTRACE_ATTRIBUTE_NAMES = {
|
|
|
13932
13932
|
FETCH_DURATION_MS: "glasstrace.fetch.duration_ms",
|
|
13933
13933
|
FETCH_TARGET: "glasstrace.fetch.target",
|
|
13934
13934
|
ENV_REFERENCED: "glasstrace.env.referenced",
|
|
13935
|
+
BUILD_HASH: "glasstrace.build.hash",
|
|
13935
13936
|
SOURCE_FILE: "glasstrace.source.file",
|
|
13936
13937
|
SOURCE_LINE: "glasstrace.source.line",
|
|
13937
13938
|
SOURCE_MAPPED: "glasstrace.source.mapped",
|
|
@@ -14113,4 +14114,4 @@ export {
|
|
|
14113
14114
|
DEFAULT_CAPTURE_CONFIG,
|
|
14114
14115
|
deriveSessionId
|
|
14115
14116
|
};
|
|
14116
|
-
//# sourceMappingURL=chunk-
|
|
14117
|
+
//# sourceMappingURL=chunk-GTPTKN5A.js.map
|