Preview of Distributed Tracing V2 for Durable Functions
Published Jan 30 2024 10:33 AM 4,119 Views
Microsoft

We released Distributed Tracing V2 for Durable Functions to help improve observability! 

 

Durable Functions enables you to write long-running, reliable, event-driven, and stateful logic on the Azure Functions platform using everyday imperative code. 

 

Distributed Tracing allows you to correlate operations together and track requests between services. This is especially useful for Durable Functions apps as they coordinate work across multiple services and VMs. 

 

 

Distributed Tracing V2 Improvements 

 

The first implementation of Distributed Tracing supported only the .NET in-process model and the Azure Storage backend. The V1 implementation is still in an experimental state. Distributed Tracing V2, on the other hand, is not an experimental feature and supports all Durable Functions language SDKs, including .NET Isolated, and all Durable Functions backends: Azure Storage, MSSQL, and Netherite. It also provides more information about the spans. 

 

vabachu_0-1706122727863.png

 

 

This image above shows a trace where site content is backed up. The orchestration first calls an activity to get the files to backup and then all of those files are copied.  

 

 

Limitations 

 

Currently, Distributed Tracing V2 does not give traces for Durable Entities operations. 

 

 

Try it out! 

 

Step 1: Check the Durable Functions version 

You'll need Durable Functions Extension 2.12.0 or above. For .NET Isolated, please ensure that you are using Microsoft.Azure.Functions.Worker.Extensions.DurableTask version 1.0.4 or above. For non-.NET languages, please use extension bundles v4.

 

Step 2: Set up host.json 

To set up Distributed Tracing V2, add the following settings to the application’s host.json: 

 

"durableTask": { 
    "tracing": { 
      "DistributedTracingEnabled": true, 
      "Version": "V2" 
    } 
  } 

 

If you are using Distributed Tracing V1, you will have to update your host.json to explicitly use V2. 

 

Step 3: Create an Application Insights resource 

If there’s no existing Application Insights resource configured with your Function app, then you will also need to create an Application Insights resource and configure it to connect to the Function app. 

 

Other than the aforementioned configuration changes, no other code changes are required. 

 

A getting started sample can be found here. 

 

For more information, refer to Diagnostics in Durable Functions - Azure | Microsoft Learn.

 

 

Compatibility with Durable Task Framework 

 

Distributed Tracing is also compatible with apps using the Durable Task Framework, the underlying C# OSS framework that powers Durable Functions. 

 

You'll need DurableTask.Core version >=2.16.0. More information can be found here. 

 

Give us feedback! 

 

Try it out and let us know how you like it! If you have any feedback regarding Distributed Tracing v2 for Durable Functions, please open an issue in the durable extension repo; for feedback regarding Durable Task Framework, use the durabletask repo.  

Co-Authors
Version history
Last update:
‎Feb 09 2024 01:53 PM
Updated by: