4
votes

Is there any way/trick/workaround to reduce Azure Application Insight cost? I have a very large volume of data (around 20M) ingestion every day. Data sampling set 5%, Even after Daily 5GB of data ingestion in Application Insights.

Application Insights has 90 days default retention period, but I don't need data even after 7 days.

Note: I'm only sending Info logs in application Insights with minimal information.

enter image description here

2
You can create multiple application insights instances, then split your telemetry among these instances.Ivan Yang
This is only for one Azure Function which is listening to Single EventhubPankaj Rawat

2 Answers

2
votes

You can do more aggressive sampling. Also review what "info logs" are being sent. Perhaps you can live without sending many of them. Also review all the auto-collected telemetry -if there is something you dont care about - (eg: perf counters), remove them. Also check this Msdn blog authored by application insights team members: https://msdn.microsoft.com/magazine/mt808502.aspx

2
votes

Few points I want to add here which help me.

  1. Review logging and log data in correct category. (Verbose, Info, Error etc). Most of the time (verbose only for debugging) am using Info and Error log only.

  2. Combined multiple lines of logs in a single line. It will reduce system-generated columns data.

Old

log.Info($"SerialNumber :" serialNumber)
log.Info($"id :" id)
log.Info($"name :" name)

New

log.Info($"SerialNumber, id, name :" serialNumber + id + name);
  1. Check traces collection customDimensions. For me, a lot of system-generated data was there like thread name, logger name and class name. I did some changes in my logger, now my customDimensions column is empty.

  2. Reduce some system-generated logs

    { "logger": { "categoryFilter": { "defaultLevel": "Information", "categoryLevels": { "Host": "Error", "Function": "Error", "Host.Aggregator": "Information" } } } }

All the above points help me to reduce log data, hope it will help others.