Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reduce Azure Application Insight cost

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

like image 888
Pankaj Rawat Avatar asked Sep 23 '19 06:09

Pankaj Rawat


2 Answers

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.

like image 148
Pankaj Rawat Avatar answered Nov 09 '22 17:11

Pankaj Rawat


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

like image 3
cijothomas Avatar answered Nov 09 '22 18:11

cijothomas