P
Peekr Cloud
DemoAcme Agents

← Traces

workflow.execute

trace_id: trace_00003e · tenant: acme

5 spans·6562mserror

Root cause: sequential execution of "messages.create"

3 "anthropic.messages.create" spans ran one after another — each started only after the previous one finished. Total: 5.9s, slowest single call: 2.4s. Running them concurrently saves 3.5s — a 2.5× speedup.

Now (sequential)After fix (parallel)

5.9s

~2.4s

Fix: run calls in parallel

fix.py
from concurrent.futures import ThreadPoolExecutor

# Before — sequential, each call blocks the next:
for item in items:
    result = process(item)

# After — all calls run concurrently:
with ThreadPoolExecutor(max_workers=8) as pool:
    results = list(pool.map(process, items))

# Cost unchanged. Output unchanged. Time = slowest single call.

Waterfall

workflow › executeerror

workflow.execute

user: u_274
anthropic › messages › create

anthropic.messages.create

claude-sonnet-4-62.2k tok$0.017faithful 0.58user: u_274
Input

Summarize the Q3 earnings report attached. Focus on revenue, margin, and guidance.

Output

(answer to: Summarize the Q3 earnings report attache…)

anthropic › messages › create

anthropic.messages.create

claude-sonnet-4-61.9k tok$0.015faithful 0.59user: u_274
Input

Given the customer ticket below, draft a refund response that follows policy P-204.

Output

(answer to: Given the customer ticket below, draft a…)

anthropic › messages › create

anthropic.messages.create

claude-sonnet-4-62.2k tok$0.017faithful 0.40user: u_274
Input

Translate the user manual section to Japanese, preserving the table structure.

Output

ユーザーマニュアルの全章を翻訳しました。表は問題なく保持されています…

Tool: searcherror

tool.search

user: u_274