Skip to content

feat(cursor_sdk): instrument Cursor agent runs - #665

Open
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
mainfrom
abhi-cursor-sdk
Open

feat(cursor_sdk): instrument Cursor agent runs#665
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
mainfrom
abhi-cursor-sdk

Conversation

@AbhiPrasad

Copy link
Copy Markdown
Member

resolves https://github.com/braintrustdata/braintrust-sdk-python/issues

Automatic instrumentation is preferred and must run before importing cursor_sdk:

import braintrust

braintrust.auto_instrument()
braintrust.init_logger(project="my-project")

For manual setup:

from braintrust.integrations.cursor_sdk import setup_cursor_sdk

setup_cursor_sdk(project="my-project")

Custom agent classes can also be instrumented directly:

from braintrust.integrations.cursor_sdk import wrap_cursor_sdk_agent

wrap_cursor_sdk_agent(MyAgent)

Requires Python >=3.10 and cursor-sdk >=1.0.25. The test matrix covers the minimum 1.0.25 release and the latest pinned release, 1.0.26.

Add tracing for sync and async Cursor agents, model turns, tools, usage,
errors, and multimodal attachments, with versioned VCR coverage.

Automatic instrumentation is preferred and must run before importing
`cursor_sdk`:

```python
import braintrust

braintrust.auto_instrument()
braintrust.init_logger(project="my-project")
```

For manual setup:

```python
from braintrust.integrations.cursor_sdk import setup_cursor_sdk

setup_cursor_sdk(project="my-project")
```

Custom agent classes can also be instrumented directly:

```python
from braintrust.integrations.cursor_sdk import wrap_cursor_sdk_agent

wrap_cursor_sdk_agent(MyAgent)
```

Requires Python >=3.10 and cursor-sdk >=1.0.25. The test matrix covers
the minimum 1.0.25 release and the latest pinned release, 1.0.26.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant