{"id":10,"date":"2021-05-21T07:18:00","date_gmt":"2021-05-21T07:18:00","guid":{"rendered":""},"modified":"2021-09-23T13:54:58","modified_gmt":"2021-09-23T13:54:58","slug":"application-insights-sampling","status":"publish","type":"post","link":"http:\/\/panahy.nl\/index.php\/2021\/05\/21\/application-insights-sampling\/","title":{"rendered":"Application Insights &#8211; Sampling"},"content":{"rendered":"<p>&nbsp;<\/p>\n<div style=\"background-color: white; box-sizing: border-box; color: #3c3b37; font-family: &quot;sf pro text&quot;, -apple-system, BlinkMacSystemFont, Roboto, &quot;segoe ui&quot;, Helvetica, Arial, sans-serif, &quot;apple color emoji&quot;, &quot;segoe ui emoji&quot;, &quot;segoe ui symbol&quot;; font-size: 16px; margin: 0px; padding: 24px;\">\n<div data-purpose=\"safely-set-inner-html:rich-text-viewer:html\" style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">\n<h4 style=\"box-sizing: border-box; color: inherit; font-size: 24px; font-weight: 400; line-height: 1.1; margin: 0px; max-width: 60rem; padding: 0px;\"><span style=\"font-size: 18px;\">In Application Insights, using sampling is an effective way to reduce the amount of telemetry data that is sent to Application Insights. If you are worried about high storage costs if all telemetry data gets sent to Application Insights, you can make use of sampling in Application Insights.<\/span><\/h4>\n<p style=\"box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;\">By default Application Insights sampling is already enabled when you use the ASP.NET, ASP.NET Core software development kits.<\/p>\n<p style=\"box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;\">For ASP.Net applications you can configure adaptive sampling by tuning parameters in the ApplicationInsights.config file. Some of the settings are<\/p>\n<p style=\"box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;\"><span style=\"box-sizing: border-box; font-weight: 700; margin: 0px; padding: 0px;\">&lt;MaxTelemetryItemsPerSecond&gt;5&lt;\/MaxTelemetryItemsPerSecond&gt;<\/span><\/p>\n<p style=\"box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;\">This will ensure to limit the number of items that are sent to Application Insights<\/p>\n<p style=\"box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;\"><span style=\"box-sizing: border-box; font-weight: 700; margin: 0px; padding: 0px;\">&lt;EvaluationInterval&gt;00:00:15&lt;\/EvaluationInterval&gt;<\/span><\/p>\n<p style=\"box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;\">This is the interval at which the current rate of telemetry is reevaluated<\/p>\n<p style=\"box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;\"><span style=\"box-sizing: border-box; font-weight: 700; margin: 0px; padding: 0px;\">&lt;InitialSamplingPercentage&gt;100&lt;\/InitialSamplingPercentage&gt;<\/span><\/p>\n<p style=\"box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;\">This is the amount of telemetry data that is sent when the application is started<\/p>\n<p style=\"box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;\">In ASP.Net Core applications, there is no ApplicationInsights.config file, so the configuration is done via code.<\/p>\n<p style=\"box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;\">Adaptive sampling is enabled by default for all ASP.NET Core applications<\/p>\n<p style=\"box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;\">For more information on adaptive sampling, you can use the below link<\/p>\n<p style=\"box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;\">https:\/\/docs.microsoft.com\/en-us\/azure\/azure-monitor\/app\/sampling<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; In Application Insights, using sampling is an effective way to reduce the amount of telemetry data that is sent to Application Insights. If you are worried about high storage costs if all telemetry data gets sent to Application Insights, you can make use of sampling in Application Insights. By default Application Insights sampling is &hellip; <a href=\"http:\/\/panahy.nl\/index.php\/2021\/05\/21\/application-insights-sampling\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Application Insights &#8211; Sampling&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8,4],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false},"uagb_author_info":{"display_name":"Pouya Panahy","author_link":"http:\/\/panahy.nl\/index.php\/author\/pouya\/"},"uagb_comment_info":0,"uagb_excerpt":"&nbsp; In Application Insights, using sampling is an effective way to reduce the amount of telemetry data that is sent to Application Insights. If you are worried about high storage costs if all telemetry data gets sent to Application Insights, you can make use of sampling in Application Insights. By default Application Insights sampling is&hellip;","_links":{"self":[{"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/posts\/10"}],"collection":[{"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/comments?post=10"}],"version-history":[{"count":1,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/posts\/10\/revisions"}],"predecessor-version":[{"id":138,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/posts\/10\/revisions\/138"}],"wp:attachment":[{"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/media?parent=10"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/categories?post=10"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/panahy.nl\/index.php\/wp-json\/wp\/v2\/tags?post=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}