How to get per function runtime metrics in a functions app

Lucas 25 Reputation points
2025-07-04T09:12:39.56+00:00

My team is developing a functions app which consists of three functions of varying types.
Broadly speaking, the setup looks like this: A starter function of type httpTrigger starts a durable function when the user submits a request. The durable function will then trigger the creation of multiple worker functions of the activityTrigger type. So a single request leads to the creation of multiple different functions.
I would like to be able to analyse the performance of the system by looking at the duration, startup time etc of each individual function which is involved in the processing of a single request.
The functions app uses the flex consumption plan and linux as the OS. The function code is written in python is executed on the V1 runtime.

Any hints on how to go about this are greatly appreciated! I tried to get some insights by crafting some KQL queries but so far with no success.

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

Accepted answer
  1. Amira Bedhiafi 34,651 Reputation points Volunteer Moderator
    2025-07-05T13:58:56.7066667+00:00

    Hello Lucas !

    Thank you for posting on Microsoft Learn.

    Azure Durable Functions emit telemetry automatically to Application Insights, including orchestration and activity details.

    So you may need to verify that Application Insights is connected to your Function App because it is the core of tracking duration, startup time, and tracing across the durable orchestration and activity functions.

    You can also run KQL in the logs of your app resource :

    for durable orchestration traces :

    traces
    | where customDimensions.Category == "Host.Triggers.DurableTask"
    | project timestamp, message, operation_Id, customDimensions.FunctionName, customDimensions.EventType
    

    for function invocation durations:

    requests
    | where cloud_RoleName == "your-function-app-name"
    | summarize avg(duration), min(duration), max(duration), count() by name
    

    for detailed per-request duration:

    requests
    | where cloud_RoleName == "your-function-app-name"
    | project timestamp, name, duration, success, operation_Id, customDimensions
    

    You can use operation_Id or customDimensions.instanceId to correlate orchestration with its triggered activity functions.

    requests
    | where name startswith "DurableFunctionsOrchestrator"
    | join kind=inner (
        requests
        | where name startswith "DurableFunctionsActivity"
    ) on $left.operation_Id == $right.operation_Id
    | project OrchestrationName = $left.name, ActivityName = $right.name, $left.timestamp, $right.timestamp, ActivityDuration = $right.duration
    
    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.