Skip to content

Commit 8479adf

Browse files
feat: Add customer-facing OTLP destination CRUD API
Stainless-Generated-From: fc9d70b47afce5656d62cc298600a5e249ea0d63
1 parent ccf4127 commit 8479adf

16 files changed

Lines changed: 1548 additions & 9 deletions

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 134
1+
configured_endpoints: 139

api.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,24 @@ Methods:
342342
- <code title="post /auth/connections/{id}/submit">client.auth.connections.<a href="./src/kernel/resources/auth/connections.py">submit</a>(id, \*\*<a href="src/kernel/types/auth/connection_submit_params.py">params</a>) -> <a href="./src/kernel/types/auth/submit_fields_response.py">SubmitFieldsResponse</a></code>
343343
- <code title="get /auth/connections/{id}/timeline">client.auth.connections.<a href="./src/kernel/resources/auth/connections.py">timeline</a>(id, \*\*<a href="src/kernel/types/auth/connection_timeline_params.py">params</a>) -> <a href="./src/kernel/types/auth/managed_auth_timeline_event.py">SyncOffsetPagination[ManagedAuthTimelineEvent]</a></code>
344344

345+
# Telemetry
346+
347+
## Destinations
348+
349+
Types:
350+
351+
```python
352+
from kernel.types.telemetry import OtlpDestination
353+
```
354+
355+
Methods:
356+
357+
- <code title="post /telemetry/destinations">client.telemetry.destinations.<a href="./src/kernel/resources/telemetry/destinations.py">create</a>(\*\*<a href="src/kernel/types/telemetry/destination_create_params.py">params</a>) -> <a href="./src/kernel/types/telemetry/otlp_destination.py">OtlpDestination</a></code>
358+
- <code title="get /telemetry/destinations/{id_or_name}">client.telemetry.destinations.<a href="./src/kernel/resources/telemetry/destinations.py">retrieve</a>(id_or_name) -> <a href="./src/kernel/types/telemetry/otlp_destination.py">OtlpDestination</a></code>
359+
- <code title="patch /telemetry/destinations/{id_or_name}">client.telemetry.destinations.<a href="./src/kernel/resources/telemetry/destinations.py">update</a>(id_or_name, \*\*<a href="src/kernel/types/telemetry/destination_update_params.py">params</a>) -> <a href="./src/kernel/types/telemetry/otlp_destination.py">OtlpDestination</a></code>
360+
- <code title="get /telemetry/destinations">client.telemetry.destinations.<a href="./src/kernel/resources/telemetry/destinations.py">list</a>(\*\*<a href="src/kernel/types/telemetry/destination_list_params.py">params</a>) -> <a href="./src/kernel/types/telemetry/otlp_destination.py">SyncOffsetPagination[OtlpDestination]</a></code>
361+
- <code title="delete /telemetry/destinations/{id_or_name}">client.telemetry.destinations.<a href="./src/kernel/resources/telemetry/destinations.py">delete</a>(id_or_name) -> None</code>
362+
345363
# Proxies
346364

347365
Types:

src/kernel/_client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
browsers,
5555
profiles,
5656
projects,
57+
telemetry,
5758
audit_logs,
5859
extensions,
5960
credentials,
@@ -75,6 +76,7 @@
7576
from .resources.browser_pools import BrowserPoolsResource, AsyncBrowserPoolsResource
7677
from .resources.browsers.browsers import BrowsersResource, AsyncBrowsersResource
7778
from .resources.projects.projects import ProjectsResource, AsyncProjectsResource
79+
from .resources.telemetry.telemetry import TelemetryResource, AsyncTelemetryResource
7880
from .resources.credential_providers import CredentialProvidersResource, AsyncCredentialProvidersResource
7981
from .resources.audit_logs.audit_logs import AuditLogsResource, AsyncAuditLogsResource
8082
from .resources.organization.organization import OrganizationResource, AsyncOrganizationResource
@@ -240,6 +242,12 @@ def auth(self) -> AuthResource:
240242

241243
return AuthResource(self)
242244

245+
@cached_property
246+
def telemetry(self) -> TelemetryResource:
247+
from .resources.telemetry import TelemetryResource
248+
249+
return TelemetryResource(self)
250+
243251
@cached_property
244252
def proxies(self) -> ProxiesResource:
245253
"""Create and manage proxy configurations for routing browser traffic."""
@@ -603,6 +611,12 @@ def auth(self) -> AsyncAuthResource:
603611

604612
return AsyncAuthResource(self)
605613

