Skip to content

test(server-utils): Cover the Flue instrumentation - #24266

Draft
RulaKhaled wants to merge 2 commits into
feat/flue-instrumentation-basefrom
feat/flue-instrumentation-tests
Draft

test(server-utils): Cover the Flue instrumentation#24266
RulaKhaled wants to merge 2 commits into
feat/flue-instrumentation-basefrom
feat/flue-instrumentation-tests

Conversation

@RulaKhaled

@RulaKhaled RulaKhaled commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #24265 — review that first; this is tests only.

Unit (15 cases): span shapes and ops, the conversation id lifted off the re-entered agent operation, usage/cost mapping, the all-zero-usage guard on failed turns, tool spans, content recording and its recordInputs/recordOutputs gating, and dispose.

Integration: drives an agent through a tool call and asserts the full invoke_agentchat / execute_tool hierarchy, including that tool spans are siblings of chat under the agent invocation.

Two notes for review. The scenario uses pi-ai's built-in faux provider rather than a mock HTTP server, so it needs no key and is deterministic. And it is ESM only — @flue/runtime has no require condition, so the cjs mode returns early; it is installed per-suite because engines.node >= 22.19 would break yarn install on the Node 20 lane, and is guarded by conditionalTest({ min: 22 }).

Both suites were mutation-tested, not just run green: reverting the zero-usage guard, the conversation-id lift, and the tool-span handling each produced a failure. One test passed vacuously on the first attempt and was fixed.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.91 kB added added
@sentry/browser - with treeshaking flags 27.21 kB added added
@sentry/browser - with treeshaking flags tracing without tracing 27.1 kB added added
@sentry/browser (incl. Tracing) 50.27 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 50.28 kB added added
@sentry/browser (incl. Tracing, Profiling) 53.26 kB added added
@sentry/browser (incl. Tracing, Replay) 89.76 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 78.86 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 94.45 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 107.46 kB added added
@sentry/browser (incl. Feedback) 46.4 kB added added
@sentry/browser (incl. sendFeedback) 33.96 kB added added
@sentry/browser (incl. FeedbackAsync) 39.07 kB added added
@sentry/browser (incl. Metrics) 29.93 kB added added
@sentry/browser (incl. Logs) 30.19 kB added added
@sentry/browser (incl. Metrics & Logs) 30.86 kB added added
@sentry/react 30.66 kB added added
@sentry/react (incl. Tracing) 52.59 kB added added
@sentry/vue 36.15 kB added added
@sentry/vue (incl. Tracing) 52.53 kB added added
@sentry/svelte 28.93 kB added added
CDN Bundle 30.64 kB added added
CDN Bundle (incl. Tracing) 50.78 kB added added
CDN Bundle (incl. Logs, Metrics) 32.92 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 52.73 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 73.61 kB added added
CDN Bundle (incl. Tracing, Replay) 88.32 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.29 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 94.36 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.38 kB added added
CDN Bundle - uncompressed 90.72 kB added added
CDN Bundle (incl. Tracing) - uncompressed 151.68 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.3 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 157.64 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.71 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 271.25 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 277.2 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 284.95 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 290.89 kB added added
@sentry/nextjs (client) 54.91 kB added added
@sentry/sveltekit (client) 50.69 kB added added
@sentry/core/server 37.1 kB added added
@sentry/core/browser 13.66 kB added added
@sentry/node 129.74 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.86 kB added added
@sentry/node - without tracing 89.07 kB added added
@sentry/node - without channel injection 108.85 kB added added
@sentry/aws-serverless 97.47 kB added added
@sentry/cloudflare (withSentry) - minified 202.48 kB added added
@sentry/cloudflare (withSentry) 504.19 kB added added

@RulaKhaled
RulaKhaled force-pushed the feat/flue-instrumentation-tests branch from 89239da to deb3330 Compare September 9, 2026 19:00
@RulaKhaled
RulaKhaled force-pushed the feat/flue-instrumentation-tests branch from deb3330 to bdda8e5 Compare September 9, 2026 19:08
@RulaKhaled
RulaKhaled force-pushed the feat/flue-instrumentation-base branch from 9fb3fcd to d62f4f2 Compare September 10, 2026 07:41
RulaKhaled and others added 2 commits September 10, 2026 09:41
Unit tests over `createFlueInstrumentation` for the span shapes, the conversation
id lifted off the re-entered agent operation, the usage/cost mapping, the
all-zero-usage guard on failed turns, tool spans, and dispose.

The integration test drives a real agent through a tool call using `pi-ai`'s
`faux` provider, so the run is deterministic and needs no provider key or mock
server. ESM only: `@flue/runtime` has no `require` export condition, and it is
installed per-suite because its `engines.node >= 22.19` would break `yarn
install` on the Node 20 CI matrix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@RulaKhaled
RulaKhaled force-pushed the feat/flue-instrumentation-tests branch from bdda8e5 to 612798a Compare September 10, 2026 07:41
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