Skip to content

feat(api): add inference.net Catalyst tracing for LLM observability#2939

Open
Marfuen wants to merge 2 commits into
mainfrom
mariano/inference-tracing-integration
Open

feat(api): add inference.net Catalyst tracing for LLM observability#2939
Marfuen wants to merge 2 commits into
mainfrom
mariano/inference-tracing-integration

Conversation

@Marfuen
Copy link
Copy Markdown
Contributor

@Marfuen Marfuen commented May 27, 2026

Summary

  • Integrates @inference/tracing into the NestJS API to send OpenTelemetry spans to Inference.net's Catalyst dashboard
  • Instruments the GRC assistant chat agent (streamText) with a labeled functionId for dashboard grouping
  • Auto-instruments all other AI SDK calls (remediation service, questionnaire, vendor risk, etc.) via global modules: { aiSdk: ai } registration
  • Tracing is a complete no-op when CATALYST_OTLP_TOKEN is unset — zero impact on existing behavior

New files:

  • apps/api/src/inference-tracing.ts — singleton tracing module (init, shutdown, per-call telemetry helper)

Modified:

  • apps/api/src/main.ts — init tracing before NestFactory, flush on shutdown
  • apps/api/src/assistant-chat/assistant-chat.controller.ts — per-call experimental_telemetry with functionId: 'grc-assistant'
  • apps/api/.env.exampleCATALYST_OTLP_TOKEN + CATALYST_OTLP_ENDPOINT

Related: companion PR in comp-private for enterprise API tracing.

Test plan

  • Set CATALYST_OTLP_TOKEN and CATALYST_OTLP_ENDPOINT in .env
  • Start the API dev server, confirm "Catalyst tracing enabled" log on startup
  • Use the Comp AI chat in the dashboard, verify traces appear in the Catalyst dashboard
  • Start the API without the env vars, confirm no tracing log and no errors

🤖 Generated with Claude Code


Summary by cubic

Add Catalyst tracing to the API for LLM observability by integrating @inference/tracing. The GRC assistant is instrumented and all other ai SDK calls are auto-instrumented; disabled unless CATALYST_OTLP_TOKEN is set.

  • New Features

    • Added apps/api/src/inference-tracing.ts (init, shutdown, getAITelemetry).
    • Initialize tracing before NestFactory and flush on shutdown.
    • Instrumented assistant chat with experimental_telemetry: getAITelemetry('grc-assistant').
    • Updated .env.example with CATALYST_OTLP_TOKEN and CATALYST_OTLP_ENDPOINT (optional).
  • Dependencies

    • Added @inference/tracing@^0.0.21.

Written for commit 5449f91. Summary will update on new commits. Review in cubic

Integrate @inference/tracing to send OpenTelemetry spans to Inference.net's
Catalyst dashboard for AI call observability (model usage, token counts, tool
calls, latency). Instruments the GRC assistant chat agent with a labeled
function ID, and auto-instruments all other AI SDK calls in the API process.

Tracing is a no-op when CATALYST_OTLP_TOKEN is unset — zero impact on
existing behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment May 27, 2026 9:29pm
comp-framework-editor Ready Ready Preview, Comment May 27, 2026 9:29pm
portal Ready Ready Preview, Comment May 27, 2026 9:29pm

Request Review

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

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