Skip to content

telemetry + debug logging #569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Mar 15, 2025
Merged

telemetry + debug logging #569

merged 14 commits into from
Mar 15, 2025

Conversation

seanmcguire12
Copy link
Member

@seanmcguire12 seanmcguire12 commented Mar 11, 2025

why

  • telemetry (tokens, complete call/response history between stagehand & LLM)

usage

  • call stagehand.metrics and log the result to see token usage metrics
  • set logInferenceToFile: true in stagehand constructor params to have the entire call/response history logged to files

Copy link

changeset-bot bot commented Mar 11, 2025

🦋 Changeset detected

Latest commit: 1ae7ebe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@browserbasehq/stagehand Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@seanmcguire12 seanmcguire12 added act These changes pertain to the act function extract These changes pertain to the extract function observe These changes pertain to the observe function text-extract targeted-extract These changes pertain to targeted extract labels Mar 11, 2025
@seanmcguire12 seanmcguire12 changed the title [WIP] Debug logging Debug logging Mar 11, 2025
@seanmcguire12 seanmcguire12 marked this pull request as ready for review March 11, 2025 23:00
@seanmcguire12 seanmcguire12 requested a review from kamath March 11, 2025 23:00
@seanmcguire12 seanmcguire12 mentioned this pull request Mar 12, 2025
# Conflicts:
#	lib/index.ts
#	types/stagehand.ts
@seanmcguire12 seanmcguire12 removed act These changes pertain to the act function extract These changes pertain to the extract function observe These changes pertain to the observe function text-extract targeted-extract These changes pertain to targeted extract labels Mar 13, 2025
# Conflicts:
#	lib/handlers/extractHandler.ts
@seanmcguire12 seanmcguire12 changed the title Debug logging telemetry + debug logging Mar 15, 2025
@seanmcguire12 seanmcguire12 merged commit 17e8b40 into main Mar 15, 2025
15 checks passed
@github-actions github-actions bot mentioned this pull request Mar 15, 2025
kamath pushed a commit that referenced this pull request Mar 25, 2025
* telemetry

* empty catch block for now

* prettier

* stagehand.metrics instead of stagehand.getMetrics()

* add inferenceLogUtils file

* collect tokens from anthropic

* changeset

* single updateMetrics function

* rm import
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.

2 participants