Search code examples
c#azureazure-application-insights

Can I see how much data we are sending to application insights?


We just added application insights to our website and has currently limited it to 100mb of data per day to ensure no cost is added.

Now two days in a row we have gotten a message about our daily quota beeing exceeded, and I am trying to figure out at what time the quota was exceeded in order to get a picture of how much data we are actually sending.

I know I can adjust the limit, and that we will probably have to, but in order to argue for this with management I need more information abouts numbers.

Ideally a graph showing time on one axis and accumulated data on the other axis, or just any information would be perfect. But at this point any information is good information.

Hoping for some tips and tricks, and thank you in advance.


Solution

  • I think you can use Azure Monitor Logs (Kusto Query Language, KQL) to create a query that provides insights into your telemetry data. Here's an example query that can identified the time when the quota was exceeded:

    // Assuming you're interested in requests telemetry
    requests
    | where timestamp >= datetime("2023-01-01T00:00:00Z") // Replace with the start date
    | where timestamp < datetime("2023-01-03T00:00:00Z")  // Replace with the end date
    | summarize totalVolume = sum(itemCount) by bin(timestamp, 1h)
    | project timestamp, totalVolume

    This query adds the number of telemetry itemson an hourly basis. you can change it according to your need.

    If you are wondering on where to run this query,

    opm the Azure Portal. Open the Application Insights resource. Navigate to the "Logs" section. Copy and paste the query into the query editor.