https://www.notion.so/coderhq/AI-Bridge-Observability-2aad579be59280369a8bc0bb62139b62?source=copy_link describes the need for, and possible structure of, structured logging in aibridge.
We can JSON-encode the interception records and log them, so that operators can ship that data off somewhere for analysis. We need to decide whether we're going to log one big blob containing all sub-records (token, prompt, tool) for each interception, or log each one as they're recorded to be correlated by interception ID.
The latter is probably the simplest and most reliable. If we want to log the big blob then we'll need to store the records in memory and dump them once the interception completes, which may lose logs if the process is stopped prematurely.
https://www.notion.so/coderhq/AI-Bridge-Observability-2aad579be59280369a8bc0bb62139b62?source=copy_link describes the need for, and possible structure of, structured logging in aibridge.
We can JSON-encode the interception records and log them, so that operators can ship that data off somewhere for analysis. We need to decide whether we're going to log one big blob containing all sub-records (token, prompt, tool) for each interception, or log each one as they're recorded to be correlated by interception ID.
The latter is probably the simplest and most reliable. If we want to log the big blob then we'll need to store the records in memory and dump them once the interception completes, which may lose logs if the process is stopped prematurely.