@owlpane/node 0.1.6 → 0.1.7
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 +8 -0
- package/dist/debugger-agent.d.ts +82 -0
- package/dist/debugger-agent.js +386 -0
- package/dist/debugger-agent.js.map +1 -0
- package/dist/debugger-safe.d.ts +42 -0
- package/dist/debugger-safe.js +221 -0
- package/dist/debugger-safe.js.map +1 -0
- package/dist/debugger-worker.d.ts +1 -0
- package/dist/debugger-worker.js +32 -0
- package/dist/debugger-worker.js.map +1 -0
- package/dist/debugger.d.ts +27 -0
- package/dist/debugger.js +84 -0
- package/dist/debugger.js.map +1 -0
- package/dist/device.d.ts +16 -0
- package/dist/device.js +63 -0
- package/dist/device.js.map +1 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,8 +30,16 @@ node --import @owlpane/node/register dist/main.js
|
|
|
30
30
|
- **Privacy.** Query strings, cookies and authorization headers are removed at the gateway as well as here.
|
|
31
31
|
|
|
32
32
|
Track a background job: `await owlpane.job("nightly-report", "cron", {}, async () => { ... })`.
|
|
33
|
+
|
|
34
|
+
## IoT device fleets
|
|
35
|
+
|
|
36
|
+
Emit logs (or metrics) with attributes `owlpane.device.id` and `owlpane.device_fleet.id`, register the device in **Device fleets**, then run the observability scorecard. Example: `sdk/examples/apps/iot-device-simulator`.
|
|
33
37
|
Tag the signed-in user (opaque id only): `owlpane.setUser(user.id)`. Email and name are **not** recorded unless you opt in with `traceUserProfile: true` or `OWLPANE_TRACE_USER_PROFILE=1` (discouraged for production).
|
|
34
38
|
|
|
39
|
+
## Live debugger (opt-in)
|
|
40
|
+
|
|
41
|
+
`owlpane.start({ liveDebugger: { apiUrl: 'https://api.owlpane.com' } })` (or `OWLPANE_LIVE_DEBUGGER=1` with `OWLPANE_API_URL`) lets you set a probe on a file and line in the Owlpane console and get a snapshot of the local variables and call stack the next few times that line runs, without a redeploy. It runs on a worker thread, does nothing while no probe is active, refuses to start under `--inspect`, removes secrets before anything leaves the process (best effort: by name and by shape, see `api/docs/ops/live-debugger.md`), and resumes the service whatever happens to the agent. Node.js only; lines are those of the code V8 runs (no source maps).
|
|
42
|
+
|
|
35
43
|
## CPU profiling (opt-in)
|
|
36
44
|
|
|
37
45
|
`owlpane.start({ profiling: true })` or `OWLPANE_PROFILING=1` takes a 10-second V8 sampling profile (10 ms interval) every minute and sends the functions that used the most CPU as `profile.cpu` spans, which the Profiler page shows as a flame view. They use their own tracer, so `sampleRatio` never drops them. It profiles CPU only (no heap or allocation profile), and the overhead has not been measured: try it on one instance first. `shutdown()` ends the current window early and sends what it has.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export type Cdp = {
|
|
2
|
+
post(method: string, params?: Record<string, unknown>): Promise<any>;
|
|
3
|
+
on(event: string, handler: (params: any) => void): void;
|
|
4
|
+
};
|
|
5
|
+
export type ProbeSpec = {
|
|
6
|
+
id: string;
|
|
7
|
+
file: string;
|
|
8
|
+
line: number;
|
|
9
|
+
condition: string;
|
|
10
|
+
remaining: number;
|
|
11
|
+
expiresAt: string;
|
|
12
|
+
};
|
|
13
|
+
export type AgentOptions = {
|
|
14
|
+
apiUrl: string;
|
|
15
|
+
ingestKey: string;
|
|
16
|
+
service: string;
|
|
17
|
+
instance: string;
|
|
18
|
+
cdp: Cdp;
|
|
19
|
+
fetch?: typeof fetch;
|
|
20
|
+
now?: () => number;
|
|
21
|
+
/** Extra variable and property names (regular expressions) whose values are never read. */
|
|
22
|
+
redactKeys?: RegExp | null;
|
|
23
|
+
/** Fastest the same probe may capture again. Default 500 ms. */
|
|
24
|
+
minIntervalMs?: number;
|
|
25
|
+
/** Most captures in any 10 seconds, over all probes. Default 10. */
|
|
26
|
+
burst?: number;
|
|
27
|
+
/** Longest a capture may keep the thread paused. Default 150 ms. */
|
|
28
|
+
budgetMs?: number;
|
|
29
|
+
log?: (message: string) => void;
|
|
30
|
+
/** For the SDK's own tests: make a capture fail in a chosen way, to prove the thread is resumed. */
|
|
31
|
+
testFault?: "throw-after-pause" | "hang-after-pause" | "exit-after-pause";
|
|
32
|
+
/** Shortest wait between two polls whatever the API asks. Default 5000 ms. */
|
|
33
|
+
pollFloorMs?: number;
|
|
34
|
+
};
|
|
35
|
+
export declare class LiveDebuggerAgent {
|
|
36
|
+
private readonly o;
|
|
37
|
+
private readonly fetchFn;
|
|
38
|
+
private readonly now;
|
|
39
|
+
private active;
|
|
40
|
+
private byBreakpoint;
|
|
41
|
+
/** Every breakpoint this agent ever set. A pause already on its way when one is removed must still be resumed, or the thread stays stopped. */
|
|
42
|
+
private readonly everSet;
|
|
43
|
+
private readonly scripts;
|
|
44
|
+
private queue;
|
|
45
|
+
private recent;
|
|
46
|
+
private enabled;
|
|
47
|
+
private timer;
|
|
48
|
+
private failures;
|
|
49
|
+
private stopped;
|
|
50
|
+
private sendP;
|
|
51
|
+
/** How many captures were skipped for a limit, by reason, for the agent's own diagnostics. */
|
|
52
|
+
readonly skipped: {
|
|
53
|
+
interval: number;
|
|
54
|
+
burst: number;
|
|
55
|
+
budget: number;
|
|
56
|
+
spent: number;
|
|
57
|
+
};
|
|
58
|
+
constructor(options: AgentOptions);
|
|
59
|
+
private log;
|
|
60
|
+
start(firstDelayMs?: number): void;
|
|
61
|
+
stop(): Promise<void>;
|
|
62
|
+
private schedule;
|
|
63
|
+
private poll;
|
|
64
|
+
/** One round with the API. Returns how long to wait before the next. */
|
|
65
|
+
pollOnce(): Promise<number>;
|
|
66
|
+
private setEnabled;
|
|
67
|
+
private add;
|
|
68
|
+
private remove;
|
|
69
|
+
private resume;
|
|
70
|
+
onPaused(p: {
|
|
71
|
+
reason?: string;
|
|
72
|
+
hitBreakpoints?: string[];
|
|
73
|
+
callFrames?: any[];
|
|
74
|
+
}): Promise<void>;
|
|
75
|
+
/** Gives up on a read that is taking far longer than its budget, so the thread is resumed whatever the inspector is doing. */
|
|
76
|
+
private guarded;
|
|
77
|
+
private allow;
|
|
78
|
+
private capture;
|
|
79
|
+
/** Sends what is queued; if a send is already running, waits for it. */
|
|
80
|
+
sendQueued(): Promise<void>;
|
|
81
|
+
private drain;
|
|
82
|
+
}
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LiveDebuggerAgent = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The live debugger's agent. It runs on a worker thread and talks to the main thread's V8 inspector: it asks the Owlpane API which probes are
|
|
6
|
+
* active for this service, sets a breakpoint for each, and when one is hit it reads the local variables and the stack, makes them safe, resumes
|
|
7
|
+
* the thread, and sends the snapshot back. It is written against two small interfaces (`Cdp`, a fetch) so its logic is tested without a process.
|
|
8
|
+
*
|
|
9
|
+
* What it guarantees: the paused thread is always resumed (also when reading fails or takes too long); a value whose name looks like a secret is
|
|
10
|
+
* not read; nothing is sent that `makeSafe` did not pass; and with no active probe the debugger is switched off, so an idle agent costs nothing.
|
|
11
|
+
*/
|
|
12
|
+
const debugger_safe_1 = require("./debugger-safe");
|
|
13
|
+
const MAX_BATCH = 10;
|
|
14
|
+
const MAX_FRAMES = 12;
|
|
15
|
+
const MAX_QUEUE = 50;
|
|
16
|
+
/** Scopes whose variables are the function's own or what it captured; the module and global scopes are large and rarely what is wanted. */
|
|
17
|
+
const SCOPES = new Set(["local", "block", "catch", "closure"]);
|
|
18
|
+
const escapeRegex = (s) => s.replace(/[.*+?^${}()|[\]\\/]/g, "\\$&");
|
|
19
|
+
class LiveDebuggerAgent {
|
|
20
|
+
o;
|
|
21
|
+
fetchFn;
|
|
22
|
+
now;
|
|
23
|
+
active = new Map();
|
|
24
|
+
byBreakpoint = new Map();
|
|
25
|
+
/** Every breakpoint this agent ever set. A pause already on its way when one is removed must still be resumed, or the thread stays stopped. */
|
|
26
|
+
everSet = new Set();
|
|
27
|
+
scripts = new Map();
|
|
28
|
+
queue = [];
|
|
29
|
+
recent = [];
|
|
30
|
+
enabled = false;
|
|
31
|
+
timer;
|
|
32
|
+
failures = 0;
|
|
33
|
+
stopped = false;
|
|
34
|
+
sendP;
|
|
35
|
+
/** How many captures were skipped for a limit, by reason, for the agent's own diagnostics. */
|
|
36
|
+
skipped = { interval: 0, burst: 0, budget: 0, spent: 0 };
|
|
37
|
+
constructor(options) {
|
|
38
|
+
this.o = { minIntervalMs: 500, burst: 10, budgetMs: 150, ...options };
|
|
39
|
+
this.fetchFn = options.fetch ?? fetch;
|
|
40
|
+
this.now = options.now ?? Date.now;
|
|
41
|
+
options.cdp.on("Debugger.paused", (p) => void this.onPaused(p));
|
|
42
|
+
// Newer V8 versions leave the script's URL off a call frame; it is kept from the moment the script is parsed.
|
|
43
|
+
options.cdp.on("Debugger.scriptParsed", (p) => {
|
|
44
|
+
if (p?.scriptId && p.url) {
|
|
45
|
+
if (this.scripts.size >= 20_000)
|
|
46
|
+
this.scripts.delete(this.scripts.keys().next().value);
|
|
47
|
+
this.scripts.set(p.scriptId, p.url);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
log(m) {
|
|
52
|
+
this.o.log?.(m);
|
|
53
|
+
}
|
|
54
|
+
// ---- probes ----------------------------------------------------------------------------------------------------------------------
|
|
55
|
+
start(firstDelayMs = 0) {
|
|
56
|
+
this.stopped = false;
|
|
57
|
+
this.schedule(firstDelayMs);
|
|
58
|
+
}
|
|
59
|
+
async stop() {
|
|
60
|
+
this.stopped = true;
|
|
61
|
+
if (this.timer)
|
|
62
|
+
clearTimeout(this.timer);
|
|
63
|
+
for (const a of [...this.active.values()])
|
|
64
|
+
await this.remove(a);
|
|
65
|
+
await this.sendQueued();
|
|
66
|
+
await this.setEnabled(false);
|
|
67
|
+
}
|
|
68
|
+
schedule(ms) {
|
|
69
|
+
if (this.stopped)
|
|
70
|
+
return;
|
|
71
|
+
this.timer = setTimeout(() => void this.poll(), ms);
|
|
72
|
+
this.timer.unref?.();
|
|
73
|
+
}
|
|
74
|
+
async poll() {
|
|
75
|
+
let next = 15_000;
|
|
76
|
+
try {
|
|
77
|
+
next = await this.pollOnce();
|
|
78
|
+
this.failures = 0;
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
this.failures++;
|
|
82
|
+
// 15 s, 30 s, 60 s ... up to 5 minutes, so an API that is down or refusing is not hammered.
|
|
83
|
+
next = Math.min(300_000, 15_000 * 2 ** Math.min(this.failures, 5));
|
|
84
|
+
this.log(`probe poll failed (${e.message}); trying again in ${Math.round(next / 1000)} s`);
|
|
85
|
+
}
|
|
86
|
+
this.schedule(next);
|
|
87
|
+
}
|
|
88
|
+
/** One round with the API. Returns how long to wait before the next. */
|
|
89
|
+
async pollOnce() {
|
|
90
|
+
const res = await this.fetchFn(`${this.o.apiUrl.replace(/\/+$/, "")}/v1/debugger/agent/probes?service=${encodeURIComponent(this.o.service)}`, {
|
|
91
|
+
headers: { authorization: `Bearer ${this.o.ingestKey}` },
|
|
92
|
+
signal: AbortSignal.timeout(5000),
|
|
93
|
+
});
|
|
94
|
+
if (!res.ok)
|
|
95
|
+
throw new Error(`HTTP ${res.status}`);
|
|
96
|
+
const body = (await res.json());
|
|
97
|
+
const probes = Array.isArray(body.probes) ? body.probes : [];
|
|
98
|
+
const wanted = new Map(probes.map((p) => [p.id, p]));
|
|
99
|
+
for (const a of [...this.active.values()])
|
|
100
|
+
if (!wanted.has(a.spec.id))
|
|
101
|
+
await this.remove(a);
|
|
102
|
+
for (const p of probes)
|
|
103
|
+
if (!this.active.has(p.id))
|
|
104
|
+
await this.add(p);
|
|
105
|
+
await this.setEnabled(this.active.size > 0);
|
|
106
|
+
return Math.min(300_000, Math.max(this.o.pollFloorMs ?? 5_000, (Number(body.pollAfterSeconds) || 15) * 1000));
|
|
107
|
+
}
|
|
108
|
+
async setEnabled(on) {
|
|
109
|
+
if (on === this.enabled)
|
|
110
|
+
return;
|
|
111
|
+
this.enabled = on;
|
|
112
|
+
await this.o.cdp.post(on ? "Debugger.enable" : "Debugger.disable");
|
|
113
|
+
}
|
|
114
|
+
async add(spec) {
|
|
115
|
+
let condition = "";
|
|
116
|
+
try {
|
|
117
|
+
// The condition is parsed again here and the code is built from its tokens: a probe from a modified server cannot run anything else.
|
|
118
|
+
condition = (0, debugger_safe_1.conditionCode)((0, debugger_safe_1.parseCondition)(spec.condition || ""));
|
|
119
|
+
}
|
|
120
|
+
catch (e) {
|
|
121
|
+
this.log(`probe ${spec.id} ignored: ${e.message}`);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (!/^[A-Za-z0-9_@.\-/]+$/.test(spec.file) || spec.file.split("/").some((part) => part === ".." || part === "") || !Number.isInteger(spec.line) || spec.line < 1) {
|
|
125
|
+
this.log(`probe ${spec.id} ignored: bad location`);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
// Debugger must be on before a breakpoint is set.
|
|
129
|
+
await this.setEnabled(true);
|
|
130
|
+
try {
|
|
131
|
+
const r = await this.o.cdp.post("Debugger.setBreakpointByUrl", { lineNumber: spec.line - 1, urlRegex: `(^|[\\\\/])${escapeRegex(spec.file).replace(/\\\//g, "[\\\\/]")}$`, condition });
|
|
132
|
+
const a = { spec, breakpointId: String(r.breakpointId), remaining: Math.max(0, spec.remaining), lastAt: 0, expiresAt: Date.parse(spec.expiresAt) || this.now() + 60_000 };
|
|
133
|
+
this.active.set(spec.id, a);
|
|
134
|
+
this.byBreakpoint.set(a.breakpointId, a);
|
|
135
|
+
this.everSet.add(a.breakpointId);
|
|
136
|
+
}
|
|
137
|
+
catch (e) {
|
|
138
|
+
this.log(`probe ${spec.id} not set: ${e.message}`);
|
|
139
|
+
await this.setEnabled(this.active.size > 0);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async remove(a) {
|
|
143
|
+
this.active.delete(a.spec.id);
|
|
144
|
+
this.byBreakpoint.delete(a.breakpointId);
|
|
145
|
+
try {
|
|
146
|
+
await this.o.cdp.post("Debugger.removeBreakpoint", { breakpointId: a.breakpointId });
|
|
147
|
+
}
|
|
148
|
+
catch (e) {
|
|
149
|
+
this.log(`breakpoint not removed: ${e.message}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// ---- a hit -----------------------------------------------------------------------------------------------------------------------
|
|
153
|
+
async resume() {
|
|
154
|
+
try {
|
|
155
|
+
await this.o.cdp.post("Debugger.resume");
|
|
156
|
+
}
|
|
157
|
+
catch (e) {
|
|
158
|
+
this.log(`resume failed: ${e.message}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
async onPaused(p) {
|
|
162
|
+
const hits = (p.hitBreakpoints ?? []).filter((id) => this.byBreakpoint.has(id));
|
|
163
|
+
// A `debugger;` statement in the app pauses every enabled debugger; with nobody to resume it the process would stop for good.
|
|
164
|
+
if (!hits.length) {
|
|
165
|
+
const hit = p.hitBreakpoints ?? [];
|
|
166
|
+
const mine = hit.length > 0 && hit.every((id) => this.everSet.has(id));
|
|
167
|
+
if (p.reason === "debugCommand" || (p.reason === "other" && !hit.length) || mine)
|
|
168
|
+
await this.resume();
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const a = this.byBreakpoint.get(hits[0]);
|
|
172
|
+
const started = this.now();
|
|
173
|
+
let snapshot;
|
|
174
|
+
try {
|
|
175
|
+
const reason = this.allow(a, started);
|
|
176
|
+
if (reason)
|
|
177
|
+
this.skipped[reason]++;
|
|
178
|
+
else
|
|
179
|
+
snapshot = await this.guarded(this.capture(a, p.callFrames ?? [], started), this.o.budgetMs * 2);
|
|
180
|
+
}
|
|
181
|
+
catch (e) {
|
|
182
|
+
this.log(`capture failed: ${e.message}`);
|
|
183
|
+
}
|
|
184
|
+
finally {
|
|
185
|
+
await this.resume();
|
|
186
|
+
}
|
|
187
|
+
if (snapshot) {
|
|
188
|
+
a.remaining--;
|
|
189
|
+
a.lastAt = started;
|
|
190
|
+
this.recent.push(started);
|
|
191
|
+
if (this.queue.length < MAX_QUEUE)
|
|
192
|
+
this.queue.push(snapshot);
|
|
193
|
+
if (a.remaining <= 0) {
|
|
194
|
+
await this.remove(a);
|
|
195
|
+
await this.setEnabled(this.active.size > 0);
|
|
196
|
+
}
|
|
197
|
+
void this.sendQueued();
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/** Gives up on a read that is taking far longer than its budget, so the thread is resumed whatever the inspector is doing. */
|
|
201
|
+
guarded(work, ms) {
|
|
202
|
+
return new Promise((resolve, reject) => {
|
|
203
|
+
const t = setTimeout(() => {
|
|
204
|
+
this.skipped.budget++;
|
|
205
|
+
this.log(`capture gave up after ${ms} ms`);
|
|
206
|
+
resolve(undefined);
|
|
207
|
+
}, ms);
|
|
208
|
+
work.then((v) => { clearTimeout(t); resolve(v); }, (e) => { clearTimeout(t); reject(e); });
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
allow(a, at) {
|
|
212
|
+
if (a.remaining <= 0 || at >= a.expiresAt)
|
|
213
|
+
return "spent";
|
|
214
|
+
if (at - a.lastAt < this.o.minIntervalMs)
|
|
215
|
+
return "interval";
|
|
216
|
+
this.recent = this.recent.filter((t) => at - t < 10_000);
|
|
217
|
+
if (this.recent.length >= this.o.burst)
|
|
218
|
+
return "burst";
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
async capture(a, frames, started) {
|
|
222
|
+
if (this.o.testFault === "exit-after-pause")
|
|
223
|
+
process.exit(1);
|
|
224
|
+
if (this.o.testFault === "hang-after-pause")
|
|
225
|
+
await new Promise(() => undefined);
|
|
226
|
+
if (this.o.testFault === "throw-after-pause")
|
|
227
|
+
throw new Error("injected fault");
|
|
228
|
+
const top = frames[0];
|
|
229
|
+
if (!top)
|
|
230
|
+
return undefined;
|
|
231
|
+
const deadline = started + this.o.budgetMs;
|
|
232
|
+
const reader = new Reader(this.o.cdp, this.o.redactKeys ?? null, () => this.now() < deadline);
|
|
233
|
+
const variables = {};
|
|
234
|
+
for (const scope of top.scopeChain ?? []) {
|
|
235
|
+
if (!SCOPES.has(scope.type) || !scope.object?.objectId)
|
|
236
|
+
continue;
|
|
237
|
+
const props = await reader.properties(scope.object.objectId);
|
|
238
|
+
for (const pr of props) {
|
|
239
|
+
if (!(pr.name in variables) && !pr.name.startsWith("__") && Object.keys(variables).length < 60)
|
|
240
|
+
variables[pr.name] = await reader.value(pr, 0);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (top.this && top.this.type === "object" && top.this.subtype !== "null")
|
|
244
|
+
variables["this"] = await reader.value({ name: "this", value: top.this }, 0);
|
|
245
|
+
const stack = frames.slice(0, MAX_FRAMES).map((f) => ({ function: String(f.functionName || "(anonymous)"), file: cleanPath(String(f.url || this.scripts.get(String(f.location?.scriptId)) || "")), line: Number(f.location?.lineNumber ?? 0) + 1 }));
|
|
246
|
+
return {
|
|
247
|
+
probeId: a.spec.id,
|
|
248
|
+
capturedAt: started,
|
|
249
|
+
function: stack[0]?.function ?? "",
|
|
250
|
+
file: stack[0]?.file ?? a.spec.file,
|
|
251
|
+
line: stack[0]?.line ?? a.spec.line,
|
|
252
|
+
// Everything captured goes through the same function the API applies again.
|
|
253
|
+
variables: (0, debugger_safe_1.makeSafe)(variables, this.o.redactKeys ?? null),
|
|
254
|
+
stack,
|
|
255
|
+
durationMs: Math.round((this.now() - started) * 100) / 100,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
// ---- sending ---------------------------------------------------------------------------------------------------------------------
|
|
259
|
+
/** Sends what is queued; if a send is already running, waits for it. */
|
|
260
|
+
sendQueued() {
|
|
261
|
+
if (!this.sendP)
|
|
262
|
+
this.sendP = this.drain().finally(() => { this.sendP = undefined; });
|
|
263
|
+
return this.sendP;
|
|
264
|
+
}
|
|
265
|
+
async drain() {
|
|
266
|
+
try {
|
|
267
|
+
while (this.queue.length) {
|
|
268
|
+
const batch = this.queue.splice(0, MAX_BATCH);
|
|
269
|
+
let ok = false;
|
|
270
|
+
for (let attempt = 0; attempt < 3 && !ok; attempt++) {
|
|
271
|
+
try {
|
|
272
|
+
const res = await this.fetchFn(`${this.o.apiUrl.replace(/\/+$/, "")}/v1/debugger/agent/snapshots`, {
|
|
273
|
+
method: "POST",
|
|
274
|
+
headers: { authorization: `Bearer ${this.o.ingestKey}`, "content-type": "application/json" },
|
|
275
|
+
body: JSON.stringify({ service: this.o.service, instance: this.o.instance, snapshots: batch }),
|
|
276
|
+
signal: AbortSignal.timeout(8000),
|
|
277
|
+
});
|
|
278
|
+
if (res.status === 429 || res.status >= 500)
|
|
279
|
+
throw new Error(`HTTP ${res.status}`);
|
|
280
|
+
ok = true;
|
|
281
|
+
if (res.ok) {
|
|
282
|
+
const r = (await res.json());
|
|
283
|
+
// A probe the server no longer runs is dropped here without waiting for the next poll.
|
|
284
|
+
for (const x of r.rejected ?? []) {
|
|
285
|
+
const gone = x.probeId ? this.active.get(x.probeId) : undefined;
|
|
286
|
+
if (gone)
|
|
287
|
+
await this.remove(gone);
|
|
288
|
+
}
|
|
289
|
+
await this.setEnabled(this.active.size > 0);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
catch (e) {
|
|
293
|
+
if (attempt === 2)
|
|
294
|
+
this.log(`snapshots dropped: ${e.message}`);
|
|
295
|
+
else
|
|
296
|
+
await new Promise((r) => setTimeout(r, 500 * 2 ** attempt));
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
finally {
|
|
302
|
+
// nothing to release: the promise itself says a send is running
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
exports.LiveDebuggerAgent = LiveDebuggerAgent;
|
|
307
|
+
function cleanPath(url) {
|
|
308
|
+
const p = url.startsWith("file://") ? decodeURIComponent(url.slice(7)) : url;
|
|
309
|
+
return (0, debugger_safe_1.redactString)(p).slice(0, 300);
|
|
310
|
+
}
|
|
311
|
+
/** Reads values out of the paused thread through the inspector, within a node budget and a time budget. */
|
|
312
|
+
class Reader {
|
|
313
|
+
cdp;
|
|
314
|
+
extra;
|
|
315
|
+
hasTime;
|
|
316
|
+
nodes = debugger_safe_1.VALUE_LIMITS.nodes;
|
|
317
|
+
constructor(cdp, extra, hasTime) {
|
|
318
|
+
this.cdp = cdp;
|
|
319
|
+
this.extra = extra;
|
|
320
|
+
this.hasTime = hasTime;
|
|
321
|
+
}
|
|
322
|
+
async properties(objectId) {
|
|
323
|
+
const r = await this.cdp.post("Runtime.getProperties", { objectId, ownProperties: true, generatePreview: false });
|
|
324
|
+
return (r.result ?? []);
|
|
325
|
+
}
|
|
326
|
+
/** A property as plain data. Accessors are not run; secrets by name are not read; what is deeper than the limits is described, not read. */
|
|
327
|
+
async value(prop, depth) {
|
|
328
|
+
if ((0, debugger_safe_1.isSecretKey)(prop.name, this.extra))
|
|
329
|
+
return prop.value?.type === "undefined" || prop.value?.subtype === "null" ? null : "[redacted]";
|
|
330
|
+
if (--this.nodes < 0 || !this.hasTime())
|
|
331
|
+
return "[truncated]";
|
|
332
|
+
if (!prop.value)
|
|
333
|
+
return prop.get ? "[Getter]" : "[unreadable]";
|
|
334
|
+
return this.remote(prop.value, depth);
|
|
335
|
+
}
|
|
336
|
+
async remote(o, depth) {
|
|
337
|
+
switch (o.type) {
|
|
338
|
+
case "string":
|
|
339
|
+
return String(o.value);
|
|
340
|
+
case "number":
|
|
341
|
+
return o.unserializableValue ?? o.value;
|
|
342
|
+
case "boolean":
|
|
343
|
+
return o.value;
|
|
344
|
+
case "undefined":
|
|
345
|
+
return undefined;
|
|
346
|
+
case "bigint":
|
|
347
|
+
return o.unserializableValue ?? o.description;
|
|
348
|
+
case "symbol":
|
|
349
|
+
return "[Symbol]";
|
|
350
|
+
case "function":
|
|
351
|
+
return "[Function]";
|
|
352
|
+
}
|
|
353
|
+
if (o.subtype === "null")
|
|
354
|
+
return null;
|
|
355
|
+
if (o.subtype === "date")
|
|
356
|
+
return String(o.description ?? "[Date]");
|
|
357
|
+
if (o.subtype === "error")
|
|
358
|
+
return { name: String(o.className ?? "Error"), message: String(o.description ?? "").split("\n")[0].replace(/^[A-Za-z]*Error:\s*/, "") };
|
|
359
|
+
if (o.subtype === "map" || o.subtype === "set" || o.subtype === "weakmap" || o.subtype === "weakset" || o.subtype === "promise" || o.subtype === "regexp" || o.subtype === "typedarray" || o.subtype === "arraybuffer" || o.subtype === "proxy") {
|
|
360
|
+
return `[${String(o.description ?? o.className ?? "Object")}]`;
|
|
361
|
+
}
|
|
362
|
+
if (!o.objectId)
|
|
363
|
+
return String(o.description ?? "[Object]");
|
|
364
|
+
const isArray = o.subtype === "array";
|
|
365
|
+
if (depth >= debugger_safe_1.VALUE_LIMITS.depth)
|
|
366
|
+
return isArray ? String(o.description ?? "[Array]").replace(/^Array/, "[Array") + "]" : "[Object]";
|
|
367
|
+
const props = (await this.properties(o.objectId)).filter((p) => p.name !== "__proto__");
|
|
368
|
+
if (isArray) {
|
|
369
|
+
const items = props.filter((p) => /^\d+$/.test(p.name)).sort((a, b) => Number(a.name) - Number(b.name));
|
|
370
|
+
const out = [];
|
|
371
|
+
for (const p of items.slice(0, debugger_safe_1.VALUE_LIMITS.items))
|
|
372
|
+
out.push(await this.value({ ...p, name: "" }, depth + 1));
|
|
373
|
+
if (items.length > debugger_safe_1.VALUE_LIMITS.items)
|
|
374
|
+
out.push(`…(+${items.length - debugger_safe_1.VALUE_LIMITS.items} more)`);
|
|
375
|
+
return out;
|
|
376
|
+
}
|
|
377
|
+
const own = props.filter((p) => p.enumerable !== false);
|
|
378
|
+
const out = {};
|
|
379
|
+
for (const p of own.slice(0, debugger_safe_1.VALUE_LIMITS.keys))
|
|
380
|
+
out[p.name.slice(0, 80)] = await this.value(p, depth + 1);
|
|
381
|
+
if (own.length > debugger_safe_1.VALUE_LIMITS.keys)
|
|
382
|
+
out["…"] = `${own.length - debugger_safe_1.VALUE_LIMITS.keys} more`;
|
|
383
|
+
return out;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
//# sourceMappingURL=debugger-agent.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C,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;QAC3G,IAAI,GAAG,CAAC,MAAM,GAAG,4BAAY,CAAC,IAAI;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,GAAG,4BAAY,CAAC,IAAI,OAAO,CAAC;QACxF,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parts of the live debugger that run inside the service: the condition language a probe may use and the redaction applied to
|
|
3
|
+
* everything captured, before it leaves the process. This is a copy of the same functions in the API (`api/src/product/live-debugger.ts`,
|
|
4
|
+
* which applies them again to whatever an agent sends); `api/test/live-debugger-sdk-parity.test.ts` runs both on one corpus and fails if
|
|
5
|
+
* they ever differ. Change both together.
|
|
6
|
+
*/
|
|
7
|
+
export declare class BadProbe extends Error {
|
|
8
|
+
}
|
|
9
|
+
/** Limits applied to a captured value. */
|
|
10
|
+
export declare const VALUE_LIMITS: {
|
|
11
|
+
readonly depth: 4;
|
|
12
|
+
readonly keys: 25;
|
|
13
|
+
readonly items: 15;
|
|
14
|
+
readonly string: 256;
|
|
15
|
+
readonly nodes: 500;
|
|
16
|
+
};
|
|
17
|
+
export type Clause = {
|
|
18
|
+
path: string[];
|
|
19
|
+
op: "==" | "!=" | "<" | "<=" | ">" | ">=";
|
|
20
|
+
value: string | number | boolean | null;
|
|
21
|
+
};
|
|
22
|
+
export declare function parseCondition(text: string): Clause[];
|
|
23
|
+
/** The condition in one fixed spelling, so the same condition always reads and stores the same way. */
|
|
24
|
+
export declare function canonicalCondition(v: unknown): string;
|
|
25
|
+
/**
|
|
26
|
+
* The code V8 evaluates at the line, built from the parsed tokens. It reads variables and properties only (optional chaining, so a missing
|
|
27
|
+
* one is `undefined`), compares with `===` / `!==` / `<` ..., and returns false if anything throws.
|
|
28
|
+
*/
|
|
29
|
+
export declare function conditionCode(clauses: Clause[]): string;
|
|
30
|
+
/** Whether a property or variable name says its value is a secret (so the value is not even read). */
|
|
31
|
+
export declare const isSecretKey: (key: string, extra?: RegExp | null) => boolean;
|
|
32
|
+
/** A string with credentials, card numbers, email addresses and URL passwords taken out, and cut to the length a snapshot keeps. */
|
|
33
|
+
export declare function redactString(s: string): string;
|
|
34
|
+
export type Safe = string | number | boolean | null | Safe[] | {
|
|
35
|
+
[k: string]: Safe;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A value made safe to keep: secrets by key name or by shape removed, strings, depth, keys, array items and total size capped, and
|
|
39
|
+
* anything that is not plain data (functions, symbols, class instances' internals beyond their own enumerable fields) shown by type only.
|
|
40
|
+
* Applied by the SDK before a value leaves the process and again here, so a modified or older agent cannot send more than this allows.
|
|
41
|
+
*/
|
|
42
|
+
export declare function makeSafe(value: unknown, extraSecretKeys?: RegExp | null): Safe;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The parts of the live debugger that run inside the service: the condition language a probe may use and the redaction applied to
|
|
4
|
+
* everything captured, before it leaves the process. This is a copy of the same functions in the API (`api/src/product/live-debugger.ts`,
|
|
5
|
+
* which applies them again to whatever an agent sends); `api/test/live-debugger-sdk-parity.test.ts` runs both on one corpus and fails if
|
|
6
|
+
* they ever differ. Change both together.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.isSecretKey = exports.VALUE_LIMITS = exports.BadProbe = void 0;
|
|
10
|
+
exports.parseCondition = parseCondition;
|
|
11
|
+
exports.canonicalCondition = canonicalCondition;
|
|
12
|
+
exports.conditionCode = conditionCode;
|
|
13
|
+
exports.redactString = redactString;
|
|
14
|
+
exports.makeSafe = makeSafe;
|
|
15
|
+
class BadProbe extends Error {
|
|
16
|
+
}
|
|
17
|
+
exports.BadProbe = BadProbe;
|
|
18
|
+
/** Limits applied to a captured value. */
|
|
19
|
+
exports.VALUE_LIMITS = { depth: 4, keys: 25, items: 15, string: 256, nodes: 500 };
|
|
20
|
+
const IDENT = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
21
|
+
/** Names that would let a condition reach the object model's internals. */
|
|
22
|
+
const FORBIDDEN_NAMES = new Set(["__proto__", "constructor", "prototype", "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__"]);
|
|
23
|
+
function parseCondition(text) {
|
|
24
|
+
const src = text.trim();
|
|
25
|
+
if (!src)
|
|
26
|
+
return [];
|
|
27
|
+
if (src.length > 300)
|
|
28
|
+
throw new BadProbe("condition: at most 300 characters");
|
|
29
|
+
const parts = src.split("&&");
|
|
30
|
+
if (parts.length > 3)
|
|
31
|
+
throw new BadProbe("condition: at most three clauses joined by &&");
|
|
32
|
+
return parts.map((p) => parseClause(p.trim()));
|
|
33
|
+
}
|
|
34
|
+
function parseClause(c) {
|
|
35
|
+
const m = /^([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*){0,3})\s*(==|!=|<=|>=|<|>)\s*(.+)$/.exec(c);
|
|
36
|
+
if (!m)
|
|
37
|
+
throw new BadProbe(`condition: "${c.slice(0, 60)}" is not "name.path == value" (operators == != < <= > >=)`);
|
|
38
|
+
const path = m[1].split(".");
|
|
39
|
+
for (const n of path)
|
|
40
|
+
if (!IDENT.test(n) || FORBIDDEN_NAMES.has(n))
|
|
41
|
+
throw new BadProbe(`condition: "${n}" cannot be used in a condition`);
|
|
42
|
+
const lit = m[3].trim();
|
|
43
|
+
let value;
|
|
44
|
+
if (/^-?\d+(\.\d+)?$/.test(lit)) {
|
|
45
|
+
value = Number(lit);
|
|
46
|
+
if (!Number.isFinite(value))
|
|
47
|
+
throw new BadProbe("condition: number out of range");
|
|
48
|
+
}
|
|
49
|
+
else if (lit === "true" || lit === "false")
|
|
50
|
+
value = lit === "true";
|
|
51
|
+
else if (lit === "null")
|
|
52
|
+
value = null;
|
|
53
|
+
else {
|
|
54
|
+
const s = /^'([^'\\\n\r]{0,64})'$/.exec(lit) ?? /^"([^"\\\n\r]{0,64})"$/.exec(lit);
|
|
55
|
+
if (!s)
|
|
56
|
+
throw new BadProbe("condition: a value is a number, 'text' (up to 64 characters, no backslash), true, false or null");
|
|
57
|
+
value = s[1];
|
|
58
|
+
}
|
|
59
|
+
const op = m[2];
|
|
60
|
+
if ((op === "<" || op === "<=" || op === ">" || op === ">=") && typeof value !== "number")
|
|
61
|
+
throw new BadProbe("condition: < <= > >= compare numbers");
|
|
62
|
+
return { path, op, value };
|
|
63
|
+
}
|
|
64
|
+
/** The condition in one fixed spelling, so the same condition always reads and stores the same way. */
|
|
65
|
+
function canonicalCondition(v) {
|
|
66
|
+
if (typeof v !== "string")
|
|
67
|
+
throw new BadProbe("condition: must be text");
|
|
68
|
+
return parseCondition(v).map((c) => `${c.path.join(".")} ${c.op} ${typeof c.value === "string" ? `'${c.value}'` : String(c.value)}`).join(" && ");
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The code V8 evaluates at the line, built from the parsed tokens. It reads variables and properties only (optional chaining, so a missing
|
|
72
|
+
* one is `undefined`), compares with `===` / `!==` / `<` ..., and returns false if anything throws.
|
|
73
|
+
*/
|
|
74
|
+
function conditionCode(clauses) {
|
|
75
|
+
if (!clauses.length)
|
|
76
|
+
return "";
|
|
77
|
+
const parts = clauses.map((c) => {
|
|
78
|
+
const read = c.path.length === 1 ? `typeof ${c.path[0]} === 'undefined' ? undefined : ${c.path[0]}` : `typeof ${c.path[0]} === 'undefined' ? undefined : ${c.path[0]}${c.path.slice(1).map((p) => `?.${p}`).join("")}`;
|
|
79
|
+
const op = c.op === "==" ? "===" : c.op === "!=" ? "!==" : c.op;
|
|
80
|
+
return `((${read}) ${op} ${JSON.stringify(c.value)})`;
|
|
81
|
+
});
|
|
82
|
+
return `(() => { try { return ${parts.join(" && ")}; } catch (_) { return false; } })()`;
|
|
83
|
+
}
|
|
84
|
+
// ---- making a captured value safe to keep -----------------------------------------------------------------------------------------
|
|
85
|
+
/** A key whose value is never kept, whatever it holds. */
|
|
86
|
+
const SECRET_KEY = /pass(word|wd|phrase)?|secret|token|api[-_]?key|apikey|auth|cookie|session|credential|private|signature|ssn|social[-_]?security|card|cvv|cvc|iban|account[-_]?number|bearer|jwt|otp|(^|[_-])pin$|salt|hash$/i;
|
|
87
|
+
/** Whether a property or variable name says its value is a secret (so the value is not even read). */
|
|
88
|
+
const isSecretKey = (key, extra = null) => SECRET_KEY.test(key) || Boolean(extra?.test(key));
|
|
89
|
+
exports.isSecretKey = isSecretKey;
|
|
90
|
+
/** A string that looks like a credential or personal data is replaced, whatever key it sits under. */
|
|
91
|
+
const SECRET_VALUE = [
|
|
92
|
+
[/eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]*/, "[redacted]"],
|
|
93
|
+
[/\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/i, "[redacted]"],
|
|
94
|
+
[/\bBasic\s+[A-Za-z0-9+/=]{8,}/i, "[redacted]"],
|
|
95
|
+
[/\bowl_[a-z]{2,8}_[A-Za-z0-9]{8,}/, "[redacted]"],
|
|
96
|
+
[/\b(AKIA|ASIA)[0-9A-Z]{16}\b/, "[redacted]"],
|
|
97
|
+
[/\b(sk|pk|rk)_(live|test)_[A-Za-z0-9]{8,}/, "[redacted]"],
|
|
98
|
+
[/\bgh[pousr]_[A-Za-z0-9]{20,}/, "[redacted]"],
|
|
99
|
+
[/\bxox[abprs]-[A-Za-z0-9-]{10,}/, "[redacted]"],
|
|
100
|
+
[/-----BEGIN [A-Z ]*PRIVATE KEY-----/, "[redacted]"],
|
|
101
|
+
[/\b[0-9a-f]{40,}\b/i, "[redacted]"],
|
|
102
|
+
];
|
|
103
|
+
const EMAIL = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g;
|
|
104
|
+
const URL_CREDENTIALS = /\b([a-z][a-z0-9+.-]*:\/\/)[^\s/@:]+:[^\s/@]+@/gi;
|
|
105
|
+
const CARD_CANDIDATE = /\b(?:\d[ -]?){12,18}\d\b/g;
|
|
106
|
+
const luhn = (digits) => {
|
|
107
|
+
let sum = 0;
|
|
108
|
+
let dbl = false;
|
|
109
|
+
for (let i = digits.length - 1; i >= 0; i--) {
|
|
110
|
+
let d = digits.charCodeAt(i) - 48;
|
|
111
|
+
if (dbl) {
|
|
112
|
+
d *= 2;
|
|
113
|
+
if (d > 9)
|
|
114
|
+
d -= 9;
|
|
115
|
+
}
|
|
116
|
+
sum += d;
|
|
117
|
+
dbl = !dbl;
|
|
118
|
+
}
|
|
119
|
+
return sum % 10 === 0;
|
|
120
|
+
};
|
|
121
|
+
/** A string with credentials, card numbers, email addresses and URL passwords taken out, and cut to the length a snapshot keeps. */
|
|
122
|
+
function redactString(s) {
|
|
123
|
+
for (const [re, to] of SECRET_VALUE)
|
|
124
|
+
if (re.test(s))
|
|
125
|
+
return to;
|
|
126
|
+
let out = s.replace(URL_CREDENTIALS, "$1[redacted]@").replace(EMAIL, "[email]");
|
|
127
|
+
out = out.replace(CARD_CANDIDATE, (m) => {
|
|
128
|
+
const digits = m.replace(/[ -]/g, "");
|
|
129
|
+
return digits.length >= 13 && digits.length <= 19 && luhn(digits) ? "[card]" : m;
|
|
130
|
+
});
|
|
131
|
+
// A string an earlier pass already cut ends in its own marker; it is left as it is, so applying this twice gives what applying it once does.
|
|
132
|
+
if (out.length <= exports.VALUE_LIMITS.string + 24 && /^.{256}…\(\+\d+\)$/s.test(out))
|
|
133
|
+
return out;
|
|
134
|
+
return out.length > exports.VALUE_LIMITS.string ? `${out.slice(0, exports.VALUE_LIMITS.string)}…(+${out.length - exports.VALUE_LIMITS.string})` : out;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* A value made safe to keep: secrets by key name or by shape removed, strings, depth, keys, array items and total size capped, and
|
|
138
|
+
* anything that is not plain data (functions, symbols, class instances' internals beyond their own enumerable fields) shown by type only.
|
|
139
|
+
* Applied by the SDK before a value leaves the process and again here, so a modified or older agent cannot send more than this allows.
|
|
140
|
+
*/
|
|
141
|
+
function makeSafe(value, extraSecretKeys = null) {
|
|
142
|
+
const budget = { nodes: exports.VALUE_LIMITS.nodes };
|
|
143
|
+
const seen = new WeakSet();
|
|
144
|
+
const walk = (v, depth, key) => {
|
|
145
|
+
if (--budget.nodes < 0)
|
|
146
|
+
return "[truncated]";
|
|
147
|
+
if (key && (SECRET_KEY.test(key) || extraSecretKeys?.test(key)))
|
|
148
|
+
return v === undefined || v === null ? null : "[redacted]";
|
|
149
|
+
switch (typeof v) {
|
|
150
|
+
case "string":
|
|
151
|
+
return redactString(v);
|
|
152
|
+
case "number":
|
|
153
|
+
return Number.isFinite(v) ? v : String(v);
|
|
154
|
+
case "boolean":
|
|
155
|
+
return v;
|
|
156
|
+
case "bigint":
|
|
157
|
+
return `${v}n`;
|
|
158
|
+
case "undefined":
|
|
159
|
+
return "[undefined]";
|
|
160
|
+
case "symbol":
|
|
161
|
+
return "[Symbol]";
|
|
162
|
+
case "function":
|
|
163
|
+
return "[Function]";
|
|
164
|
+
}
|
|
165
|
+
if (v === null)
|
|
166
|
+
return null;
|
|
167
|
+
const o = v;
|
|
168
|
+
if (seen.has(o))
|
|
169
|
+
return "[Circular]";
|
|
170
|
+
if (depth >= exports.VALUE_LIMITS.depth)
|
|
171
|
+
return Array.isArray(o) ? `[Array(${o.length})]` : "[Object]";
|
|
172
|
+
seen.add(o);
|
|
173
|
+
try {
|
|
174
|
+
if (Array.isArray(o)) {
|
|
175
|
+
// An array an earlier pass already cut ends in its own "…(+N more)" marker; the count carries over instead of being counted again.
|
|
176
|
+
let src = o;
|
|
177
|
+
let earlier = 0;
|
|
178
|
+
const last = src[src.length - 1];
|
|
179
|
+
const marked = typeof last === "string" ? /^…\(\+(\d+) more\)$/.exec(last) : null;
|
|
180
|
+
if (marked) {
|
|
181
|
+
earlier = Number(marked[1]);
|
|
182
|
+
src = src.slice(0, -1);
|
|
183
|
+
}
|
|
184
|
+
const out = src.slice(0, exports.VALUE_LIMITS.items).map((x) => walk(x, depth + 1, ""));
|
|
185
|
+
const more = earlier + Math.max(0, src.length - exports.VALUE_LIMITS.items);
|
|
186
|
+
if (more > 0)
|
|
187
|
+
out.push(`…(+${more} more)`);
|
|
188
|
+
return out;
|
|
189
|
+
}
|
|
190
|
+
if (o instanceof Date)
|
|
191
|
+
return Number.isNaN(o.getTime()) ? "[Invalid Date]" : o.toISOString();
|
|
192
|
+
if (o instanceof Error)
|
|
193
|
+
return { name: String(o.name), message: redactString(String(o.message)) };
|
|
194
|
+
if (o instanceof Map || o instanceof Set)
|
|
195
|
+
return `[${o.constructor.name}(${o.size})]`;
|
|
196
|
+
const rec = o;
|
|
197
|
+
const keys = Object.keys(o).filter((k) => k !== "…");
|
|
198
|
+
const earlierKeys = typeof rec["…"] === "string" && /^\d+ more$/.test(rec["…"]) ? parseInt(rec["…"], 10) : 0;
|
|
199
|
+
const out = {};
|
|
200
|
+
for (const k of keys.slice(0, exports.VALUE_LIMITS.keys)) {
|
|
201
|
+
let child;
|
|
202
|
+
try {
|
|
203
|
+
child = rec[k];
|
|
204
|
+
}
|
|
205
|
+
catch {
|
|
206
|
+
child = "[unreadable]";
|
|
207
|
+
}
|
|
208
|
+
out[k.slice(0, 80)] = walk(child, depth + 1, k);
|
|
209
|
+
}
|
|
210
|
+
const moreKeys = earlierKeys + Math.max(0, keys.length - exports.VALUE_LIMITS.keys);
|
|
211
|
+
if (moreKeys > 0)
|
|
212
|
+
out["…"] = `${moreKeys} more`;
|
|
213
|
+
return out;
|
|
214
|
+
}
|
|
215
|
+
finally {
|
|
216
|
+
seen.delete(o);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
return walk(value, 0, "");
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=debugger-safe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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true });
|
|
3
|
+
/** Runs on a worker thread (see debugger.ts): connects to the main thread's inspector and hands it to the agent. */
|
|
4
|
+
const node_inspector_1 = require("node:inspector");
|
|
5
|
+
const node_worker_threads_1 = require("node:worker_threads");
|
|
6
|
+
const debugger_agent_1 = require("./debugger-agent");
|
|
7
|
+
const d = node_worker_threads_1.workerData;
|
|
8
|
+
const session = new node_inspector_1.Session();
|
|
9
|
+
session.connectToMainThread();
|
|
10
|
+
const cdp = {
|
|
11
|
+
post: (method, params) => new Promise((resolve, reject) => session.post(method, params, (err, result) => (err ? reject(err) : resolve(result)))),
|
|
12
|
+
on: (event, handler) => session.on(event, (message) => handler(message.params)),
|
|
13
|
+
};
|
|
14
|
+
const agent = new debugger_agent_1.LiveDebuggerAgent({
|
|
15
|
+
apiUrl: d.apiUrl,
|
|
16
|
+
ingestKey: d.ingestKey,
|
|
17
|
+
service: d.service,
|
|
18
|
+
instance: d.instance,
|
|
19
|
+
cdp,
|
|
20
|
+
redactKeys: d.redactKeys?.length ? new RegExp(d.redactKeys.join("|"), "i") : null,
|
|
21
|
+
minIntervalMs: d.minIntervalMs,
|
|
22
|
+
pollFloorMs: d.pollFloorMs,
|
|
23
|
+
budgetMs: d.budgetMs,
|
|
24
|
+
testFault: d.testFault,
|
|
25
|
+
log: (m) => node_worker_threads_1.parentPort?.postMessage({ type: "log", message: m }),
|
|
26
|
+
});
|
|
27
|
+
agent.start(d.firstPollDelayMs ?? 0);
|
|
28
|
+
node_worker_threads_1.parentPort?.on("message", (m) => {
|
|
29
|
+
if (m === "stop")
|
|
30
|
+
void agent.stop().finally(() => process.exit(0));
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=debugger-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger-worker.js","sourceRoot":"","sources":["../src/debugger-worker.ts"],"names":[],"mappings":";;AAAA,oHAAoH;AACpH,mDAAyC;AACzC,6DAA6D;AAC7D,qDAA+D;AAG/D,MAAM,CA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E,WAAW,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;CACjE,CAAC,CAAC;AACH,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,CAAC;AAErC,gCAAU,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;IAC9B,IAAI,CAAC,KAAK,MAAM;QAAE,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACrE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type LiveDebuggerOptions = {
|
|
2
|
+
/** The Owlpane API, for example https://api.owlpane.com. Falls back to OWLPANE_API_URL. */
|
|
3
|
+
apiUrl?: string;
|
|
4
|
+
ingestKey?: string;
|
|
5
|
+
service?: string;
|
|
6
|
+
/** Names this process in snapshots. Default: hostname and pid. */
|
|
7
|
+
instance?: string;
|
|
8
|
+
/** Extra variable and property names (regular expression sources) whose values are never read, on top of the built-in secret patterns. */
|
|
9
|
+
redactKeys?: string[];
|
|
10
|
+
log?: (message: string) => void;
|
|
11
|
+
/** @internal for this package's tests */
|
|
12
|
+
_test?: {
|
|
13
|
+
firstPollDelayMs?: number;
|
|
14
|
+
pollFloorMs?: number;
|
|
15
|
+
minIntervalMs?: number;
|
|
16
|
+
budgetMs?: number;
|
|
17
|
+
testFault?: "throw-after-pause" | "hang-after-pause" | "exit-after-pause";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type LiveDebuggerHandle = {
|
|
21
|
+
status(): "running" | "stopped" | "failed";
|
|
22
|
+
stop(): Promise<void>;
|
|
23
|
+
};
|
|
24
|
+
export declare function startLiveDebugger(options: LiveDebuggerOptions & {
|
|
25
|
+
service: string;
|
|
26
|
+
ingestKey: string;
|
|
27
|
+
}): LiveDebuggerHandle | undefined;
|
package/dist/debugger.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startLiveDebugger = startLiveDebugger;
|
|
4
|
+
/**
|
|
5
|
+
* Live debugger: production snapshots without a redeploy. A probe, set in the Owlpane console on a file and line of this service, makes the
|
|
6
|
+
* next few executions of that line record their local variables and stack (secrets removed) and send them to Owlpane. It runs on a worker
|
|
7
|
+
* thread, uses V8's inspector, and does nothing at all while no probe is active.
|
|
8
|
+
*
|
|
9
|
+
* Opt in with `owlpane.start({ liveDebugger: { apiUrl } })` or OWLPANE_LIVE_DEBUGGER=1 with OWLPANE_API_URL. It uses the ingest key already
|
|
10
|
+
* configured. It refuses to start while an inspector is open (`node --inspect`): both would share one pause state.
|
|
11
|
+
*
|
|
12
|
+
* Files and lines are those of the code V8 runs. For TypeScript that is the compiled JavaScript, unless it is run through a loader that keeps
|
|
13
|
+
* lines (tsx, ts-node); source maps are not applied.
|
|
14
|
+
*/
|
|
15
|
+
const node_os_1 = require("node:os");
|
|
16
|
+
const node_path_1 = require("node:path");
|
|
17
|
+
const node_inspector_1 = require("node:inspector");
|
|
18
|
+
const node_worker_threads_1 = require("node:worker_threads");
|
|
19
|
+
function startLiveDebugger(options) {
|
|
20
|
+
const log = options.log ?? (() => undefined);
|
|
21
|
+
const apiUrl = (options.apiUrl ?? process.env.OWLPANE_API_URL ?? "").trim();
|
|
22
|
+
if (!/^https?:\/\//i.test(apiUrl)) {
|
|
23
|
+
log("live debugger not started: set apiUrl (or OWLPANE_API_URL) to the Owlpane API");
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
if ((0, node_inspector_1.url)()) {
|
|
27
|
+
log("live debugger not started: an inspector is open (node --inspect), and the two would share one pause state");
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
const redactKeys = (options.redactKeys ?? []).filter((r) => {
|
|
31
|
+
try {
|
|
32
|
+
new RegExp(r);
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
log(`redactKeys: ignoring "${r}", not a regular expression`);
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const ts = __filename.endsWith(".ts");
|
|
41
|
+
const file = (0, node_path_1.join)(__dirname, ts ? "debugger-worker.ts" : "debugger-worker.js");
|
|
42
|
+
const workerOptions = {
|
|
43
|
+
workerData: {
|
|
44
|
+
apiUrl,
|
|
45
|
+
ingestKey: options.ingestKey,
|
|
46
|
+
service: options.service,
|
|
47
|
+
instance: options.instance ?? `${(0, node_os_1.hostname)()}:${process.pid}`,
|
|
48
|
+
redactKeys,
|
|
49
|
+
...options._test,
|
|
50
|
+
},
|
|
51
|
+
// The worker holds no application state; its heap is its own.
|
|
52
|
+
resourceLimits: { maxOldGenerationSizeMb: 64 },
|
|
53
|
+
};
|
|
54
|
+
// Run from TypeScript source (this package's own tests, through tsx) the worker needs the same loader; a built package runs plain JavaScript.
|
|
55
|
+
const worker = ts ? new node_worker_threads_1.Worker(`require("tsx/cjs"); require(${JSON.stringify(file)});`, { ...workerOptions, eval: true }) : new node_worker_threads_1.Worker(file, workerOptions);
|
|
56
|
+
let state = "running";
|
|
57
|
+
worker.unref();
|
|
58
|
+
worker.on("message", (m) => {
|
|
59
|
+
if (m?.type === "log" && m.message)
|
|
60
|
+
log(m.message);
|
|
61
|
+
});
|
|
62
|
+
worker.on("error", (e) => {
|
|
63
|
+
state = "failed";
|
|
64
|
+
log(`live debugger stopped: ${e.message}`);
|
|
65
|
+
});
|
|
66
|
+
worker.on("exit", () => {
|
|
67
|
+
if (state === "running")
|
|
68
|
+
state = "stopped";
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
status: () => state,
|
|
72
|
+
stop: () => new Promise((resolve) => {
|
|
73
|
+
if (state !== "running")
|
|
74
|
+
return resolve();
|
|
75
|
+
const t = setTimeout(() => void worker.terminate().then(() => resolve()), 3000);
|
|
76
|
+
worker.once("exit", () => {
|
|
77
|
+
clearTimeout(t);
|
|
78
|
+
resolve();
|
|
79
|
+
});
|
|
80
|
+
worker.postMessage("stop");
|
|
81
|
+
}),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=debugger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.js","sourceRoot":"","sources":["../src/debugger.ts"],"names":[],"mappings":";;AAmCA,8CA6DC;AAhGD;;;;;;;;;;GAUG;AACH,qCAAmC;AACnC,yCAAiC;AACjC,mDAAqD;AACrD,6DAA6C;AAqB7C,SAAgB,iBAAiB,CAAC,OAAqE;IACrG,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC5E,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,GAAG,CAAC,+EAA+E,CAAC,CAAC;QACrF,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,IAAA,oBAAY,GAAE,EAAE,CAAC;QACnB,GAAG,CAAC,2GAA2G,CAAC,CAAC;QACjH,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,UAAU,GAAG,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QACzD,IAAI,CAAC;YACH,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;YACd,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,GAAG,CAAC,yBAAyB,CAAC,6BAA6B,CAAC,CAAC;YAC7D,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC,CAAC,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,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;QACrB,IAAI,KAAK,KAAK,SAAS;YAAE,KAAK,GAAG,SAAS,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,OAAO;QACL,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK;QACnB,IAAI,EAAE,GAAG,EAAE,CACT,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAC5B,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAO,OAAO,EAAE,CAAC;YAC1C,MAAM,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;YAChF,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;gBACvB,YAAY,CAAC,CAAC,CAAC,CAAC;gBAChB,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC,CAAC;KACL,CAAC;AACJ,CAAC"}
|
package/dist/device.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type DeviceContext = {
|
|
2
|
+
deviceId: string;
|
|
3
|
+
fleetId: string;
|
|
4
|
+
deviceClass?: string;
|
|
5
|
+
firmwareVersion?: string;
|
|
6
|
+
gatewayId?: string;
|
|
7
|
+
};
|
|
8
|
+
/** Remember device context for subsequent `emitDeviceLog` calls in this process. */
|
|
9
|
+
export declare function setDeviceContext(ctx: DeviceContext): void;
|
|
10
|
+
export declare function getDeviceContext(): DeviceContext | undefined;
|
|
11
|
+
export declare function deviceLogAttributes(ctx: DeviceContext): Record<string, string>;
|
|
12
|
+
export declare function deviceResourceAttributes(ctx: DeviceContext): Record<string, string>;
|
|
13
|
+
/** Emit a structured log line with Owlpane IoT contract attributes. */
|
|
14
|
+
export declare function emitDeviceLog(body: string, ctx?: DeviceContext, severity?: "info" | "warn" | "error"): Promise<void>;
|
|
15
|
+
/** Merge device attrs into an existing OTel resource (edge gateway processes). */
|
|
16
|
+
export declare function mergeDeviceResource(ctx: DeviceContext): import("@opentelemetry/resources").Resource;
|
package/dist/device.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setDeviceContext = setDeviceContext;
|
|
4
|
+
exports.getDeviceContext = getDeviceContext;
|
|
5
|
+
exports.deviceLogAttributes = deviceLogAttributes;
|
|
6
|
+
exports.deviceResourceAttributes = deviceResourceAttributes;
|
|
7
|
+
exports.emitDeviceLog = emitDeviceLog;
|
|
8
|
+
exports.mergeDeviceResource = mergeDeviceResource;
|
|
9
|
+
/**
|
|
10
|
+
* IoT device fleet telemetry helpers (OTLP log attributes + optional resource attrs).
|
|
11
|
+
* See api/docs/ops/iot-telemetry-contract.md
|
|
12
|
+
*/
|
|
13
|
+
const api_logs_1 = require("@opentelemetry/api-logs");
|
|
14
|
+
const resources_1 = require("@opentelemetry/resources");
|
|
15
|
+
let active;
|
|
16
|
+
/** Remember device context for subsequent `emitDeviceLog` calls in this process. */
|
|
17
|
+
function setDeviceContext(ctx) {
|
|
18
|
+
active = {
|
|
19
|
+
deviceId: ctx.deviceId,
|
|
20
|
+
fleetId: ctx.fleetId,
|
|
21
|
+
deviceClass: ctx.deviceClass,
|
|
22
|
+
firmwareVersion: ctx.firmwareVersion,
|
|
23
|
+
gatewayId: ctx.gatewayId,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function getDeviceContext() {
|
|
27
|
+
return active;
|
|
28
|
+
}
|
|
29
|
+
function deviceLogAttributes(ctx) {
|
|
30
|
+
const attrs = {
|
|
31
|
+
"owlpane.device.id": ctx.deviceId,
|
|
32
|
+
"owlpane.device_fleet.id": ctx.fleetId,
|
|
33
|
+
};
|
|
34
|
+
if (ctx.deviceClass)
|
|
35
|
+
attrs["owlpane.device.class"] = ctx.deviceClass;
|
|
36
|
+
if (ctx.firmwareVersion)
|
|
37
|
+
attrs["owlpane.device.firmware_version"] = ctx.firmwareVersion;
|
|
38
|
+
if (ctx.gatewayId)
|
|
39
|
+
attrs["owlpane.device.gateway_id"] = ctx.gatewayId;
|
|
40
|
+
return attrs;
|
|
41
|
+
}
|
|
42
|
+
function deviceResourceAttributes(ctx) {
|
|
43
|
+
return deviceLogAttributes(ctx);
|
|
44
|
+
}
|
|
45
|
+
/** Emit a structured log line with Owlpane IoT contract attributes. */
|
|
46
|
+
async function emitDeviceLog(body, ctx, severity = "info") {
|
|
47
|
+
const c = ctx ?? active;
|
|
48
|
+
if (!c)
|
|
49
|
+
throw new Error("setDeviceContext() or pass DeviceContext to emitDeviceLog");
|
|
50
|
+
const logger = api_logs_1.logs.getLogger("owlpane.device");
|
|
51
|
+
const sev = severity === "error" ? api_logs_1.SeverityNumber.ERROR : severity === "warn" ? api_logs_1.SeverityNumber.WARN : api_logs_1.SeverityNumber.INFO;
|
|
52
|
+
logger.emit({
|
|
53
|
+
severityNumber: sev,
|
|
54
|
+
severityText: severity.toUpperCase(),
|
|
55
|
+
body,
|
|
56
|
+
attributes: deviceLogAttributes(c),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/** Merge device attrs into an existing OTel resource (edge gateway processes). */
|
|
60
|
+
function mergeDeviceResource(ctx) {
|
|
61
|
+
return (0, resources_1.resourceFromAttributes)(deviceResourceAttributes(ctx));
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device.js","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":";;AAkBA,4CAQC;AAED,4CAEC;AAED,kDASC;AAED,4DAEC;AAGD,sCAgBC;AAGD,kDAEC;AArED;;;GAGG;AACH,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QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,yBAAc,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,yBAAc,CAAC,IAAI,CAAC,CAAC,CAAC,yBAAc,CAAC,IAAI,CAAC;IAChH,MAAM,CAAC,IAAI,CAAC;QACV,cAAc,EAAE,GAAG;QACnB,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE;QACpC,IAAI;QACJ,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC;KACnC,CAAC,CAAC;AACL,CAAC;AAED,kFAAkF;AAClF,SAAgB,mBAAmB,CAAC,GAAkB;IACpD,OAAO,IAAA,kCAAsB,EAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,9 +13,13 @@
|
|
|
13
13
|
* interceptor) are at "@owlpane/node/nest" so this entry point has no framework dependency.
|
|
14
14
|
*/
|
|
15
15
|
import { api } from "@opentelemetry/sdk-node";
|
|
16
|
+
import { type LiveDebuggerOptions } from "./debugger";
|
|
16
17
|
import { mobileResource, setExperiment, setFeatureFlag, testCase, pipeline, recordFinding, FINDING_KINDS } from "./signals";
|
|
17
|
-
|
|
18
|
+
import { setDeviceContext, getDeviceContext, deviceLogAttributes, deviceResourceAttributes, emitDeviceLog, mergeDeviceResource, type DeviceContext } from "./device";
|
|
19
|
+
export { mobileResource, setExperiment, setFeatureFlag, testCase, pipeline, recordFinding, FINDING_KINDS, setDeviceContext, getDeviceContext, deviceLogAttributes, deviceResourceAttributes, emitDeviceLog, mergeDeviceResource, };
|
|
20
|
+
export type { DeviceContext };
|
|
18
21
|
export type { FindingKind, MobilePlatform } from "./signals";
|
|
22
|
+
export type { LiveDebuggerOptions } from "./debugger";
|
|
19
23
|
export type InitOptions = {
|
|
20
24
|
/** Shows up as `service.name`. Falls back to OTEL_SERVICE_NAME, then "node-app". */
|
|
21
25
|
service?: string;
|
|
@@ -41,6 +45,11 @@ export type InitOptions = {
|
|
|
41
45
|
traceUserProfile?: boolean;
|
|
42
46
|
/** CPU profiling: a short V8 sampling profile every minute, sent as `profile.cpu` spans. Off by default; also OWLPANE_PROFILING=1. */
|
|
43
47
|
profiling?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Live debugger: snapshots of local variables at lines you choose in the console, without a redeploy. Off by default; also
|
|
50
|
+
* OWLPANE_LIVE_DEBUGGER=1 with OWLPANE_API_URL. See debugger.ts for what it does and refuses to do.
|
|
51
|
+
*/
|
|
52
|
+
liveDebugger?: boolean | LiveDebuggerOptions;
|
|
44
53
|
};
|
|
45
54
|
/** Whether setUser may attach email/name (requires start({ traceUserProfile: true }) or OWLPANE_TRACE_USER_PROFILE=1). */
|
|
46
55
|
export declare function traceUserProfileEnabled(): boolean;
|
|
@@ -83,4 +92,8 @@ export declare const owlpane: {
|
|
|
83
92
|
pipeline: typeof pipeline;
|
|
84
93
|
recordFinding: typeof recordFinding;
|
|
85
94
|
mobileResource: typeof mobileResource;
|
|
95
|
+
setDeviceContext: typeof setDeviceContext;
|
|
96
|
+
getDeviceContext: typeof getDeviceContext;
|
|
97
|
+
deviceLogAttributes: typeof deviceLogAttributes;
|
|
98
|
+
emitDeviceLog: typeof emitDeviceLog;
|
|
86
99
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.owlpane = exports.FINDING_KINDS = exports.recordFinding = exports.pipeline = exports.testCase = exports.setFeatureFlag = exports.setExperiment = exports.mobileResource = void 0;
|
|
3
|
+
exports.owlpane = exports.mergeDeviceResource = exports.emitDeviceLog = exports.deviceResourceAttributes = exports.deviceLogAttributes = exports.getDeviceContext = exports.setDeviceContext = exports.FINDING_KINDS = exports.recordFinding = exports.pipeline = exports.testCase = exports.setFeatureFlag = exports.setExperiment = exports.mobileResource = void 0;
|
|
4
4
|
exports.traceUserProfileEnabled = traceUserProfileEnabled;
|
|
5
5
|
exports.isEnabled = isEnabled;
|
|
6
6
|
exports.start = start;
|
|
@@ -31,6 +31,7 @@ const api_logs_1 = require("@opentelemetry/api-logs");
|
|
|
31
31
|
const sdk_logs_1 = require("@opentelemetry/sdk-logs");
|
|
32
32
|
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
|
|
33
33
|
const profiler_1 = require("./profiler");
|
|
34
|
+
const debugger_1 = require("./debugger");
|
|
34
35
|
const signals_1 = require("./signals");
|
|
35
36
|
Object.defineProperty(exports, "mobileResource", { enumerable: true, get: function () { return signals_1.mobileResource; } });
|
|
36
37
|
Object.defineProperty(exports, "setExperiment", { enumerable: true, get: function () { return signals_1.setExperiment; } });
|
|
@@ -39,12 +40,20 @@ Object.defineProperty(exports, "testCase", { enumerable: true, get: function ()
|
|
|
39
40
|
Object.defineProperty(exports, "pipeline", { enumerable: true, get: function () { return signals_1.pipeline; } });
|
|
40
41
|
Object.defineProperty(exports, "recordFinding", { enumerable: true, get: function () { return signals_1.recordFinding; } });
|
|
41
42
|
Object.defineProperty(exports, "FINDING_KINDS", { enumerable: true, get: function () { return signals_1.FINDING_KINDS; } });
|
|
43
|
+
const device_1 = require("./device");
|
|
44
|
+
Object.defineProperty(exports, "setDeviceContext", { enumerable: true, get: function () { return device_1.setDeviceContext; } });
|
|
45
|
+
Object.defineProperty(exports, "getDeviceContext", { enumerable: true, get: function () { return device_1.getDeviceContext; } });
|
|
46
|
+
Object.defineProperty(exports, "deviceLogAttributes", { enumerable: true, get: function () { return device_1.deviceLogAttributes; } });
|
|
47
|
+
Object.defineProperty(exports, "deviceResourceAttributes", { enumerable: true, get: function () { return device_1.deviceResourceAttributes; } });
|
|
48
|
+
Object.defineProperty(exports, "emitDeviceLog", { enumerable: true, get: function () { return device_1.emitDeviceLog; } });
|
|
49
|
+
Object.defineProperty(exports, "mergeDeviceResource", { enumerable: true, get: function () { return device_1.mergeDeviceResource; } });
|
|
42
50
|
const { BatchSpanProcessor, ParentBasedSampler, TraceIdRatioBasedSampler } = sdk_node_1.tracing;
|
|
43
51
|
const { resourceFromAttributes } = sdk_node_1.resources;
|
|
44
52
|
let sdk;
|
|
45
53
|
let logProvider;
|
|
46
54
|
let traceUserProfile = false;
|
|
47
55
|
let profiler;
|
|
56
|
+
let liveDebugger;
|
|
48
57
|
/** Whether setUser may attach email/name (requires start({ traceUserProfile: true }) or OWLPANE_TRACE_USER_PROFILE=1). */
|
|
49
58
|
function traceUserProfileEnabled() {
|
|
50
59
|
return traceUserProfile;
|
|
@@ -176,16 +185,22 @@ function start(options = {}) {
|
|
|
176
185
|
if (options.profiling === true || ["1", "true", "yes"].includes((process.env.OWLPANE_PROFILING ?? "").trim().toLowerCase())) {
|
|
177
186
|
profiler = (0, profiler_1.startProfiler)({ endpoint: baseUrl, headers, resource });
|
|
178
187
|
}
|
|
188
|
+
const dbg = options.liveDebugger;
|
|
189
|
+
if (ingestKey && (dbg === true || (typeof dbg === "object" && dbg !== null) || (dbg === undefined && ["1", "true", "yes"].includes((process.env.OWLPANE_LIVE_DEBUGGER ?? "").trim().toLowerCase())))) {
|
|
190
|
+
liveDebugger = (0, debugger_1.startLiveDebugger)({ ...(typeof dbg === "object" ? dbg : {}), service: serviceName, ingestKey: (typeof dbg === "object" && dbg?.ingestKey) || ingestKey });
|
|
191
|
+
}
|
|
179
192
|
}
|
|
180
193
|
/** Flushes and stops the pipeline. Call on shutdown so the last batch of spans isn't dropped. */
|
|
181
194
|
function shutdown() {
|
|
182
195
|
const s = sdk;
|
|
183
196
|
const logs = logProvider;
|
|
184
197
|
const prof = profiler;
|
|
198
|
+
const dbg = liveDebugger;
|
|
199
|
+
liveDebugger = undefined;
|
|
185
200
|
sdk = undefined;
|
|
186
201
|
logProvider = undefined;
|
|
187
202
|
profiler = undefined;
|
|
188
|
-
return Promise.all([s?.shutdown(), logs?.shutdown(), prof?.stop()]).then(() => undefined);
|
|
203
|
+
return Promise.all([s?.shutdown(), logs?.shutdown(), prof?.stop(), dbg?.stop()]).then(() => undefined);
|
|
189
204
|
}
|
|
190
205
|
// ---------- HTTP request counter (unsampled) ----------
|
|
191
206
|
/**
|
|
@@ -317,5 +332,9 @@ exports.owlpane = {
|
|
|
317
332
|
pipeline: signals_1.pipeline,
|
|
318
333
|
recordFinding: signals_1.recordFinding,
|
|
319
334
|
mobileResource: signals_1.mobileResource,
|
|
335
|
+
setDeviceContext: device_1.setDeviceContext,
|
|
336
|
+
getDeviceContext: device_1.getDeviceContext,
|
|
337
|
+
deviceLogAttributes: device_1.deviceLogAttributes,
|
|
338
|
+
emitDeviceLog: device_1.emitDeviceLog,
|
|
320
339
|
};
|
|
321
340
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAqEA,0DAEC;AAYD,8BAEC;AAeD,sBAqHC;AAGD,4BAQC;AAgDD,kBAoCC;AASD,0BAaC;AA9UD;;;;;;;;;;;;;GAaG;AACH,sDAAoF;AACpF,0FAA+E;AAC/E,oFAAyE;AACzE,0FAAwF;AACxF,kFAA8E;AAC9E,sFAA4E;AAC5E,sDAA0D;AAC1D,sDAAkF;AAElF,8EAG6C;AAC7C,yCAAgE;AAChE,uCAAsJ;AAC7I,+FAD0B,wBAAc,OAC1B;AAAE,8FAD0B,uBAAa,OAC1B;AAAE,+FAD0B,wBAAc,OAC1B;AAAE,yFAD0B,kBAAQ,OAC1B;AAAE,yFAD0B,kBAAQ,OAC1B;AAAE,8FAD0B,uBAAa,OAC1B;AAAE,8FAD0B,uBAAa,OAC1B;AAGxG,MAAM,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,GACxE,kBAAO,CAAC;AACV,MAAM,EAAE,sBAAsB,EAAE,GAAG,oBAAS,CAAC;AA6B7C,IAAI,GAAwB,CAAC;AAC7B,IAAI,WAAuC,CAAC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AM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QACvE,IAAI,SAAS,GAAG,CAAC;YAAE,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;QACtD,OAAO,GAAG,GAAG,CAAC;QACd,MAAM,GAAG,GAAG,CAAC;IACf,CAAC,CAAC,CAAC;IACL,KAAK;SACF,qBAAqB,CAAC,sBAAsB,EAAE;QAC7C,IAAI,EAAE,IAAI;QACV,WAAW,EAAE,mBAAmB;KACjC,CAAC;SACD,WAAW,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACxE,CAAC;AAEY,QAAA,OAAO,GAAG;IACrB,KAAK;IACL,QAAQ;IACR,GAAG;IACH,OAAO;IACP,SAAS;IACT,aAAa,EAAb,uBAAa;IACb,cAAc,EAAd,wBAAc;IACd,QAAQ,EAAR,kBAAQ;IACR,QAAQ,EAAR,kBAAQ;IACR,aAAa,EAAb,uBAAa;IACb,cAAc,EAAd,wBAAc;IACd,gBAAgB,EAAhB,yBAAgB;IAChB,gBAAgB,EAAhB,yBAAgB;IAChB,mBAAmB,EAAnB,4BAAmB;IACnB,aAAa,EAAb,sBAAa;CACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlpane/node",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Owlpane telemetry SDK for Node.js: one-line OpenTelemetry setup, job tracing, and user tagging. Optional NestJS helpers at @owlpane/node/nest.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|