feat(api): add inference.net Catalyst tracing for LLM observability#2939
Open
Marfuen wants to merge 2 commits into
Open
feat(api): add inference.net Catalyst tracing for LLM observability#2939Marfuen wants to merge 2 commits into
Marfuen wants to merge 2 commits into
Conversation
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>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@inference/tracinginto the NestJS API to send OpenTelemetry spans to Inference.net's Catalyst dashboardstreamText) with a labeledfunctionIdfor dashboard groupingmodules: { aiSdk: ai }registrationCATALYST_OTLP_TOKENis unset — zero impact on existing behaviorNew 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 shutdownapps/api/src/assistant-chat/assistant-chat.controller.ts— per-callexperimental_telemetrywithfunctionId: 'grc-assistant'apps/api/.env.example—CATALYST_OTLP_TOKEN+CATALYST_OTLP_ENDPOINTRelated: companion PR in comp-private for enterprise API tracing.
Test plan
CATALYST_OTLP_TOKENandCATALYST_OTLP_ENDPOINTin.env🤖 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 otheraiSDK calls are auto-instrumented; disabled unlessCATALYST_OTLP_TOKENis set.New Features
apps/api/src/inference-tracing.ts(init, shutdown,getAITelemetry).NestFactoryand flush on shutdown.experimental_telemetry: getAITelemetry('grc-assistant')..env.examplewithCATALYST_OTLP_TOKENandCATALYST_OTLP_ENDPOINT(optional).Dependencies
@inference/tracing@^0.0.21.Written for commit 5449f91. Summary will update on new commits. Review in cubic