@dasasian/firebase-structured-logger 0.8.0 → 1.0.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 +234 -35
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/logger.d.ts +22 -2
- package/dist/client/logger.d.ts.map +1 -1
- package/dist/client/logger.js +135 -21
- package/dist/client/logger.js.map +1 -1
- package/dist/client/rateLimiter.d.ts +106 -11
- package/dist/client/rateLimiter.d.ts.map +1 -1
- package/dist/client/rateLimiter.js +334 -21
- package/dist/client/rateLimiter.js.map +1 -1
- package/dist/functions/httpHandler.d.ts +1 -1
- package/dist/functions/httpHandler.js +1 -1
- package/dist/functions/index.d.ts +1 -1
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/logHandler.d.ts +10 -5
- package/dist/functions/logHandler.d.ts.map +1 -1
- package/dist/functions/logHandler.js +17 -5
- package/dist/functions/logHandler.js.map +1 -1
- package/dist/functions/logger.d.ts.map +1 -1
- package/dist/functions/logger.js +232 -10
- package/dist/functions/logger.js.map +1 -1
- package/dist/functions/sourceMapCache.js +1 -1
- package/dist/functions/sourceMapCache.js.map +1 -1
- package/dist/shared/deprecate.d.ts +4 -0
- package/dist/shared/deprecate.d.ts.map +1 -0
- package/dist/shared/deprecate.js +30 -0
- package/dist/shared/deprecate.js.map +1 -0
- package/dist/shared/nodeModules.d.ts +39 -0
- package/dist/shared/nodeModules.d.ts.map +1 -0
- package/dist/shared/nodeModules.js +120 -0
- package/dist/shared/nodeModules.js.map +1 -0
- package/dist/shared/types.d.ts +7 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/shared/versionRange.d.ts +17 -0
- package/dist/shared/versionRange.d.ts.map +1 -0
- package/dist/shared/versionRange.js +48 -0
- package/dist/shared/versionRange.js.map +1 -0
- package/dist/tools/doctor.d.ts +54 -0
- package/dist/tools/doctor.d.ts.map +1 -0
- package/dist/tools/doctor.js +381 -0
- package/dist/tools/doctor.js.map +1 -0
- package/dist/tools/index.js +34 -5
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/uploadSourceMaps.d.ts +7 -0
- package/dist/tools/uploadSourceMaps.d.ts.map +1 -1
- package/dist/tools/uploadSourceMaps.js.map +1 -1
- package/package.json +11 -11
- package/skills/query-logs/SKILL.md +49 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadSourceMaps.js","sourceRoot":"","sources":["../../src/tools/uploadSourceMaps.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"uploadSourceMaps.js","sourceRoot":"","sources":["../../src/tools/uploadSourceMaps.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,kDASC;AA8BD,4CAkHC;AAzOD,uCAAwB;AACxB,2CAA4B;AAC5B,mDAA+C;AAC/C,iDAA8F;AAE9F;;;;;;;GAOG;AACU,QAAA,+BAA+B,GAAG,CAAC,CAAA;AAEhD;;;;;;;GAOG;AACU,QAAA,uBAAuB,GAAG,yBAAc,CAAA;AAwCrD;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,mBAAmB,CAAC,GAAW;IAC7C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA4B,CAAA;QACtD,IAAI,CAAC,CAAC,gBAAgB,IAAI,GAAG,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;QACrE,OAAO,GAAG,CAAC,cAAc,CAAA;QACzB,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;IACtD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,IA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SAAS,kDAAkD,CAAC,CAAA;QAC9F,OAAO,CAAC,IAAI,CAAC,mFAAmF,CAAC,CAAA;QACjG,OAAO,CAAC,IAAI,CAAC,4DAA4D,SAAS,SAAS,CAAC,CAAA;QAC5F,OAAO,CAAC,IAAI,CAAC,kFAAkF,CAAC,CAAA;QAEhG,6EAA6E;QAC7E,4DAA4D;QAC5D,KAAK,MAAM,SAAS,IAAI,QAAQ,EAAE,CAAC;YACjC,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC7B,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;gBACxB,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,EAAE,CAAC,CAAA;YACvE,CAAC;QACH,CAAC;QACD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;IAC5B,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dasasian/firebase-structured-logger",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Structured logging for Firebase and Google Cloud web apps — browser, backend, and tools",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Dasasian",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"build:watch": "tsc --watch",
|
|
69
69
|
"clean": "rm -rf dist",
|
|
70
70
|
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.check.json",
|
|
71
|
-
"test": "tsx tests/logger.ts && tsx tests/browserBundle.ts && tsx tests/breadcrumbs.ts && tsx tests/rateLimiter.ts && tsx tests/errorHandler.ts && tsx tests/attachments.ts && tsx tests/feedback.ts && tsx tests/paths.ts && tsx tests/loadsWithoutOptionalPeers.ts && tsx tests/sourceMapStripping.ts && FUNCTIONS_EMULATOR=true tsx tests/errorPayload.ts && FUNCTIONS_EMULATOR=true tsx tests/requestLogger.ts && FUNCTIONS_EMULATOR=true tsx tests/handler.ts && FUNCTIONS_EMULATOR=true tsx tests/httpHandler.ts && FUNCTIONS_EMULATOR=true tsx tests/symbolication.ts && FUNCTIONS_EMULATOR=true tsx tests/publicApi.ts && FUNCTIONS_EMULATOR=true tsx tests/configureTwice.ts && tsx tests/productionOutput.ts && tsx tests/storageChain.ts && tsx tests/handlerSymbolication.ts && tsx tests/releaseResolution.ts && tsx tests/sourceMapCacheBounds.ts",
|
|
71
|
+
"test": "tsx tests/logger.ts && tsx tests/browserBundle.ts && tsx tests/breadcrumbs.ts && tsx tests/rateLimiter.ts && tsx tests/errorHandler.ts && tsx tests/attachments.ts && tsx tests/feedback.ts && tsx tests/paths.ts && tsx tests/loadsWithoutOptionalPeers.ts && tsx tests/sourceMapStripping.ts && FUNCTIONS_EMULATOR=true tsx tests/errorPayload.ts && FUNCTIONS_EMULATOR=true tsx tests/requestLogger.ts && FUNCTIONS_EMULATOR=true tsx tests/handler.ts && FUNCTIONS_EMULATOR=true tsx tests/httpHandler.ts && FUNCTIONS_EMULATOR=true tsx tests/symbolication.ts && FUNCTIONS_EMULATOR=true tsx tests/publicApi.ts && FUNCTIONS_EMULATOR=true tsx tests/configureTwice.ts && FUNCTIONS_EMULATOR=true tsx tests/deprecatedNames.ts && tsx tests/productionOutput.ts && tsx tests/storageChain.ts && tsx tests/entrySize.ts && tsx tests/handlerSymbolication.ts && tsx tests/releaseResolution.ts && tsx tests/sourceMapCacheBounds.ts && tsx tests/doctor.ts && tsx tests/doctorProcess.ts && tsx tests/uploadSourcemapsBackend.ts",
|
|
72
72
|
"prepublishOnly": "npm run clean && npm run build",
|
|
73
73
|
"smoke:deploy": "cd smoke/functions && npm install && npm run build && cd .. && firebase deploy --only functions --project $(grep '^FSL_SMOKE_PROJECT=' .env.local | cut -d= -f2)",
|
|
74
74
|
"smoke:deploy:run": "bash smoke/cloudrun/deploy.sh",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"smoke:install": "tsx smoke/install.ts"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@google-cloud/storage": "^7.0.0",
|
|
79
|
+
"@google-cloud/storage": "^7.19.0 || ^8.1.0",
|
|
80
80
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
81
81
|
"ulid": "^3.0.2"
|
|
82
82
|
},
|
|
@@ -97,16 +97,16 @@
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
|
-
"@google-cloud/logging": "^
|
|
100
|
+
"@google-cloud/logging": "^12.1.0",
|
|
101
101
|
"@types/jsdom": "^30.0.0",
|
|
102
|
-
"@types/node": "^26.2
|
|
102
|
+
"@types/node": "^26.6.2",
|
|
103
103
|
"esbuild": "^0.28.2",
|
|
104
|
-
"firebase": "^12.
|
|
105
|
-
"firebase-admin": "^14.
|
|
106
|
-
"firebase-functions": "^7.
|
|
107
|
-
"jsdom": "^
|
|
108
|
-
"tsx": "^4.
|
|
109
|
-
"typescript": "~
|
|
104
|
+
"firebase": "^12.19.0",
|
|
105
|
+
"firebase-admin": "^14.5.0",
|
|
106
|
+
"firebase-functions": "^7.4.0",
|
|
107
|
+
"jsdom": "^30.1.1",
|
|
108
|
+
"tsx": "^4.23.15",
|
|
109
|
+
"typescript": "~6.0.3"
|
|
110
110
|
},
|
|
111
111
|
"engines": {
|
|
112
112
|
"node": ">=22"
|
|
@@ -8,6 +8,20 @@ The `firebase_functions_logs` MCP tool reads from:
|
|
|
8
8
|
- **Production**: Google Cloud Logging (default)
|
|
9
9
|
- **Development**: Local JSONL file when `DEV_LOG_FILE` env var is set in the MCP server
|
|
10
10
|
|
|
11
|
+
## Missing or odd logs? Check the setup first
|
|
12
|
+
|
|
13
|
+
Before reading logs to explain why something is missing — no entries at all, stacks that
|
|
14
|
+
stay minified, no attachments — run the setup check. Most of those failures are silent
|
|
15
|
+
misconfigurations, and doctor reads them straight off disk:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npx fsl doctor --json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`findings` lists anything wrong, each with an `id`, `level` and `fix`; `setup` says how
|
|
22
|
+
logging, trace ids and Storage will behave. An empty `findings` means the setup is not
|
|
23
|
+
the problem, and the answer is in the logs.
|
|
24
|
+
|
|
11
25
|
## Queryable Labels
|
|
12
26
|
|
|
13
27
|
All entries written by firebase-structured-logger include these labels:
|
|
@@ -25,6 +39,12 @@ All entries written by firebase-structured-logger include these labels:
|
|
|
25
39
|
| `functionName` | Cloud Function name (server-side logs only) |
|
|
26
40
|
| `logId` | ULID — unique per log entry, used to locate attachments in GCS |
|
|
27
41
|
| `hasAttachments` | `'true'` when attachments were uploaded alongside this entry |
|
|
42
|
+
| `repeatKey` | Client-side id carried by each full copy of an error that repeats |
|
|
43
|
+
| `repeatOf` | On a repeat summary: the `repeatKey` of the full copies it counts |
|
|
44
|
+
| `repeatCount` | On a repeat summary: how many further occurrences it stands for |
|
|
45
|
+
| `firstSeen`, `lastSeen` | On a repeat summary: the window those occurrences fell in |
|
|
46
|
+
| `sentLate` | `'true'` on a summary sent by a later visit than the one it counts |
|
|
47
|
+
| `truncated` | `'true'` when the entry was shortened to fit Cloud Logging's line limit |
|
|
28
48
|
|
|
29
49
|
App-specific labels are defined in each app's `AppLabels` type.
|
|
30
50
|
|
|
@@ -68,6 +88,35 @@ labels.releaseId="<hash>"
|
|
|
68
88
|
severity=ERROR timestamp>="<ISO8601>"
|
|
69
89
|
```
|
|
70
90
|
|
|
91
|
+
## How often did it really happen?
|
|
92
|
+
|
|
93
|
+
**Do not count entries.** A client sends an error in full only 3 times; after that it
|
|
94
|
+
counts the repeats and sends one `WARNING` summary per hour (and when the tab is hidden,
|
|
95
|
+
or on the user's next visit). Counting ERROR entries gives at most 3 per user, per
|
|
96
|
+
release, per hour — Cloud Error Reporting shows the same capped number.
|
|
97
|
+
|
|
98
|
+
The true count is the full copies plus the sum of `repeatCount`:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
labels.repeatKey="<key>" OR labels.repeatOf="<key>"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Take `repeatKey` from any full copy. Every entry this returns is one occurrence, except
|
|
105
|
+
summaries: each summary is `labels.repeatCount` occurrences, between `labels.firstSeen`
|
|
106
|
+
and `labels.lastSeen`. A summary is timestamped at `lastSeen`, and `sentLate="true"`
|
|
107
|
+
means it arrived on a later visit — it still belongs at its own time.
|
|
108
|
+
|
|
109
|
+
A summary has no stack and no breadcrumbs. For those, read one of the full copies.
|
|
110
|
+
|
|
111
|
+
## Shortened entries
|
|
112
|
+
|
|
113
|
+
Cloud Functions and Cloud Run cut a log line at 102,400 bytes, so the library shortens
|
|
114
|
+
any entry over 90 KiB before writing it: breadcrumb data, then other context, then the
|
|
115
|
+
tail of the stack. Such an entry carries `labels.truncated="true"`, and when Storage is
|
|
116
|
+
configured `labels.hasAttachments="true"` — the whole original entry is saved as
|
|
117
|
+
`logAttachments/{logId}/fsl-overflow.json`. Read that file (see below) whenever the
|
|
118
|
+
context or breadcrumbs you need are missing from a truncated entry.
|
|
119
|
+
|
|
71
120
|
## Retrieving Attachments
|
|
72
121
|
|
|
73
122
|
When a log entry has `labels.hasAttachments = "true"`, files were uploaded to GCS alongside it.
|