[Azure Functions / Application Insights] Logs from Azure Function run are incomplete.

Min Thet Khine 31 Reputation points
2022-01-10T17:14:11.677+00:00

Is there a limit to the size of logs in Azure Functions / Application Insights? We have a Function that logs quite a considerable number of logs. The list of logs that shows up after each run is never complete and is always missing a huge chunk of logs. Sometimes, the logs stop halfway even though the Function completed its run. Other times, logs from the beginning of the program and from the end of the program show up but the ones in the middle do not show up. This does not happen in local Function runs at all though.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
0 comments No comments
{count} vote

Accepted answer
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-01-12T07:17:42.813+00:00

    @Min Thet Khine ,

    Thanks for reaching out to Q&A.

    In order to resolve this issue, you can either disable sampling in Application insights or exclude request and exception in the sampling section under the Host.json file as mentioned below

    {
    "logging": {
    "applicationInsights": {
    "samplingSettings": {
    "isEnabled": true,
    "maxTelemetryItemsPerSecond" : 20,
    "excludedTypes": "Request;Exception"
    }
    }
    }
    }

    data of type Request and Exception is excluded from sampling. This makes sure that all function executions (requests) and exceptions are logged while other types of telemetry remain subject to sampling.

    https://learn.microsoft.com/en-us/azure/azure-functions/configure-monitoring?tabs=v2#configure-sampling

    I hope this helps!

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.