Skip to content

docs: add OpenTelemetry provider guides - #2919

Open
antonvishal wants to merge 5 commits into
browserbase:mainfrom
antonvishal:o11y-providers
Open

antonvishal wants to merge 5 commits into
browserbase:mainfrom
antonvishal:o11y-providers

Conversation

@antonvishal

@antonvishal antonvishal commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds Stagehand v4 OTLP setup guides for Braintrust, Langfuse, LangSmith, Sentry, and the OpenTelemetry Collector.

  • Adds an overview of Stagehand's trace format and provider options.
  • Includes TypeScript, Python, and Go examples with verification steps for each provider.
  • Documents the base OpenTelemetry Collector setup for routing or transcoding traces.
  • Adds provider navigation, logos, and a link from the observability configuration page.

I manually verified the endpoint and header requirements for each provider.

Follow-up: add a Stagehand page to each provider's documentation.

Test plan

  • Formatting check
  • Docs unit tests, 27 passed

@antonvishal
antonvishal requested a review from a team as a code owner September 11, 2026 06:09
@changeset-bot

changeset-bot Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5bcbd46

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions

Copy link
Copy Markdown
Contributor

This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run.
Approving the latest commit mirrors it into an internal PR owned by the approver.
If new commits are pushed later, the internal PR stays open but is marked stale until someone approves the latest external commit and refreshes it.

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. labels Sep 11, 2026
@Kylejeong2

Copy link
Copy Markdown
Member

@cubic review

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

@cubic review

@Kylejeong2 I have started the AI code review. It will take a few minutes to complete.

Comment thread packages/docs/v4/observability/braintrust.mdx Outdated
Comment thread packages/docs/v4/observability/langfuse.mdx Outdated
Comment thread packages/docs/v4/observability/overview.mdx Outdated
Comment thread packages/docs/v4/observability/otel-collector.mdx
Comment thread packages/docs/v4/observability/sentry.mdx Outdated
Comment thread packages/docs/v4/observability/langsmith.mdx Outdated
Comment thread packages/docs/docs.json Outdated

@Kylejeong2 Kylejeong2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some comments, address @cubic as well

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 12 files

Architecture diagram
sequenceDiagram
    participant Dev as Developer
    participant App as Stagehand App
    participant Browser as Local Browser
    participant OTel as OTLP Exporter
    participant Provider as Observability Provider
    participant Collector as OTel Collector

    Note over Dev,Provider: Stagehand v4 OpenTelemetry Integration Flow

    Dev->>App: launch() + create() with telemetry config
    App->>Browser: Start browser context
    App->>App: Emit operation spans (act/observe/extract)
    App->>App: Emit log spans for each log record
    Browser-->>App: Page interaction results

    App->>OTel: Batched OTLP/HTTP JSON export to /v1/traces
    
    alt Direct provider export
        OTel->>Provider: POST traces with provider-specific headers
        Note over OTel,Provider: Auth varies by provider
        alt Braintrust
            OTel->>Provider: Authorization: Bearer + x-bt-parent: project_id
        else Langfuse
            OTel->>Provider: Authorization: Basic + x-langfuse-ingestion-version: 4
        else LangSmith
            OTel->>Provider: x-api-key + Langsmith-Project header
        else Sentry
            OTel->>Provider: x-sentry-auth: sentry sentry_key
        end
        Provider-->>OTel: 200 OK / export error
    else Collector routing (NEW: OTLP Collector)
        OTel->>Collector: POST http://localhost:4318/v1/traces
        Collector->>Collector: Batch processor + fan-out
        Collector->>Provider: Export via otlp_http exporter
        Provider-->>Collector: Response
        Collector-->>OTel: 200 / error
    end

    Note over App,Provider: Verification
    Provider->>Provider: File trace under project (x-bt-parent, Langsmith-Project, etc.)
    Dev->>Provider: Check traces with service.name = stagehand-service-worker

    alt Missing traces
        Note over Dev,Provider: Check data plane/region, headers, and close() was called
    end

    App->>App: stagehand.close() flushes remaining batch
    App->>OTel: Final export before process exit
Loading

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread packages/docs/v4/observability/braintrust.mdx Outdated
Comment thread packages/docs/v4/observability/braintrust.mdx Outdated
Comment thread packages/docs/v4/observability/langsmith.mdx Outdated
Comment thread packages/docs/v4/observability/otel-collector.mdx Outdated
Comment thread packages/docs/v4/observability/overview.mdx
Comment thread packages/docs/v4/observability/otel-collector.mdx Outdated
Comment thread packages/docs/v4/observability/langfuse.mdx Outdated
@antonvishal

Copy link
Copy Markdown
Contributor Author

Hey @Kylejeong2, I addressed the comments.

@antonvishal
antonvishal requested a review from Kylejeong2 October 7, 2026 02:33
Keep the collector page in the sidebar so the overview grid stays even.

Co-authored-by: Cursor <cursoragent@cursor.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants