Skip to content

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.

Update src/app.ts to install content-free tracing before creating the route map. The complete file below keeps the existing chat UI, ping endpoint, and agent route. Changes shows the comparison with completed checkpoint 6:

  • src
    • app.ts

Replace the entire contents of this file. In your code editor (for example, VS Code), open the file named above. Copy the code in Complete file, paste it into that file's editing pane, and save.

src/app.ts
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.

Terminal window
npm run typecheck
npm run deploy
sleep 5
npm 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.

Verification gate

Prove it works

  • invoke_agent, chat, and execute_tool spans 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.