Blog Post

Apps on Azure Blog
1 MIN READ

Application Insights Sampling in Azure Functions and missing invocations

VinodRawat's avatar
VinodRawat
Icon for Microsoft rankMicrosoft
Sep 30, 2022

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.

 

 

 

 

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%.

 

 

 

 

 

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

Published Sep 30, 2022
Version 1.0
No CommentsBe the first to comment