diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 00000000..a18a3f9e --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,20 @@ +name: Release Please +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + if: github.repository == 'kernel/kernel-python-sdk' + runs-on: ubuntu-latest + + steps: + - uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1 + id: release + with: + token: ${{ secrets.RELEASE_PLEASE_TOKEN }} diff --git a/.stats.yml b/.stats.yml index fcd634ae..71c320fc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1 @@ configured_endpoints: 127 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-3fc18876d59a47ed6993892cc5f69d7461fe2ca6a94fad43905677955a5adc55.yml -openapi_spec_hash: 75d990158aeb0dac3d3ef8da476e86b9 -config_hash: 77ee715aa17061166f9a02b264a21b8d diff --git a/api.md b/api.md index edc133e0..2685a9d5 100644 --- a/api.md +++ b/api.md @@ -146,6 +146,8 @@ from kernel.types.browsers import ( BrowserTelemetryCategoryConfig, BrowserTelemetryConfig, BrowserTelemetryEvent, + BrowserTelemetryExportConfig, + BrowserTelemetryOtlpExportConfig, TelemetryEventsResponse, TelemetryStreamResponse, ) diff --git a/release-please-config.json b/release-please-config.json index 942ec08a..bdba3b86 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -2,11 +2,11 @@ "packages": { ".": {} }, - "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", "include-v-in-tag": true, "include-component-in-tag": false, "versioning": "prerelease", - "prerelease": true, + "prerelease": false, "bump-minor-pre-major": true, "bump-patch-for-minor-pre-major": false, "pull-request-header": "Automated Release PR", diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 14b2cc82..960fa64b 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -20,7 +20,7 @@ UPLOAD_RESPONSE=$(curl -v -X PUT \ if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" - echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/kernel-python/$SHA/$FILENAME'\033[0m" + echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/kernel-python-sdk-staging/$SHA/$FILENAME'\033[0m" else echo -e "\033[31mFailed to upload artifact.\033[0m" exit 1 diff --git a/src/kernel/resources/browsers/browsers.py b/src/kernel/resources/browsers/browsers.py index ae4279ed..553a98dd 100644 --- a/src/kernel/resources/browsers/browsers.py +++ b/src/kernel/resources/browsers/browsers.py @@ -439,7 +439,7 @@ def list( offset: Number of results to skip. Defaults to 0. - query: Search browsers by name, session ID, profile ID, proxy ID, or pool name. + query: Search browsers by name, session ID, profile name or ID, proxy ID, or pool name. status: Filter sessions by status. "active" returns only active sessions (default), "deleted" returns only soft-deleted sessions, "all" returns both. @@ -1017,7 +1017,7 @@ def list( offset: Number of results to skip. Defaults to 0. - query: Search browsers by name, session ID, profile ID, proxy ID, or pool name. + query: Search browsers by name, session ID, profile name or ID, proxy ID, or pool name. status: Filter sessions by status. "active" returns only active sessions (default), "deleted" returns only soft-deleted sessions, "all" returns both. diff --git a/src/kernel/types/auth/connection_create_params.py b/src/kernel/types/auth/connection_create_params.py index ed94bf37..407857be 100644 --- a/src/kernel/types/auth/connection_create_params.py +++ b/src/kernel/types/auth/connection_create_params.py @@ -8,7 +8,15 @@ from ..._types import SequenceNotStr from ..browsers.browser_telemetry_categories_config_param import BrowserTelemetryCategoriesConfigParam -__all__ = ["ConnectionCreateParams", "BrowserTelemetry", "Credential", "Proxy"] +__all__ = [ + "ConnectionCreateParams", + "BrowserTelemetry", + "BrowserTelemetryExport", + "BrowserTelemetryExportOtlp", + "BrowserTelemetryExportOtlpDestination", + "Credential", + "Proxy", +] class ConnectionCreateParams(TypedDict, total=False): @@ -111,6 +119,50 @@ class ConnectionCreateParams(TypedDict, total=False): """ +class BrowserTelemetryExportOtlpDestination(TypedDict, total=False): + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + id: str + """OTLP destination ID""" + + name: str + """OTLP destination name""" + + +class BrowserTelemetryExportOtlp(TypedDict, total=False): + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + destination: BrowserTelemetryExportOtlpDestination + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + enabled: bool + """Whether to export captured telemetry over OTLP. + + Setting destination implies enabled=true, so this only needs to be set + explicitly to disable export (enabled=false with a destination is rejected). + """ + + +class BrowserTelemetryExport(TypedDict, total=False): + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + + otlp: BrowserTelemetryExportOtlp + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + class BrowserTelemetry(TypedDict, total=False): """ Browser telemetry configuration used by this connection's browser sessions by default. Uses the exact create-browser configuration. Can be overridden per-login. @@ -143,6 +195,12 @@ class BrowserTelemetry(TypedDict, total=False): settings. """ + export: BrowserTelemetryExport + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + class Credential(TypedDict, total=False): """Reference to credentials for the auth connection. diff --git a/src/kernel/types/auth/connection_login_params.py b/src/kernel/types/auth/connection_login_params.py index 719ea678..117d3c7d 100644 --- a/src/kernel/types/auth/connection_login_params.py +++ b/src/kernel/types/auth/connection_login_params.py @@ -7,7 +7,14 @@ from ..browsers.browser_telemetry_categories_config_param import BrowserTelemetryCategoriesConfigParam -__all__ = ["ConnectionLoginParams", "BrowserTelemetry", "Proxy"] +__all__ = [ + "ConnectionLoginParams", + "BrowserTelemetry", + "BrowserTelemetryExport", + "BrowserTelemetryExportOtlp", + "BrowserTelemetryExportOtlpDestination", + "Proxy", +] class ConnectionLoginParams(TypedDict, total=False): @@ -35,6 +42,50 @@ class ConnectionLoginParams(TypedDict, total=False): """ +class BrowserTelemetryExportOtlpDestination(TypedDict, total=False): + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + id: str + """OTLP destination ID""" + + name: str + """OTLP destination name""" + + +class BrowserTelemetryExportOtlp(TypedDict, total=False): + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + destination: BrowserTelemetryExportOtlpDestination + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + enabled: bool + """Whether to export captured telemetry over OTLP. + + Setting destination implies enabled=true, so this only needs to be set + explicitly to disable export (enabled=false with a destination is rejected). + """ + + +class BrowserTelemetryExport(TypedDict, total=False): + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + + otlp: BrowserTelemetryExportOtlp + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + class BrowserTelemetry(TypedDict, total=False): """Override the connection's default browser telemetry configuration for this login. @@ -68,6 +119,12 @@ class BrowserTelemetry(TypedDict, total=False): settings. """ + export: BrowserTelemetryExport + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + class Proxy(TypedDict, total=False): """Proxy selection. diff --git a/src/kernel/types/auth/connection_update_params.py b/src/kernel/types/auth/connection_update_params.py index a14d486a..f92a40c7 100644 --- a/src/kernel/types/auth/connection_update_params.py +++ b/src/kernel/types/auth/connection_update_params.py @@ -8,7 +8,15 @@ from ..._types import SequenceNotStr from ..browsers.browser_telemetry_categories_config_param import BrowserTelemetryCategoriesConfigParam -__all__ = ["ConnectionUpdateParams", "BrowserTelemetry", "Credential", "Proxy"] +__all__ = [ + "ConnectionUpdateParams", + "BrowserTelemetry", + "BrowserTelemetryExport", + "BrowserTelemetryExportOtlp", + "BrowserTelemetryExportOtlpDestination", + "Credential", + "Proxy", +] class ConnectionUpdateParams(TypedDict, total=False): @@ -72,6 +80,50 @@ class ConnectionUpdateParams(TypedDict, total=False): """Whether to save credentials after every successful login""" +class BrowserTelemetryExportOtlpDestination(TypedDict, total=False): + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + id: str + """OTLP destination ID""" + + name: str + """OTLP destination name""" + + +class BrowserTelemetryExportOtlp(TypedDict, total=False): + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + destination: BrowserTelemetryExportOtlpDestination + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + enabled: bool + """Whether to export captured telemetry over OTLP. + + Setting destination implies enabled=true, so this only needs to be set + explicitly to disable export (enabled=false with a destination is rejected). + """ + + +class BrowserTelemetryExport(TypedDict, total=False): + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + + otlp: BrowserTelemetryExportOtlp + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + class BrowserTelemetry(TypedDict, total=False): """ Browser telemetry configuration used by future browser sessions for this connection. Uses the exact create-browser configuration. Set enabled to false to disable telemetry. @@ -104,6 +156,12 @@ class BrowserTelemetry(TypedDict, total=False): settings. """ + export: BrowserTelemetryExport + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + class Credential(TypedDict, total=False): """Reference to credentials for the auth connection. diff --git a/src/kernel/types/auth/managed_auth.py b/src/kernel/types/auth/managed_auth.py index 44e32270..e3bf7b9c 100644 --- a/src/kernel/types/auth/managed_auth.py +++ b/src/kernel/types/auth/managed_auth.py @@ -10,6 +10,9 @@ __all__ = [ "ManagedAuth", "BrowserTelemetry", + "BrowserTelemetryExport", + "BrowserTelemetryExportOtlp", + "BrowserTelemetryExportOtlpDestination", "Choice", "Credential", "DiscoveredField", @@ -20,6 +23,50 @@ ] +class BrowserTelemetryExportOtlpDestination(BaseModel): + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + id: Optional[str] = None + """OTLP destination ID""" + + name: Optional[str] = None + """OTLP destination name""" + + +class BrowserTelemetryExportOtlp(BaseModel): + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + destination: Optional[BrowserTelemetryExportOtlpDestination] = None + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + enabled: Optional[bool] = None + """Whether to export captured telemetry over OTLP. + + Setting destination implies enabled=true, so this only needs to be set + explicitly to disable export (enabled=false with a destination is rejected). + """ + + +class BrowserTelemetryExport(BaseModel): + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + + otlp: Optional[BrowserTelemetryExportOtlp] = None + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + class BrowserTelemetry(BaseModel): """ Browser telemetry configuration used by this connection's browser sessions by default. The exact create-browser configuration is preserved and can be overridden per-login. @@ -52,6 +99,12 @@ class BrowserTelemetry(BaseModel): settings. """ + export: Optional[BrowserTelemetryExport] = None + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + class Choice(BaseModel): """Canonical auth-flow choice awaiting user selection.""" diff --git a/src/kernel/types/browser_create_params.py b/src/kernel/types/browser_create_params.py index 01ac2598..f09a29cf 100644 --- a/src/kernel/types/browser_create_params.py +++ b/src/kernel/types/browser_create_params.py @@ -11,7 +11,13 @@ from .shared_params.browser_extension import BrowserExtension from .browsers.browser_telemetry_categories_config_param import BrowserTelemetryCategoriesConfigParam -__all__ = ["BrowserCreateParams", "Telemetry"] +__all__ = [ + "BrowserCreateParams", + "Telemetry", + "TelemetryExport", + "TelemetryExportOtlp", + "TelemetryExportOtlpDestination", +] class BrowserCreateParams(TypedDict, total=False): @@ -125,6 +131,50 @@ class BrowserCreateParams(TypedDict, total=False): """ +class TelemetryExportOtlpDestination(TypedDict, total=False): + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + id: str + """OTLP destination ID""" + + name: str + """OTLP destination name""" + + +class TelemetryExportOtlp(TypedDict, total=False): + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + destination: TelemetryExportOtlpDestination + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + enabled: bool + """Whether to export captured telemetry over OTLP. + + Setting destination implies enabled=true, so this only needs to be set + explicitly to disable export (enabled=false with a destination is rejected). + """ + + +class TelemetryExport(TypedDict, total=False): + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + + otlp: TelemetryExportOtlp + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + class Telemetry(TypedDict, total=False): """Telemetry configuration for the browser session. @@ -157,3 +207,9 @@ class Telemetry(TypedDict, total=False): capture on create. enabled=false cannot be combined with browser category settings. """ + + export: TelemetryExport + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ diff --git a/src/kernel/types/browser_list_params.py b/src/kernel/types/browser_list_params.py index 4006dfbe..57de2521 100644 --- a/src/kernel/types/browser_list_params.py +++ b/src/kernel/types/browser_list_params.py @@ -23,7 +23,9 @@ class BrowserListParams(TypedDict, total=False): """Number of results to skip. Defaults to 0.""" query: str - """Search browsers by name, session ID, profile ID, proxy ID, or pool name.""" + """ + Search browsers by name, session ID, profile name or ID, proxy ID, or pool name. + """ status: Literal["active", "deleted", "all"] """Filter sessions by status. diff --git a/src/kernel/types/browser_pool_acquire_params.py b/src/kernel/types/browser_pool_acquire_params.py index 70567ee3..bd50be1b 100644 --- a/src/kernel/types/browser_pool_acquire_params.py +++ b/src/kernel/types/browser_pool_acquire_params.py @@ -8,7 +8,13 @@ from .tags_param import TagsParam from .browsers.browser_telemetry_categories_config_param import BrowserTelemetryCategoriesConfigParam -__all__ = ["BrowserPoolAcquireParams", "Telemetry"] +__all__ = [ + "BrowserPoolAcquireParams", + "Telemetry", + "TelemetryExport", + "TelemetryExportOtlp", + "TelemetryExportOtlpDestination", +] class BrowserPoolAcquireParams(TypedDict, total=False): @@ -54,6 +60,50 @@ class BrowserPoolAcquireParams(TypedDict, total=False): """ +class TelemetryExportOtlpDestination(TypedDict, total=False): + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + id: str + """OTLP destination ID""" + + name: str + """OTLP destination name""" + + +class TelemetryExportOtlp(TypedDict, total=False): + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + destination: TelemetryExportOtlpDestination + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + enabled: bool + """Whether to export captured telemetry over OTLP. + + Setting destination implies enabled=true, so this only needs to be set + explicitly to disable export (enabled=false with a destination is rejected). + """ + + +class TelemetryExport(TypedDict, total=False): + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + + otlp: TelemetryExportOtlp + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + class Telemetry(TypedDict, total=False): """Telemetry override for the acquired browser, applied to this lease only. @@ -86,3 +136,9 @@ class Telemetry(TypedDict, total=False): capture on create. enabled=false cannot be combined with browser category settings. """ + + export: TelemetryExport + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ diff --git a/src/kernel/types/browser_pool_create_params.py b/src/kernel/types/browser_pool_create_params.py index 376af6b6..fb6aa63b 100644 --- a/src/kernel/types/browser_pool_create_params.py +++ b/src/kernel/types/browser_pool_create_params.py @@ -9,7 +9,14 @@ from .shared_params.browser_extension import BrowserExtension from .browsers.browser_telemetry_categories_config_param import BrowserTelemetryCategoriesConfigParam -__all__ = ["BrowserPoolCreateParams", "Profile", "Telemetry"] +__all__ = [ + "BrowserPoolCreateParams", + "Profile", + "Telemetry", + "TelemetryExport", + "TelemetryExportOtlp", + "TelemetryExportOtlpDestination", +] class BrowserPoolCreateParams(TypedDict, total=False): @@ -143,6 +150,50 @@ class Profile(TypedDict, total=False): """ +class TelemetryExportOtlpDestination(TypedDict, total=False): + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + id: str + """OTLP destination ID""" + + name: str + """OTLP destination name""" + + +class TelemetryExportOtlp(TypedDict, total=False): + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + destination: TelemetryExportOtlpDestination + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + enabled: bool + """Whether to export captured telemetry over OTLP. + + Setting destination implies enabled=true, so this only needs to be set + explicitly to disable export (enabled=false with a destination is rejected). + """ + + +class TelemetryExport(TypedDict, total=False): + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + + otlp: TelemetryExportOtlp + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + class Telemetry(TypedDict, total=False): """Telemetry configuration applied to browsers warmed into this pool. @@ -175,3 +226,9 @@ class Telemetry(TypedDict, total=False): capture on create. enabled=false cannot be combined with browser category settings. """ + + export: TelemetryExport + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ diff --git a/src/kernel/types/browser_pool_update_params.py b/src/kernel/types/browser_pool_update_params.py index b0956048..069181c3 100644 --- a/src/kernel/types/browser_pool_update_params.py +++ b/src/kernel/types/browser_pool_update_params.py @@ -9,7 +9,14 @@ from .shared_params.browser_extension import BrowserExtension from .browsers.browser_telemetry_categories_config_param import BrowserTelemetryCategoriesConfigParam -__all__ = ["BrowserPoolUpdateParams", "Profile", "Telemetry"] +__all__ = [ + "BrowserPoolUpdateParams", + "Profile", + "Telemetry", + "TelemetryExport", + "TelemetryExportOtlp", + "TelemetryExportOtlpDestination", +] class BrowserPoolUpdateParams(TypedDict, total=False): @@ -154,6 +161,50 @@ class Profile(TypedDict, total=False): """ +class TelemetryExportOtlpDestination(TypedDict, total=False): + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + id: str + """OTLP destination ID""" + + name: str + """OTLP destination name""" + + +class TelemetryExportOtlp(TypedDict, total=False): + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + destination: TelemetryExportOtlpDestination + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + enabled: bool + """Whether to export captured telemetry over OTLP. + + Setting destination implies enabled=true, so this only needs to be set + explicitly to disable export (enabled=false with a destination is rejected). + """ + + +class TelemetryExport(TypedDict, total=False): + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + + otlp: TelemetryExportOtlp + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + class Telemetry(TypedDict, total=False): """If provided, updates the pool's telemetry configuration. @@ -186,3 +237,9 @@ class Telemetry(TypedDict, total=False): capture on create. enabled=false cannot be combined with browser category settings. """ + + export: TelemetryExport + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ diff --git a/src/kernel/types/browser_update_params.py b/src/kernel/types/browser_update_params.py index 3c3140ee..01b19c8a 100644 --- a/src/kernel/types/browser_update_params.py +++ b/src/kernel/types/browser_update_params.py @@ -10,7 +10,14 @@ from .shared_params.browser_viewport import BrowserViewport from .browsers.browser_telemetry_categories_config_param import BrowserTelemetryCategoriesConfigParam -__all__ = ["BrowserUpdateParams", "Telemetry", "Viewport"] +__all__ = [ + "BrowserUpdateParams", + "Telemetry", + "TelemetryExport", + "TelemetryExportOtlp", + "TelemetryExportOtlpDestination", + "Viewport", +] class BrowserUpdateParams(TypedDict, total=False): @@ -61,6 +68,50 @@ class BrowserUpdateParams(TypedDict, total=False): """Viewport configuration to apply to the browser session.""" +class TelemetryExportOtlpDestination(TypedDict, total=False): + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + id: str + """OTLP destination ID""" + + name: str + """OTLP destination name""" + + +class TelemetryExportOtlp(TypedDict, total=False): + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + destination: TelemetryExportOtlpDestination + """OTLP destination to export this session's captured telemetry to. + + Provide either id or name. Requires telemetry capture to be enabled. + """ + + enabled: bool + """Whether to export captured telemetry over OTLP. + + Setting destination implies enabled=true, so this only needs to be set + explicitly to disable export (enabled=false with a destination is rejected). + """ + + +class TelemetryExport(TypedDict, total=False): + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + + otlp: TelemetryExportOtlp + """ + Export captured telemetry over OTLP to one of the org's configured destinations. + """ + + class Telemetry(TypedDict, total=False): """Telemetry configuration. @@ -94,6 +145,12 @@ class Telemetry(TypedDict, total=False): settings. """ + export: TelemetryExport + """Where to export this session's captured telemetry. + + Omit to capture without exporting. + """ + class Viewport(BrowserViewport, total=False): """Viewport configuration to apply to the browser session.""" diff --git a/src/kernel/types/browsers/__init__.py b/src/kernel/types/browsers/__init__.py index 990e8e19..bf9d861a 100644 --- a/src/kernel/types/browsers/__init__.py +++ b/src/kernel/types/browsers/__init__.py @@ -69,6 +69,7 @@ from .browser_interaction_click_event import BrowserInteractionClickEvent as BrowserInteractionClickEvent from .browser_live_view_connect_event import BrowserLiveViewConnectEvent as BrowserLiveViewConnectEvent from .browser_page_layout_shift_event import BrowserPageLayoutShiftEvent as BrowserPageLayoutShiftEvent +from .browser_telemetry_export_config import BrowserTelemetryExportConfig as BrowserTelemetryExportConfig from .computer_write_clipboard_params import ComputerWriteClipboardParams as ComputerWriteClipboardParams from .browser_monitor_screenshot_event import BrowserMonitorScreenshotEvent as BrowserMonitorScreenshotEvent from .computer_read_clipboard_response import ComputerReadClipboardResponse as ComputerReadClipboardResponse @@ -82,6 +83,7 @@ from .computer_capture_screenshot_params import ComputerCaptureScreenshotParams as ComputerCaptureScreenshotParams from .browser_telemetry_categories_config import BrowserTelemetryCategoriesConfig as BrowserTelemetryCategoriesConfig from .browser_network_loading_failed_event import BrowserNetworkLoadingFailedEvent as BrowserNetworkLoadingFailedEvent +from .browser_telemetry_otlp_export_config import BrowserTelemetryOtlpExportConfig as BrowserTelemetryOtlpExportConfig from .computer_get_mouse_position_response import ComputerGetMousePositionResponse as ComputerGetMousePositionResponse from .browser_page_dom_content_loaded_event import BrowserPageDomContentLoadedEvent as BrowserPageDomContentLoadedEvent from .browser_page_navigation_settled_event import ( diff --git a/src/kernel/types/browsers/browser_telemetry_config.py b/src/kernel/types/browsers/browser_telemetry_config.py index 2fae7a3d..8d24e6bf 100644 --- a/src/kernel/types/browsers/browser_telemetry_config.py +++ b/src/kernel/types/browsers/browser_telemetry_config.py @@ -3,6 +3,7 @@ from typing import Optional from ..._models import BaseModel +from .browser_telemetry_export_config import BrowserTelemetryExportConfig from .browser_telemetry_categories_config import BrowserTelemetryCategoriesConfig __all__ = ["BrowserTelemetryConfig"] @@ -13,3 +14,9 @@ class BrowserTelemetryConfig(BaseModel): browser: Optional[BrowserTelemetryCategoriesConfig] = None """Per-category enable/disable flags.""" + + export: Optional[BrowserTelemetryExportConfig] = None + """Where the session's captured telemetry is being exported. + + Omitted when the export state is unknown. + """ diff --git a/src/kernel/types/browsers/browser_telemetry_export_config.py b/src/kernel/types/browsers/browser_telemetry_export_config.py new file mode 100644 index 00000000..8aa93704 --- /dev/null +++ b/src/kernel/types/browsers/browser_telemetry_export_config.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .browser_telemetry_otlp_export_config import BrowserTelemetryOtlpExportConfig + +__all__ = ["BrowserTelemetryExportConfig"] + + +class BrowserTelemetryExportConfig(BaseModel): + """Active export state for a session's captured telemetry, by protocol.""" + + otlp: Optional[BrowserTelemetryOtlpExportConfig] = None + """Active OTLP export state.""" diff --git a/src/kernel/types/browsers/browser_telemetry_otlp_export_config.py b/src/kernel/types/browsers/browser_telemetry_otlp_export_config.py new file mode 100644 index 00000000..3626a5f6 --- /dev/null +++ b/src/kernel/types/browsers/browser_telemetry_otlp_export_config.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["BrowserTelemetryOtlpExportConfig"] + + +class BrowserTelemetryOtlpExportConfig(BaseModel): + """Active OTLP export state for a browser session.""" + + destination: Optional[str] = None + """ID of the OTLP destination the session is bound to. + + Omitted when the session is not exporting. + """ + + enabled: Optional[bool] = None + """Whether the session is exporting captured telemetry over OTLP.""" diff --git a/tests/api_resources/auth/test_connections.py b/tests/api_resources/auth/test_connections.py index 6c7423e6..321e84e4 100644 --- a/tests/api_resources/auth/test_connections.py +++ b/tests/api_resources/auth/test_connections.py @@ -53,6 +53,15 @@ def test_method_create_with_all_params(self, client: Kernel) -> None: "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, credential={ "auto": True, @@ -170,6 +179,15 @@ def test_method_update_with_all_params(self, client: Kernel) -> None: "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, credential={ "auto": True, @@ -372,6 +390,15 @@ def test_method_login_with_all_params(self, client: Kernel) -> None: "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, proxy={ "id": "id", @@ -567,6 +594,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncKernel) -> "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, credential={ "auto": True, @@ -684,6 +720,15 @@ async def test_method_update_with_all_params(self, async_client: AsyncKernel) -> "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, credential={ "auto": True, @@ -886,6 +931,15 @@ async def test_method_login_with_all_params(self, async_client: AsyncKernel) -> "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, proxy={ "id": "id", diff --git a/tests/api_resources/test_browser_pools.py b/tests/api_resources/test_browser_pools.py index 31657789..a85d5be7 100644 --- a/tests/api_resources/test_browser_pools.py +++ b/tests/api_resources/test_browser_pools.py @@ -66,6 +66,15 @@ def test_method_create_with_all_params(self, client: Kernel) -> None: "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, timeout_seconds=10, viewport={ @@ -191,6 +200,15 @@ def test_method_update_with_all_params(self, client: Kernel) -> None: "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, timeout_seconds=10, viewport={ @@ -358,6 +376,15 @@ def test_method_acquire_with_all_params(self, client: Kernel) -> None: "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, ) assert_matches_type(BrowserPoolAcquireResponse, browser_pool, path=["response"]) @@ -545,6 +572,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncKernel) -> "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, timeout_seconds=10, viewport={ @@ -670,6 +706,15 @@ async def test_method_update_with_all_params(self, async_client: AsyncKernel) -> "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, timeout_seconds=10, viewport={ @@ -837,6 +882,15 @@ async def test_method_acquire_with_all_params(self, async_client: AsyncKernel) - "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, ) assert_matches_type(BrowserPoolAcquireResponse, browser_pool, path=["response"]) diff --git a/tests/api_resources/test_browsers.py b/tests/api_resources/test_browsers.py index 322fffed..a8f93efc 100644 --- a/tests/api_resources/test_browsers.py +++ b/tests/api_resources/test_browsers.py @@ -71,6 +71,15 @@ def test_method_create_with_all_params(self, client: Kernel) -> None: "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, timeout_seconds=10, viewport={ @@ -192,6 +201,15 @@ def test_method_update_with_all_params(self, client: Kernel) -> None: "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, viewport={ "height": 800, @@ -498,6 +516,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncKernel) -> "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, timeout_seconds=10, viewport={ @@ -619,6 +646,15 @@ async def test_method_update_with_all_params(self, async_client: AsyncKernel) -> "system": {"enabled": True}, }, "enabled": True, + "export": { + "otlp": { + "destination": { + "id": "id", + "name": "name", + }, + "enabled": True, + } + }, }, viewport={ "height": 800,