> ## Documentation Index
> Fetch the complete documentation index at: https://statsig-4b2ff144-serverless-cloudflare.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Capturing Metrics

Azure AI SDK automatically captures relevant invocation and usage metrics from each API call and logs them to Statsig.  You can see these events streaming in real-time in the console at: [https://console.statsig.com/metrics/events](https://console.statsig.com/metrics/events).

<Frame>
  <img src="https://github.com/user-attachments/assets/cb4136eb-6ae9-4ffa-b560-333f332eaa75" alt="Statsig console events streaming interface" />
</Frame>

### Metrics captured

Completion invocations capture the following metrics automatically: completion token length, prompt token length, latency, model name, total token length.

For example, a completion API call results in a usage log that looks like this:

<Frame>
  <img src="https://github.com/user-attachments/assets/d9c150cc-eded-4607-aec8-d1631af77cec" alt="Azure AI completion API usage log example" />
</Frame>

These could be used to compare multiple deployments with each other, and also to run experiments against different sets of parameters, aiding in optimization of cost, responsiveness, user experience, etc.
