Go into Log Analytics workspace and in each run query
Usage
| where IsBillable == true
| summarize BillableDataGB = sum(Quantity) / 1024 by DataType
| sort by BillableDataGB desc
above query will tell you which type of log analytics is eating your budget the most for instance AppDependencies 25GB
1. Reduce Data Sampling
Got to your application insight that is associated with Log Analytics workspace then choose Configure -> Usage and estimated costs -> Data sampling and choose 8.3% as an example to drastically reduce the costs.
If you are using function app in .net you can add custom Telemtry Processor that can simply ignore successful dependencies
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.ApplicationInsights.DataContracts;
public class VlTechDependencyFilter : ITelemetryProcessor
{
private ITelemetryProcessor Next { get; set; }
// Next will point to the next TelemetryProcessor in the chain.
public VlTechDependencyFilter(ITelemetryProcessor next)
{
this.Next = next;
}
public void Process(ITelemetry item)
{
// 1. Identify if this is a Dependency log
if (item is DependencyTelemetry dependency)
{
// 2. If the call was successful, "Return" without calling Next (Drops the data)
if (dependency.Success == true)
{
return;
}
}
// 3. Send everything else (Errors, Spikes, Traces) to Azure
this.Next.Process(item);
}
}
in your Program.cs then you can register it

Comments
Post a Comment