An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Hello @Das, D. (Debjyoti) - The thread's already pointing at per-request logging, which is the right destination. What's worth spelling out is why the metric policy can't be stretched to cover context size - otherwise it reads as a preference rather than a constraint.
Two hard limits in the llm-emit-token-metric reference. You get at most 5 custom dimensions per policy. And the active time series a policy produces is the product of the unique values across those dimensions, measured against an Azure Monitor ceiling of 50,000 active time series per region per subscription in any 12-hour window.
Prompt-token counts have effectively unbounded cardinality - every distinct value creates its own series. Multiply that against your existing client and model dimensions and you'd cross the limit almost immediately.
So per-request logging isn't just the cleaner option here - it's the only one that works.
One thing worth checking on your current setup. The same reference notes token counts are inaccurate if a stream is interrupted, and that some OpenAI models don't return them at all when streaming unless you set include_usage: true in the request. If any of your traffic streams, the numbers you're billing from today may already be incomplete.