614+
@cached_property
615+
def telemetry(self) -> AsyncTelemetryResource:
616+
from .resources.telemetry import AsyncTelemetryResource
617+
618+
return AsyncTelemetryResource(self)
619+
606620
@cached_property
607621
def proxies(self) -> AsyncProxiesResource:
608622
"""Create and manage proxy configurations for routing browser traffic."""
@@ -870,6 +884,12 @@ def auth(self) -> auth.AuthResourceWithRawResponse:
870884

871885
return AuthResourceWithRawResponse(self._client.auth)
872886

887+
@cached_property
888+
def telemetry(self) -> telemetry.TelemetryResourceWithRawResponse:
889+
from .resources.telemetry import TelemetryResourceWithRawResponse
890+
891+
return TelemetryResourceWithRawResponse(self._client.telemetry)
892+
873893
@cached_property
874894
def proxies(self) -> proxies.ProxiesResourceWithRawResponse:
875895
"""Create and manage proxy configurations for routing browser traffic."""
@@ -984,6 +1004,12 @@ def auth(self) -> auth.AsyncAuthResourceWithRawResponse:
9841004

9851005
return AsyncAuthResourceWithRawResponse(self._client.auth)
9861006

1007+
@cached_property
1008+
def telemetry(self) -> telemetry.AsyncTelemetryResourceWithRawResponse:
1009+
from .resources.telemetry import AsyncTelemetryResourceWithRawResponse
1010+
1011+
return AsyncTelemetryResourceWithRawResponse(self._client.telemetry)
1012+
9871013
@cached_property
9881014
def proxies(self) -> proxies.AsyncProxiesResourceWithRawResponse:
9891015
"""Create and manage proxy configurations for routing browser traffic."""
@@ -1098,6 +1124,12 @@ def auth(self) -> auth.AuthResourceWithStreamingResponse:
10981124

10991125
return AuthResourceWithStreamingResponse(self._client.auth)
11001126

1127+
@cached_property
1128+
def telemetry(self) -> telemetry.TelemetryResourceWithStreamingResponse:
1129+
from .resources.telemetry import TelemetryResourceWithStreamingResponse
1130+
1131+
return TelemetryResourceWithStreamingResponse(self._client.telemetry)
1132+
11011133
@cached_property
11021134
def proxies(self) -> proxies.ProxiesResourceWithStreamingResponse:
11031135
"""Create and manage proxy configurations for routing browser traffic."""
@@ -1212,6 +1244,12 @@ def auth(self) -> auth.AsyncAuthResourceWithStreamingResponse:
12121244

12131245
return AsyncAuthResourceWithStreamingResponse(self._client.auth)
12141246

1247+
@cached_property
1248+
def telemetry(self) -> telemetry.AsyncTelemetryResourceWithStreamingResponse:
1249+
from .resources.telemetry import AsyncTelemetryResourceWithStreamingResponse
1250+
1251+
return AsyncTelemetryResourceWithStreamingResponse(self._client.telemetry)
1252+
12151253
@cached_property
12161254
def proxies(self) -> proxies.AsyncProxiesResourceWithStreamingResponse:
12171255
"""Create and manage proxy configurations for routing browser traffic."""

