Analytics is the same log, gathered into numbers and charts. The log answers “what happened to this particular request”; analytics answers “how much are we spending”, “when is the load at its peak” and “which model fails more often than the rest”. This is the place to look for bottlenecks and to talk to management in the language of numbers rather than impressions.
Ranges and granularity
The period is picked from a ready set or by hand: today, yesterday, 7, 14, 30, 90 or 365 days, all time, or arbitrary dates. Inside the period, the chart points can be grouped by hour, day, week or month. Weeks start on Sunday — worth remembering when you compare weekly totals against other systems’ reports.
Empty stretches on the charts are not filled in with zeros: if there were no requests on Wednesday, there is simply no point for Wednesday. That way the chart does not show a “dip” that never existed.
What analytics shows
- Request volume — how many in total, how many of them streaming, how many with errors.
- Latency — the average response time, the middle of the list (the median), and the “slow tail”: the 95th percentile, the time faster than 95 requests out of 100. That one shows how bad it gets in the worst cases — the average hides it.
- Breakdowns by models, keys and channels — who uses what more often, who is slower, who has more errors.
- Distributions by duration and volume — how many requests fit into 100 milliseconds, how many dragged past 10 seconds.
- Spending over time — “our” price and the vendor’s price side by side, so divergences are visible.
Next to the totals sits a comparison with the previous period of the same length: you see right away whether things went up or down, instead of holding last month’s numbers in your head.
Peak hours and error analysis
A separate chart shows at which hours of the day the most requests arrive. From it you can see when the load peaks and when it is safer to start heavy jobs — for example, mass document processing at night rather than the working midday.
Error analysis answers “how many”, “for which models and keys” and “which codes”. Beside it — a list of the latest errors with the message text, so you do not have to walk the log one row at a time.
One thing to understand: rejected calls count toward the request volume — the ones that failed the spending limit or the model list. That is as it should be: otherwise you would never see that someone runs into the limit every single day.
Spending
In analytics, spending shows in money and over time: where the more expensive model is, which key spends the most, how it changes from week to week. It helps to compare “our” price against the vendor’s price: a noticeable divergence usually means the model’s prices in the “Models” section are due for an update.
The Dashboard summary
The “Dashboard” page gathers tiles with the numbers you need most, over all time: how many models and keys, how many requests, the error share, the average duration, the token volume, the total spending and today’s proxy service traffic. That is usually enough for a quick “how are we doing” glance; for the details, go to analytics.
Sending statistics to ClickHouse
If you already run ClickHouse, the product can send it a copy of the statistics every day — handy when all the company’s reports are collected in one place. The capability is enabled with the PROXYAGENT_CLICKHOUSE_URL environment variable, read once at startup.
When ClickHouse is connected, analytics gets a “Backfill ClickHouse Stats” button: it compares your database against ClickHouse and re-sends the missed days. Without ClickHouse configured there is no button — and that is normal.
An honest caveat
All of analytics is computed from your log in your own database. So it has exactly the same completeness as the log: if a record was not saved, it will not be in the numbers either. Analytics has no external sources — for third-party reports you will have to rely on your own database. Hence the practical conclusion: keep the database in order and back it up.
Next: how to remove secrets from requests before they reach the model — in the Anonymization section.