Content-free traces
Bonus: content-free traces
Section titled “Bonus: content-free traces”Time: 5–8 minutes
Flue’s Cloudflare tracing includes prompts, responses, instructions, tool arguments, and results by default. Keep the execution shape while turning that content capture off.
1. Install an explicit tracing policy
Section titled “1. Install an explicit tracing policy”Update src/app.ts to install content-free tracing before creating the route map.
The diff starts from completed checkpoint 6; Complete file includes the
existing chat UI, ping endpoint, and agent route:
src/app.ts+4−0Changes from Checkpoint 6 (guide) → Content-free traces bonus
===================================================================--- a/src/app.ts Checkpoint 6 (guide)+++ b/src/app.ts Content-free traces bonus@@ -1,8 +1,12 @@ import { Hono } from 'hono'; import { createAgentRouter } from '@flue/runtime/routing';+import { instrument } from '@flue/runtime';+import { createCloudflareTracing } from '@flue/runtime/cloudflare'; import { FieldTrip } from './agents/field-trip.ts'; import chatUi from './ui/index.html?raw';
+instrument(createCloudflareTracing({ content: false }));+ // src/app.ts is the Flue route map. Its default export owns every HTTP request // the Worker receives. Agents get mounted here with createAgentRouter(...) // starting in checkpoint 1.import { Hono } from 'hono';import { createAgentRouter } from '@flue/runtime/routing';import { instrument } from '@flue/runtime';import { createCloudflareTracing } from '@flue/runtime/cloudflare';import { FieldTrip } from './agents/field-trip.ts';import chatUi from './ui/index.html?raw';
instrument(createCloudflareTracing({ content: false }));
// src/app.ts is the Flue route map. Its default export owns every HTTP request// the Worker receives. Agents get mounted here with createAgentRouter(...)// starting in checkpoint 1.const app = new Hono();
// A small chat UI for trying the agent in a browser, locally and on workers.dev.app.get('/', (c) => c.html(chatUi));app.get('/api/ping', (c) => c.text('pong'));app.route('/agents/field-trip', createAgentRouter(FieldTrip));
export default app;This explicit instrumentation replaces Flue’s built-in tracing install. The
existing wrangler.jsonc already enables Workers Traces.
2. Deploy and inspect
Section titled “2. Deploy and inspect”npm run typechecknpm run deploysleep 5npm run smoke -- https://field-trip-agent.<subdomain>.workers.dev private-trace \ "Plan a Lisbon offsite from <START> to <END> for 8 people. What's the weather?"Use the exact deployed URL and the workshop dates. After ingestion, open the newest trace in Workers & Pages → field-trip-agent → Observability → Traces.
Save your workers.dev subdomain to open this test ↗https://field-trip-agent.<subdomain>.workers.dev/?id=private-trace
This opens the same conversation as the smoke test. If you repeat this checkpoint, before copying its commands.
Restart npm run dev in Terminal A, then run in Terminal B:
npm run typechecknpm run smoke -- http://localhost:5173 private-trace-local \ "Plan a Lisbon offsite from <START> to <END> for 8 people. What's the weather?"Open local chat in your browser ↗http://localhost:5173/?id=private-trace-local
This opens the same conversation as the smoke test. If you repeat this checkpoint, before copying its commands.
This tests the agent with the new instrumentation. To verify content-free Workers Traces in the dashboard, use the Live deploy tab.
Verification gate
Prove it works
invoke_agent,chat, andexecute_toolspans remain.- Timing, status, model identity, and token usage remain.
- Messages, system instructions, tool arguments, and tool results are absent.
Remove both imports and instrument(...), then redeploy. Existing traces retain
the policy used when they were recorded; only new traces change.
Reference: Flue Cloudflare tracing.