Add AI agent monitoring and structured logs to Sentry example #181
astrobot-houston
started this conversation in
Feature Request
Replies: 1 comment
-
|
👋 hi, Serge here, DevEx engineer at Sentry. I was using Flue to setup an issue triage bot on our docs and stumbled upon some examples and wanted to extend the Sentry one to better reflect the full feature scope of the product (that is included in all plans, none of the additions were "extra features"
Let me know if there are any questions! Loving Flue so far |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
examples/sentry/example from error-only reporting to full Sentry observability using AI Agent Monitoring conventionsgen_ai.invoke_agent→gen_ai.chat→gen_ai.execute_toolspan hierarchy with proper parent-child nesting, real wall-clock durations, aggregated token usage, cost attributes, and conversation ID trackingctx.log.*calls toSentry.loggerwithflue.run_id/flue.agentcorrelation attributesstreamGenAiSpans: trueso gen_ai spans are sent as standalone envelopesSENTRY_AI_RECORD_INPUTS/SENTRY_AI_RECORD_OUTPUTSenv vars for privacy-controlled prompt/response capturechat.tsagent that makes a real LLM call to exercise the full pipeline@sentry/nodeto^10.53.0forstreamGenAiSpans,enableLogs, andsetConversationIdsupportVerified in Sentry
Tested against the
flue-sentry-exampleproject insentry-developer-experienceorg. Confirmed:invoke_agentspans withgen_ai.agent.name,gen_ai.request.model,gen_ai.usage.*,gen_ai.conversation.idchatchild spans with per-turn model, token usage, cost, and real duration (~1s, not 0ms)boomandexplicitagentsTest plan
npx tsc --noEmitpasses (strict mode)pnpm exec flue dev --target nodebuilds and serves all 4 agentscurl /agents/chat/test1returns LLM response with usagecurl /agents/hello/test1returns success (agent span + logs, no errors)curl /agents/boom/test1returns error (captureException + error span)curl /agents/explicit/test1returns 200 with error logs captured🤖 Generated with Claude Code
Original implementation from #180 by @sergical
Beta Was this translation helpful? Give feedback.
All reactions