Skip to content

Commit c6d6b65

Browse files
feat: Layer telemetry request config onto the default set
1 parent 668cdfc commit c6d6b65

7 files changed

Lines changed: 46 additions & 22 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 125
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-8af2d28c8540273b1b413f49b8f9bcaa5df25fa2332d187d2693ec01502a2ac2.yml
3-
openapi_spec_hash: ee71b9231754b4682377a514d1a2c249
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-61dab8d0d01c2838febaf4319114ae35aa169a813a102e93af6598ca0d445da2.yml
3+
openapi_spec_hash: c9fbe809670384dc5141dccb60e45672
44
config_hash: 06186eb40e0058a2a87ac251fc07415d

src/kernel/types/browser_create_params.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,26 @@ class Telemetry(TypedDict, total=False):
134134
browser: BrowserTelemetryCategoriesConfigParam
135135
"""Per-category capture flags.
136136
137-
Selection is opt-in: only the categories set to enabled=true are captured;
138-
anything omitted is off. If enabled is true and browser is omitted or empty, the
139-
default category set is used. A browser config that enables nothing stops
140-
capture on update and starts no capture on create.
137+
The operational categories (control, connection, system, captcha) are captured
138+
whenever telemetry is enabled; set one to enabled=false to opt out. The CDP
139+
categories (console, network, page, interaction) and screenshot are off by
140+
default; set enabled=true to opt in. On create, provided categories layer onto
141+
the default set. On update, provided categories merge onto the session's current
142+
config; when no telemetry is active this falls back to the default set (matching
143+
create). If browser is omitted or empty, the default set is used. A browser
144+
config that disables every category stops capture on update and starts no
145+
capture on create.
141146
"""
142147

143148
enabled: bool
144149
"""Request shortcut for browser telemetry capture.
145150
146-
True enables capture using the default category set unless browser category
147-
settings are provided. False stops capture on update and starts no capture on
148-
create. enabled=false cannot be combined with browser category settings.
151+
True enables capture; with no browser category settings it captures the default
152+
set (control, connection, system, captcha), and any browser category settings
153+
are layered onto that default set. On update, enabled=true resolves the config
154+
fresh from the default set plus any provided categories, replacing the session's
155+
current selection rather than merging onto it; omit enabled to merge categories
156+
onto the current selection instead. False stops capture on update and starts no
157+
capture on create. enabled=false cannot be combined with browser category
158+
settings.
149159
"""

src/kernel/types/browser_update_params.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,28 @@ class Telemetry(TypedDict, total=False):
7070
browser: BrowserTelemetryCategoriesConfigParam
7171
"""Per-category capture flags.
7272
73-
Selection is opt-in: only the categories set to enabled=true are captured;
74-
anything omitted is off. If enabled is true and browser is omitted or empty, the
75-
default category set is used. A browser config that enables nothing stops
76-
capture on update and starts no capture on create.
73+
The operational categories (control, connection, system, captcha) are captured
74+
whenever telemetry is enabled; set one to enabled=false to opt out. The CDP
75+
categories (console, network, page, interaction) and screenshot are off by
76+
default; set enabled=true to opt in. On create, provided categories layer onto
77+
the default set. On update, provided categories merge onto the session's current
78+
config; when no telemetry is active this falls back to the default set (matching
79+
create). If browser is omitted or empty, the default set is used. A browser
80+
config that disables every category stops capture on update and starts no
81+
capture on create.
7782
"""
7883

7984
enabled: bool
8085
"""Request shortcut for browser telemetry capture.
8186
82-
True enables capture using the default category set unless browser category
83-
settings are provided. False stops capture on update and starts no capture on
84-
create. enabled=false cannot be combined with browser category settings.
87+
True enables capture; with no browser category settings it captures the default
88+
set (control, connection, system, captcha), and any browser category settings
89+
are layered onto that default set. On update, enabled=true resolves the config
90+
fresh from the default set plus any provided categories, replacing the session's
91+
current selection rather than merging onto it; omit enabled to merge categories
92+
onto the current selection instead. False stops capture on update and starts no
93+
capture on create. enabled=false cannot be combined with browser category
94+
settings.
8595
"""
8696

8797

src/kernel/types/browsers/browser_telemetry_categories_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010

1111
class BrowserTelemetryCategoriesConfig(BaseModel):
12-
"""Per-category telemetry capture settings.
12+
"""Per-category telemetry capture settings layered onto the default set.
1313
14-
Selection is opt-in: set a category to enabled=true to capture it; anything omitted is off. The default set (used by enabled=true with no per-category settings) is the lightweight operational signals: control, connection, system, captcha. The CDP categories (console, network, page, interaction) and screenshot are off by default and must be opted into.
14+
The operational signals (control, connection, system, captcha) are on by default and are opt-out: set one to enabled=false to stop capturing it. The CDP categories (console, network, page, interaction) and screenshot are off by default and are opt-in: set enabled=true to capture them.
1515
"""
1616

1717
captcha: Optional[BrowserTelemetryCategoryConfig] = None

src/kernel/types/browsers/browser_telemetry_categories_config_param.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111

1212
class BrowserTelemetryCategoriesConfigParam(TypedDict, total=False):
13-
"""Per-category telemetry capture settings.
13+
"""Per-category telemetry capture settings layered onto the default set.
1414
15-
Selection is opt-in: set a category to enabled=true to capture it; anything omitted is off. The default set (used by enabled=true with no per-category settings) is the lightweight operational signals: control, connection, system, captcha. The CDP categories (console, network, page, interaction) and screenshot are off by default and must be opted into.
15+
The operational signals (control, connection, system, captcha) are on by default and are opt-out: set one to enabled=false to stop capturing it. The CDP categories (console, network, page, interaction) and screenshot are off by default and are opt-in: set enabled=true to capture them.
1616
"""
1717

1818
captcha: BrowserTelemetryCategoryConfigParam

src/kernel/types/browsers/browser_telemetry_category_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ class BrowserTelemetryCategoryConfig(BaseModel):
1313
enabled: Optional[bool] = None
1414
"""Whether this category is captured.
1515
16-
Selection is opt-in, so an omitted category is not captured.
16+
Operational categories (control, connection, system, captcha) default to true;
17+
set false to opt out. CDP categories (console, network, page, interaction) and
18+
screenshot default to false; set true to opt in.
1719
"""

src/kernel/types/browsers/browser_telemetry_category_config_param.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ class BrowserTelemetryCategoryConfigParam(TypedDict, total=False):
1313
enabled: bool
1414
"""Whether this category is captured.
1515
16-
Selection is opt-in, so an omitted category is not captured.
16+
Operational categories (control, connection, system, captcha) default to true;
17+
set false to opt out. CDP categories (console, network, page, interaction) and
18+
screenshot default to false; set true to opt in.
1719
"""

0 commit comments

Comments
 (0)