Commit Graph
6 Commits
Author SHA1 Message Date
bendtherules 627b80008e feat(langfuse): add opt-in Langfuse observability integration
Add Langfuse as an OTel trace transport for MCP request lifecycle tracking.

Changes:
- New src/lib/langfuse-transport.ts: initializes LangfuseSpanProcessor when
  ASK262_LANGFUSE_ENABLED=true with valid credentials
- src/lib/tracing.ts: add metadata to TraceContext, propagate it to child spans,
  use startActiveSpan for proper OTel context, add setupTracing() entry point,
  add getSessionMetadata() for version/transport metadata
- src/lib/logger.ts: include TraceContext.metadata in JSON log mixin
- src/mcp-server-{http,stdio}.ts: call setupTracing() at startup, pass
  version/transport metadata through withSpan/withSpanContext
- src/lib/fireworks-embeddings.ts: wrap API calls in withSpan() with gen_ai
  attributes for Langfuse generation/cost tracking
- .env.example: add LANGFUSE_* configuration variables
- AGENTS.md: document Langfuse integration
- package.json: add @langfuse/tracing, @langfuse/otel, @opentelemetry/sdk-node
2026-04-27 18:31:19 +05:30
bendtherules 30cd83f6d4 fix(logger): make console logging opt-in via ASK262_LOG_CONSOLE
Console output is now disabled by default. Set ASK262_LOG_CONSOLE=true
to enable pretty-printed logs routed to stderr. This prevents:
- Stdio MCP protocol corruption from stdout noise
- Noisy test output during bun test runs

Also fixes misleading comments about HTTP/stdio log level defaults.
2026-04-27 16:59:16 +05:30
bendtherules 9578502bca Add basic logging 2026-04-22 12:47:17 +05:30
bendtherules e67103049a feat(env): add MCP_PUBLIC_URL entry to .env.example with documentation 2026-04-21 09:17:49 +05:30
bendtherules df5161ba86 feat: Add env support + small fixes 2026-04-16 13:18:39 +05:30
bendtherules 385f609e7b feat: Support Fireworks embedding for ingest and tool 2026-04-16 13:06:25 +05:30