Jump to content

Application Insights Sampling in Azure Functions and missing invocations

Featured Replies

Posted

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.

 

 

 

mediumvv2px400.png.b8c8bf6194fb392f098735f70ca1deb8.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%.

 

 

 

mediumvv2px400.png.598ad84037cc3254c27ba1dd07129149.png

 

 

 

 

 

 

 

 

 

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

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...