Application Insights Sampling in Azure Functions and missing invocations

This post has been republished via RSS; it originally appeared at: Microsoft Tech Community - Latest Blogs - .

For Azure Functions -

 

  1. Adaptive sampling is enabled by default.
  2. Fixed-rate sampling is not supported.
  3. Ingestion sampling only applies when no other sampling is in effect. Therefore, this is also disabled by default in the wake of point #1 above.

 

 

If you expect data (invocations) under Monitor but do not find it as shown in screenshot below, you have either changed Host.Results category to Warning (or above) level; or your application telemetry is getting sampled. To fix the former, open Host.json file and change the Host.Results category to Information level.

 

{

  "logging": {

    "fileLoggingMode": "always",

    "logLevel": {

      "default": "Information",

      "Host.Results": "Information",

      "Function": "Error",

      "Host.Aggregator": "Trace"

    }

  }

}

 

 

If Host.Results category is already set at Information level, disable telemetry sampling as the next step.

 

VinodRawat_0-1664519039914.png

 

 

 

To disable the sampling, set "isEnabled": false in host.json file as shown below -

 

{

  "logging": {

    "applicationInsights": {

      "samplingSettings": {

        "isEnabled": false

       }

    }

  }

}

 

After disabling sampling, you can confirm it by running a query similar to the following; RetainedPercentage should show 100%.

 

VinodRawat_1-1664519039923.png

 

 

 

 

At this point, the function invocations should start appearing under Monitor on Azure Portal UI.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.