src/kernel/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656
ProjectsResourceWithStreamingResponse,
5757
AsyncProjectsResourceWithStreamingResponse,
5858
)
59+
from .telemetry import (
60+
TelemetryResource,
61+
AsyncTelemetryResource,
62+
TelemetryResourceWithRawResponse,
63+
AsyncTelemetryResourceWithRawResponse,
64+
TelemetryResourceWithStreamingResponse,
65+
AsyncTelemetryResourceWithStreamingResponse,
66+
)
5967
from .audit_logs import (
6068
AuditLogsResource,
6169
AsyncAuditLogsResource,
@@ -158,6 +166,12 @@
158166
"AsyncAuthResourceWithRawResponse",
159167
"AuthResourceWithStreamingResponse",
160168
"AsyncAuthResourceWithStreamingResponse",
169+
"TelemetryResource",
170+
"AsyncTelemetryResource",
171+
"TelemetryResourceWithRawResponse",
172+
"AsyncTelemetryResourceWithRawResponse",
173+
"TelemetryResourceWithStreamingResponse",
174+
"AsyncTelemetryResourceWithStreamingResponse",
161175
"ProxiesResource",
162176
"AsyncProxiesResource",
163177
"ProxiesResourceWithRawResponse",

src/kernel/resources/browsers/browsers.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ class BrowsersResource(SyncAPIResource):
113113

114114
@cached_property
115115
def telemetry(self) -> TelemetryResource:
116-
"""Stream live telemetry events from a browser session."""
116+
"""
117+
Stream live telemetry events from a browser session, and manage the destinations sessions export them to.
118+
"""
117119
return TelemetryResource(self._client)
118120

119121
@cached_property
@@ -731,7 +733,9 @@ class AsyncBrowsersResource(AsyncAPIResource):
731733

732734
@cached_property
733735
def telemetry(self) -> AsyncTelemetryResource:
734-
"""Stream live telemetry events from a browser session."""
736+
"""
737+
Stream live telemetry events from a browser session, and manage the destinations sessions export them to.
738+
"""
735739
return AsyncTelemetryResource(self._client)
736740

737741
@cached_property
@@ -1372,7 +1376,9 @@ def __init__(self, browsers: BrowsersResource) -> None:
13721376

13731377
@cached_property
13741378
def telemetry(self) -> TelemetryResourceWithRawResponse:
1375-
"""Stream live telemetry events from a browser session."""
1379+
"""
1380+
Stream live telemetry events from a browser session, and manage the destinations sessions export them to.
1381+
"""
13761382
return TelemetryResourceWithRawResponse(self._browsers.telemetry)
13771383

13781384
@cached_property
@@ -1434,7 +1440,9 @@ def __init__(self, browsers: AsyncBrowsersResource) -> None:
14341440

14351441
@cached_property
14361442
def telemetry(self) -> AsyncTelemetryResourceWithRawResponse:
1437-
"""Stream live telemetry events from a browser session."""
1443+
"""
1444+
Stream live telemetry events from a browser session, and manage the destinations sessions export them to.
1445+
"""
14381446
return AsyncTelemetryResourceWithRawResponse(self._browsers.telemetry)
14391447

14401448
@cached_property
@@ -1496,7 +1504,9 @@ def __init__(self, browsers: BrowsersResource) -> None:
14961504

14971505
@cached_property
14981506
def telemetry(self) -> TelemetryResourceWithStreamingResponse:
1499-
"""Stream live telemetry events from a browser session."""
1507+
"""
1508+
Stream live telemetry events from a browser session, and manage the destinations sessions export them to.
1509+
"""
15001510
return TelemetryResourceWithStreamingResponse(self._browsers.telemetry)
15011511

15021512
@cached_property
@@ -1558,7 +1568,9 @@ def __init__(self, browsers: AsyncBrowsersResource) -> None:
15581568

15591569
@cached_property
15601570
def telemetry(self) -> AsyncTelemetryResourceWithStreamingResponse:
1561-
"""Stream live telemetry events from a browser session."""
1571+
"""
1572+
Stream live telemetry events from a browser session, and manage the destinations sessions export them to.
1573+
"""
15621574
return AsyncTelemetryResourceWithStreamingResponse(self._browsers.telemetry)
15631575

15641576
@cached_property

src/kernel/resources/browsers/telemetry.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828

2929

3030
class TelemetryResource(SyncAPIResource):
31-
"""Stream live telemetry events from a browser session."""
31+
"""
32+
Stream live telemetry events from a browser session, and manage the destinations sessions export them to.
33+
"""
3234

3335
@cached_property
3436
def with_raw_response(self) -> TelemetryResourceWithRawResponse:
@@ -202,7 +204,9 @@ def stream(
202204

203205

204206
class AsyncTelemetryResource(AsyncAPIResource):
205-
"""Stream live telemetry events from a browser session."""
207+
"""
208+
Stream live telemetry events from a browser session, and manage the destinations sessions export them to.
209+
"""
206210

207211
@cached_property
208212
def with_raw_response(self) -> AsyncTelemetryResourceWithRawResponse:
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .telemetry import (
4+
TelemetryResource,
5+
AsyncTelemetryResource,
6+
TelemetryResourceWithRawResponse,
7+
AsyncTelemetryResourceWithRawResponse,
8+
TelemetryResourceWithStreamingResponse,
9+
AsyncTelemetryResourceWithStreamingResponse,
10+
)
11+
from .destinations import (
12+
DestinationsResource,
13+
AsyncDestinationsResource,
14+
DestinationsResourceWithRawResponse,
15+
AsyncDestinationsResourceWithRawResponse,
16+
DestinationsResourceWithStreamingResponse,
17+
AsyncDestinationsResourceWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"DestinationsResource",
22+
"AsyncDestinationsResource",
23+
"DestinationsResourceWithRawResponse",
24+
"AsyncDestinationsResourceWithRawResponse",
25+
"DestinationsResourceWithStreamingResponse",
26+
"AsyncDestinationsResourceWithStreamingResponse",
27+
"TelemetryResource",
28+
"AsyncTelemetryResource",
29+
"TelemetryResourceWithRawResponse",
30+
"AsyncTelemetryResourceWithRawResponse",
31+
"TelemetryResourceWithStreamingResponse",
32+
"AsyncTelemetryResourceWithStreamingResponse",
33+
]

0 commit comments

Comments
 (0)