Skip to content

feat(observability): add LangWatch exporter for AI tracing#1

Open
sergioestebance wants to merge 2 commits intomainfrom
feat/add-langwatch-exporter
Open

feat(observability): add LangWatch exporter for AI tracing#1
sergioestebance wants to merge 2 commits intomainfrom
feat/add-langwatch-exporter

Conversation

@sergioestebance
Copy link
Owner

Summary

  • Adds @mastra/langwatch package — a first-class LangWatch exporter for Mastra observability
  • Replaces the manual OtelExporter configuration with a dedicated zero-config exporter
  • Extends OtelExporter (same pattern as @mastra/arize) with pre-configured OTLP endpoint and Bearer token auth

Changes

New package: observability/langwatch/

  • LangwatchExporter class extending OtelExporter (~60 lines)
  • Pre-configured endpoint: https://app.langwatch.ai/api/otel/v1/traces
  • Protocol: OTLP/HTTP (protobuf)
  • Auth: Bearer token via Authorization header
  • Zero-config via LANGWATCH_API_KEY env var
  • Custom endpoint via LANGWATCH_ENDPOINT for self-hosted instances
  • 5 unit tests covering all configuration paths

Documentation

  • Docs page: docs/observability/tracing/exporters/langwatch.mdx
  • Reference page: reference/observability/tracing/exporters/langwatch.mdx
  • Added to docs and reference sidebars
  • Added to tracing overview external exporters list
  • Migration guide from manual OtelExporter setup

Changeset

  • @mastra/langwatch: major (initial release)

Usage

import { LangwatchExporter } from "@mastra/langwatch";

// Zero-config (reads LANGWATCH_API_KEY env var)
new LangwatchExporter()

// Explicit config
new LangwatchExporter({ apiKey: "lw_xxx" })

// Self-hosted
new LangwatchExporter({ endpoint: "https://your-instance.example.com/api/otel/v1/traces" })

Test plan

  • pnpm test passes in observability/langwatch/ (5/5 tests)
  • pnpm build --filter=@mastra/langwatch succeeds
  • Docs build without errors
  • Manual test: configure with real LANGWATCH_API_KEY and verify traces appear in LangWatch dashboard

🤖 Generated with Claude Code

sergioestebance and others added 2 commits February 6, 2026 13:47
Add @mastra/langwatch package — a first-class LangWatch exporter that
extends OtelExporter with pre-configured OTLP endpoint and Bearer token
authentication. Follows the same pattern as @mastra/arize.

Features:
- Zero-config setup via LANGWATCH_API_KEY environment variable
- Custom endpoint support via LANGWATCH_ENDPOINT for self-hosted instances
- Automatic disable with warning when API key is missing
- 5 unit tests covering all configuration paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add docs page: docs/observability/tracing/exporters/langwatch.mdx
- Add reference page: reference/observability/tracing/exporters/langwatch.mdx
- Add LangWatch to docs and reference sidebars (alphabetical order)
- Add LangWatch to tracing overview external exporters list
- Add changeset for initial @mastra/langwatch major release

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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