Skip to content

Commit ee78dc0

Browse files
committed
ai gonna ai
1 parent 38c16e5 commit ee78dc0

4 files changed

Lines changed: 42 additions & 68 deletions

File tree

browsers/telemetry/categories.mdx

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,24 @@ title: "Telemetry Categories"
33
description: "The categories a browser session can capture, what each contains, and their cost"
44
---
55

6-
A category groups related telemetry events and is the unit you enable or disable. Selection is opt-in: a session captures a category only when you turn it on (see [Overview](/browsers/telemetry/overview)). This page lists every category, the event types it carries, and what it costs to capture.
6+
A category groups related telemetry events and is the unit you enable or disable. Selection is opt-in: a session captures a category only when you turn it on.
77

88
For the full payload schema of any event type, see the [Stream telemetry events](https://kernel.sh/docs/api-reference/browser-telemetry/stream-telemetry-events-via-sse) endpoint in the API reference.
99

10+
## Operational
11+
12+
These categories report on the session itself rather than page content.
13+
14+
| Category | Captures | Event types |
15+
| --- | --- | --- |
16+
| `control` | Computer-control API calls against the session | `api_call` |
17+
| `connection` | CDP and live view connect/disconnect activity | `cdp_connect`, `cdp_disconnect`, `live_view_connect`, `live_view_disconnect` |
18+
| `system` | VM-level failures | `system_oom_kill`, `service_crashed` |
19+
| `captcha` | Results of automated captcha solves | `captcha_solve_result` |
20+
1021
## Browser activity
1122

12-
These categories report what's happening in the page. Capturing any of them attaches a Chrome DevTools Protocol (CDP) collector to the session and produces far more events than the operational categories, so enable only the ones you need. None are in the default set.
23+
These categories report what's happening in the page. Capturing any of them attaches a Chrome DevTools Protocol (CDP) collector to the session and produces highly granular page-level events. Capturing them adds overhead, so enable only the ones you need.
1324

1425
| Category | Captures | Event types |
1526
| --- | --- | --- |
@@ -23,24 +34,15 @@ These categories report what's happening in the page. Capturing any of them atta
2334
`interaction` events are browser-native DOM events observed in the page, not calls to the [computer-control](/browsers/computer-controls) API (those are reported by the `control` category).
2435
</Note>
2536

26-
<Warning>
27-
`screenshot` is the most expensive category to capture - each event carries an encoded image. Enable it only when you need visual snapshots, and prefer [live view](/browsers/live-view) or [replays](/browsers/replays) for continuous visibility.
28-
</Warning>
37+
### The monitor category
2938

30-
## Operational
31-
32-
These categories report on the session itself rather than page content, and they're cheap to capture. Together they make up the default set - what a session captures when you enable telemetry without naming any categories (`telemetry: { enabled: true }` or `--telemetry=all`), giving you a baseline view of session health and control activity.
39+
`monitor` reports the health of the CDP collector itself: `monitor_disconnected`, `monitor_reconnected`, `monitor_reconnect_failed`, and `monitor_init_failed`.
3340

34-
| Category | Captures | Event types |
35-
| --- | --- | --- |
36-
| `control` | Computer-control API calls against the session | `api_call` |
37-
| `connection` | CDP and live view connect/disconnect activity | `cdp_connect`, `cdp_disconnect`, `live_view_connect`, `live_view_disconnect` |
38-
| `system` | VM-level failures | `system_oom_kill`, `service_crashed` |
39-
| `captcha` | Results of automated captcha solves | `captcha_solve_result` |
41+
It isn't directly settable. It flows automatically whenever any of the browser-activity categories are captured. You can still [filter the stream](/browsers/telemetry/streaming) by `monitor` to isolate these events.
4042

4143
## Data sensitivity
4244

43-
Telemetry is off by default, and the [default set](#operational) carries operational metadata only - no page content. The browser-activity categories are different: they capture what actually flows through the session, which is your own browser's data and can include credentials and personal information.
45+
Telemetry is off by default and the default set carries operational metadata only. The browser-activity categories are different: they capture what actually flows through the session, which is your own browser's data and can include credentials and personal information.
4446

4547
| Category | Can contain sensitive data |
4648
| --- | --- |
@@ -58,9 +60,3 @@ Some exposure is reduced for you automatically: input into sensitive fields such
5860
<Warning>
5961
If you operate under HIPAA, GDPR, or similar obligations, be deliberate about the browser-activity categories: pointing them at a site that handles regulated data captures that data into storage. If you have compliance requirements around what Kernel may process, [contact us](mailto:security@kernel.sh) before enabling them.
6062
</Warning>
61-
62-
## The monitor category
63-
64-
`monitor` reports the health of the CDP collector itself: `monitor_disconnected`, `monitor_reconnected`, `monitor_reconnect_failed`, and `monitor_init_failed`.
65-
66-
It isn't directly settable. It flows automatically whenever any [browser-activity category](#browser-activity) is captured - since those are what attach the collector - and is silent otherwise. You can still [filter the stream](/browsers/telemetry/streaming) by `monitor` to isolate these events.

browsers/telemetry/overview.mdx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Telemetry Overview"
3-
description: "Capture a real-time, categorized stream of what happens inside a browser session"
3+
description: "Capture what happens inside a browser session"
44
---
55

66
Telemetry captures events from inside a browser session - console output, network activity, page lifecycle, user interactions, captcha solves, and operational signals like crashes or connection changes. Once enabled, you can [stream them](/browsers/telemetry/streaming) live or pull them later for analysis.
@@ -43,7 +43,7 @@ kernel browsers create --telemetry=all
4343

4444
### Capture specific categories
4545

46-
List exactly the categories you want under `telemetry.browser`. Only those are captured; everything else stays off. Don't set the top-level `enabled` flag in this case - the presence of category settings is what turns telemetry on:
46+
List the categories you want under `telemetry.browser`. For example, this session captures `console` and `network` only:
4747

4848
<CodeGroup>
4949
```typescript Typescript/Javascript
@@ -73,27 +73,30 @@ kernel browsers create --telemetry=console,network
7373
```
7474
</CodeGroup>
7575

76-
This session captures `console` and `network` only - no page, interaction, or operational events.
77-
7876
### Disable telemetry
7977

80-
Set `enabled: false` to capture nothing. This can't be combined with category settings:
78+
<Info>
79+
Telemetry is disabled by default. Use this only when updating a session to turn previously enabled telemetry back off.
80+
</Info>
81+
82+
Set `enabled: false` on an existing session to turn telemetry off:
8183

8284
<CodeGroup>
8385
```typescript Typescript/Javascript
84-
const browser = await kernel.browsers.create({
86+
await kernel.browsers.update(browser.session_id, {
8587
telemetry: { enabled: false },
8688
});
8789
```
8890

8991
```python Python
90-
browser = kernel.browsers.create(
92+
kernel.browsers.update(
93+
browser.session_id,
9194
telemetry={"enabled": False},
9295
)
9396
```
9497

9598
```bash CLI
96-
kernel browsers create --telemetry=off
99+
kernel browsers update <session-id> --telemetry=off
97100
```
98101
</CodeGroup>
99102

browsers/telemetry/streaming.mdx

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
---
22
title: "Stream Telemetry"
3-
description: "Consume a session's live telemetry stream from the SDK, CLI, or raw SSE"
3+
description: "Consume a session's live telemetry stream from the SDK or CLI"
44
---
55

6-
Once a session has telemetry [enabled](/browsers/telemetry/overview), you can stream its events in real time. The stream stays open until the session terminates, and each event is wrapped in an envelope with a monotonic `seq` number you can use to reconnect without gaps:
7-
8-
```json
9-
{
10-
"seq": 42,
11-
"event": {
12-
"ts": 1746123456789000,
13-
"type": "network_response",
14-
"category": "network",
15-
"data": { "method": "GET", "url": "https://example.com/api", "status": 200 }
16-
}
17-
}
18-
```
19-
20-
The `data` payload differs per event type; see the [API reference](https://kernel.sh/docs/api-reference/browser-telemetry/stream-telemetry-events-via-sse) for each type's schema. An event whose payload exceeds 1 MB is dropped and the envelope is flagged `truncated: true`.
6+
Once a session has telemetry [enabled](/browsers/telemetry/overview), you can stream its events in real time. The stream stays open until the session terminates.
217

228
## Via SDK
239

@@ -48,6 +34,8 @@ with kernel.browsers.telemetry.stream(session_id) as stream:
4834
```
4935
</CodeGroup>
5036

37+
To filter, check `event.category` and `event.type` in your loop. If the stream drops, re-open it with the last `seq` you processed as `last_event_id` to resume without gaps.
38+
5139
## Via CLI
5240

5341
Stream events to your terminal. The command runs until the session ends or you interrupt it:
@@ -56,7 +44,7 @@ Stream events to your terminal. The command runs until the session ends or you i
5644
kernel browsers telemetry stream <session-id>
5745
```
5846

59-
Filter the stream client-side by category or event type (repeatable or comma-separated), and use `-o json` to emit newline-delimited JSON envelopes for piping:
47+
### Filtering by category or event type
6048

6149
```bash
6250
# Only network and console events
@@ -66,29 +54,16 @@ kernel browsers telemetry stream <session-id> --categories=network,console
6654
kernel browsers telemetry stream <session-id> --types=network_response,console_error
6755

6856
# Machine-readable output
57+
# -o json emits newline-delimited JSON envelopes for piping:
6958
kernel browsers telemetry stream <session-id> -o json
7059
```
7160

72-
<Info>
73-
CLI `--categories` and `--types` are applied locally to the stream - they don't change what the session captures. To change capture, update the session's [telemetry categories](/browsers/telemetry/categories).
74-
</Info>
75-
76-
## Via raw SSE
77-
78-
The stream is a standard [SSE](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) endpoint, so any SSE-capable client works:
79-
80-
```bash
81-
curl -N https://api.onkernel.com/browsers/<session-id>/telemetry/stream \
82-
-H "Authorization: Bearer $KERNEL_API_KEY" \
83-
-H "Accept: text/event-stream"
84-
```
85-
86-
Each `data:` frame carries one JSON envelope, and the frame's `id:` field is the envelope's `seq`. A keepalive comment is sent every 15 seconds when no events arrive. The `event:` field is never set.
87-
88-
## Resuming after a disconnect
61+
### Resuming after a disconnect
8962

90-
To pick up where you left off, resume from the last `seq` you processed - the server replays events after that sequence number. SDK clients reconnect automatically. For raw SSE, send the last seq as the `Last-Event-ID` header; with the CLI, pass `--seq`:
63+
The stream is a single connection; it does not reconnect on its own. Each event carries a monotonic `seq`, so to resume without gaps you re-open the stream and pass the last `seq` you processed.
9164

9265
```bash
9366
kernel browsers telemetry stream <session-id> --seq 1024
9467
```
68+
69+
The server then replays events after that sequence number.

introduction/observe.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Observe"
33
description: "Watch your agent work, debug what went wrong"
44
---
55

6-
Browser agents fail in ways that don't show up in logs. Kernel gives you several ways to see what's actually happening live, after the fact, frame by frame, line by line, and event by event.
6+
Browser agents fail in ways that don't show up in logs. Kernel gives you several ways to see what's actually happening: live, after the fact, frame by frame, line by line, and event by event.
77

88
## Live view
99

@@ -60,7 +60,7 @@ Add `?readOnly=true` for a non-interactive view, or enable [kiosk mode](/browser
6060

6161
## Replays
6262

63-
Replays are MP4 recordings you start and stop on demand capture as many clips per session as you need. They're the right tool for post-hoc debugging: a failed run gives you one or more videos to scrub through, share, or attach to a bug report.
63+
Replays are MP4 recordings you start and stop on demand - capture as many clips per session as you need. They're the right tool for post-hoc debugging: a failed run gives you one or more videos to scrub through, share, or attach to a bug report.
6464

6565
Replays can also be enabled on managed auth sessions, so you can [debug failed logins](https://www.kernel.sh/docs/auth/configuration#record-sessions-for-debugging) the same way.
6666

@@ -119,7 +119,7 @@ Full reference: [Replays](/browsers/replays).
119119

120120
## Screenshots
121121

122-
Pull a frame at any moment with computer controls useful for snapshotting state at decision points, attaching to traces, or feeding back into a vision model.
122+
Pull a frame at any moment with computer controls - useful for snapshotting state at decision points, attaching to traces, or feeding back into a vision model.
123123

124124
<CodeGroup>
125125
```typescript Typescript/Javascript
@@ -194,7 +194,7 @@ Full reference: [Logs](/apps/logs).
194194

195195
## Telemetry
196196

197-
Telemetry is a real-time, structured stream of what happens inside a session console output, network activity, page lifecycle, interactions, and operational signals like crashes. Unlike a video or screenshot, it's machine-readable, so it's the right tool for feeding session activity into your own observability pipeline or reacting to events programmatically. Enable it at creation, then stream the events:
197+
Telemetry is a real-time, structured stream of what happens inside a session: console output, network activity, page lifecycle, interactions, and operational signals like crashes. Unlike a video or screenshot, it's machine-readable, so it's the right tool for feeding session activity into your own observability pipeline or reacting to events programmatically. Enable it at creation, then stream the events:
198198

199199
<CodeGroup>
200200
```typescript Typescript/Javascript

0 commit comments

Comments
 (0)