Logging
Useconv.log to record meaningful outcomes, not every step the code takes:
except with no log turns a broken integration into a mysteriously unhelpful agent, and there is nothing in the transcript to explain it.
Metrics
Metrics count things you want to aggregate across calls — how often a flow completes, how often a handoff fires, how often an API falls back. Metrics in a project are managed withpoly metrics, which are then invoked in project code via conv.write_metric(...). See custom metrics for managing the definitions.
The common mistake is emitting the same metric repeatedly. A metric written inside a loop, or on every turn, inflates the count and tells you nothing:
See the functions reference for the
conv.log and metrics APIs.
Inspecting real conversations
poly conversations reads what actually happened on real calls:
list pages through recent conversations, get returns the full turn-by-turn detail, and get-audio downloads the recording for a voice call.
To go from “what happened on this call” to “how are calls going”, the same data is readable in aggregate and by search:
poly metrics available lists what you can read, built-in metrics included; the custom metrics your functions write with conv.write_metric(...) appear there too, which closes the loop between instrumenting and reviewing.
This is where you find out what callers actually say, as opposed to what you imagined they would. Treat it as an input to development rather than an end in itself — a surprising real conversation is the raw material for the next test case.
Agent Studio’s Analytics pages chart the same metrics; the CLI gives you the numbers and the matching conversations where you are already working.
How this fits the workflow
Instrumentation is something you add while building, and it only pays off later. Logs and metrics you did not add are not available retroactively, so the time to think about them is while you are writing the function, not while you are debugging a call from last week.- Custom metrics — defining the metrics function code writes to
- Simulated conversation tests — turning a surprising real conversation into a repeatable test case
- Environments and deployment — which environment a conversation came from
- Every flag for these commands is in the CLI reference:
poly conversations,poly transcripts,poly metrics

