Skip to content

Commit 874b7e1

Browse files
authored
Update durable-functions-diagnostics.md
1 parent 68113ea commit 874b7e1

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

articles/azure-functions/durable/durable-functions-diagnostics.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ There are several options for diagnosing issues with [Durable Functions](durable
1515

1616
## Application Insights
1717

18-
[Application Insights](/azure/azure-monitor/app/app-insights-overview) is the recommended way to do diagnostics and monitoring in Azure Functions. The same applies to Durable Functions. For an overview of how to leverage Application Insights in your function app, see [Monitor Azure Functions](../functions-monitoring.md).
18+
[Application Insights](/azure/azure-monitor/app/app-insights-overview) is the recommended way to do diagnostics and monitoring in Azure Functions. The same applies to Durable Functions. For an overview of how to use Application Insights in your function app, see [Monitor Azure Functions](../functions-monitoring.md).
1919

2020
The Azure Functions Durable Extension also emits *tracking events* that allow you to trace the end-to-end execution of an orchestration. These tracking events can be found and queried using the [Application Insights Analytics](/azure/azure-monitor/logs/log-query-overview) tool in the Azure portal.
2121

@@ -31,15 +31,15 @@ Each lifecycle event of an orchestration instance causes a tracking event to be
3131
* **instanceId**: The unique ID of the orchestration instance.
3232
* **state**: The lifecycle execution state of the instance. Valid values include:
3333
* **Scheduled**: The function was scheduled for execution but hasn't started running yet.
34-
* **Started**: The function has started running but has not yet awaited or completed.
34+
* **Started**: The function started running but has not yet awaited or completed.
3535
* **Awaited**: The orchestrator has scheduled some work and is waiting for it to complete.
3636
* **Listening**: The orchestrator is listening for an external event notification.
37-
* **Completed**: The function has completed successfully.
37+
* **Completed**: The function completed successfully.
3838
* **Failed**: The function failed with an error.
39-
* **reason**: Additional data associated with the tracking event. For example, if an instance is waiting for an external event notification, this field indicates the name of the event it is waiting for. If a function has failed, this field contains the error details.
39+
* **reason**: Additional data associated with the tracking event. For example, if an instance is waiting for an external event notification, this field indicates the name of the event it is waiting for. If a function fails, this field contains the error details.
4040
* **isReplay**: Boolean value indicating whether the tracking event is for replayed execution.
4141
* **extensionVersion**: The version of the Durable Task extension. The version information is especially important data when reporting possible bugs in the extension. Long-running instances may report multiple versions if an update occurs while it is running.
42-
* **sequenceNumber**: Execution sequence number for an event. Combined with the timestamp helps to order the events by execution time. *Note that this number will be reset to zero if the host restarts while the instance is running, so it's important to always sort by timestamp first, then sequenceNumber.*
42+
* **sequenceNumber**: Execution sequence number for an event. Combined with the timestamp helps to order the events by execution time. *Note that this number resets to zero if the host restarts while the instance is running, so it's important to always sort by timestamp first, then sequenceNumber.*
4343

4444
The verbosity of tracking data emitted to Application Insights can be configured in the `logger` (Functions 1.x) or `logging` (Functions 2.0) section of the `host.json` file.
4545

@@ -69,10 +69,10 @@ The verbosity of tracking data emitted to Application Insights can be configured
6969
}
7070
```
7171

72-
By default, all *non-replay* tracking events are emitted. The volume of data can be reduced by setting `Host.Triggers.DurableTask` to `"Warning"` or `"Error"` in which case tracking events will only be emitted for exceptional situations. To enable emitting the verbose orchestration replay events, set the `logReplayEvents` to `true` in the [host.json](durable-functions-bindings.md#host-json) configuration file.
72+
By default, all *non-replay* tracking events are emitted. The volume of data can be reduced by setting `Host.Triggers.DurableTask` to `"Warning"` or `"Error"` in which case tracking events are only emitted for exceptional situations. To enable emitting the verbose orchestration replay events, set the `logReplayEvents` to `true` in the [host.json](durable-functions-bindings.md#host-json) configuration file.
7373

7474
> [!NOTE]
75-
> By default, Application Insights telemetry is sampled by the Azure Functions runtime to avoid emitting data too frequently. This can cause tracking information to be lost when many lifecycle events occur in a short period of time. The [Azure Functions Monitoring article](../configure-monitoring.md#configure-sampling) explains how to configure this behavior.
75+
> By default, the Azure Functions runtime samples Application Insights telemetry to avoid emitting data too frequently. Sampling can cause tracking information to be lost when many lifecycle events occur in a short period of time. The [Azure Functions Monitoring article](../configure-monitoring.md#configure-sampling) explains how to configure this behavior.
7676
7777
Inputs and outputs of orchestrator, activity, and entity functions are not logged by default. This default behavior is recommended because logging inputs and outputs could increase Application Insights costs. Function input and output payloads may also contain sensitive information. Instead, the number of bytes for function inputs and outputs are logged instead of the actual payloads by default. If you want the Durable Functions extension to log the full input and output payloads, set the `traceInputsAndOutputs` property to `true` in the [host.json](durable-functions-bindings.md#host-json) configuration file.
7878

@@ -153,7 +153,7 @@ You can enable these logs by updating the `logging/logLevel` section of your fun
153153
If you have Application Insights enabled, these logs are automatically added to the `trace` collection. You can search them the same way that you search for other `trace` logs using Kusto queries.
154154

155155
> [!NOTE]
156-
> For production applications, it is recommended that you enable `DurableTask.Core` and the appropriate storage provider (e.g. `DurableTask.AzureStorage`) logs using the `"Warning"` filter. Higher verbosity filters such as `"Information"` are very useful for debugging performance issues. However, these log events can be high-volume and can significantly increase Application Insights data storage costs.
156+
> For production applications, it is recommended that you enable `DurableTask.Core` and the appropriate storage provider (e.g. `DurableTask.AzureStorage`) logs using the `"Warning"` filter. Higher verbosity filters such as `"Information"` are useful for debugging performance issues. However, these log events can be high-volume and can significantly increase Application Insights data storage costs.
157157
158158
The following Kusto query shows how to query for DTFx logs. The most important part of the query is `where customerDimensions.Category startswith "DurableTask"` since that filters the results to logs in the `DurableTask.Core` and `DurableTask.AzureStorage` categories.
159159

@@ -287,7 +287,7 @@ Done!
287287
```
288288

289289
> [!NOTE]
290-
> Remember that while the logs claim to be calling F1, F2, and F3, those functions are only *actually* called the first time they are encountered. Subsequent calls that happen during replay are skipped and the outputs are replayed to the orchestrator logic.
290+
> Remember that while the logs claim to be calling F1, F2, and F3, those functions are *only* called the first time they are encountered. Subsequent calls that happen during replay are skipped and the outputs are replayed to the orchestrator logic.
291291
292292
If you want to only write logs on non-replay executions, you can write a conditional expression to log only if the "is replaying" flag is `false`. Consider the example above, but this time with replay checks.
293293

@@ -309,7 +309,7 @@ public static async Task Run(
309309
}
310310
```
311311

312-
Starting in Durable Functions 2.0, .NET orchestrator functions also have the option to create an `ILogger` that automatically filters out log statements during replay. This automatic filtering is done using the [IDurableOrchestrationContext.CreateReplaySafeLogger(ILogger)](/dotnet/api/microsoft.azure.webjobs.extensions.durabletask.durablecontextextensions.createreplaysafelogger) API.
312+
Starting in Durable Functions 2.0, .NET orchestrator functions can create an `ILogger` that automatically filters out log statements during replay. This automatic filtering is done using the [IDurableOrchestrationContext.CreateReplaySafeLogger(ILogger)](/dotnet/api/microsoft.azure.webjobs.extensions.durabletask.durablecontextextensions.createreplaysafelogger) API.
313313

314314
```csharp
315315
[FunctionName("FunctionChain")]
@@ -351,7 +351,7 @@ public static async Task Run([OrchestrationTrigger] TaskOrchestrationContext con
351351
```
352352

353353
> [!NOTE]
354-
> The ability to wrap an existing `ILogger` into a replay-safe logger has been removed in Durable Functions for .NET isolated worker.
354+
> The ability to wrap an existing `ILogger` into a replay-safe logger is removed in Durable Functions for .NET isolated worker.
355355
356356
# [JavaScript](#tab/javascript)
357357

@@ -523,7 +523,7 @@ GET /runtime/webhooks/durabletask/instances/instance123?code=XYZ
523523
524524
```
525525

526-
Clients will get the following response:
526+
Clients get the following response:
527527

528528
```json
529529
{
@@ -544,7 +544,7 @@ Clients will get the following response:
544544
Distributed Tracing tracks requests and shows how different services interact with each other. In Durable Functions, it also correlates orchestrations and activities together. This is helpful to understand how much time steps of the orchestration take relative to the entire orchestration. It is also useful to understand where an application is having an issue or where an exception was thrown. This feature is supported for all languages and storage providers.
545545

546546
> [!NOTE]
547-
> Distributed Tracing V2 requires [Durable Functions v2.12.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/2.12.0) or greater. Also, Distributed Tracing V2 is in a preview state and therefore some Durable Functions patterns are not instrumented. For example, Durable Entities operations are not instrumented and traces will not show up in Application Insights.
547+
> Distributed Tracing V2 requires [Durable Functions v2.12.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/2.12.0) or greater. Also, Distributed Tracing V2 is in a preview state and therefore some Durable Functions patterns are not instrumented. For example, Durable Entities operations are not instrumented and traces do not show up in Application Insights.
548548
549549
### Setting up Distributed Tracing
550550

@@ -568,12 +568,12 @@ To set up distributed tracing, update the host.json and set up an Application In
568568
If the Function app is not configured with an Application Insights resource, then configure it following the instructions [here](../configure-monitoring.md#enable-application-insights-integration).
569569

570570
### Inspecting the traces
571-
In the Application Insights resource, navigate to **Transaction Search**. In the results, check for `Request` and `Dependency` events that start with Durable Functions specific prefixes (e.g. `orchestration:`, `activity:`, etc.). Selecting one of these events will open up a Gantt chart that will show the end to end distributed trace.
571+
In the Application Insights resource, navigate to **Transaction Search**. In the results, check for `Request` and `Dependency` events that start with Durable Functions specific prefixes (e.g. `orchestration:`, `activity:`, etc.). Selecting one of these events opens up a Gantt chart that shows the end to end distributed trace.
572572

573573
[![Gantt Chart showing Application Insights Distributed Trace.](./media/durable-functions-diagnostics/app-insights-distributed-trace-gantt-chart.png)](./media/durable-functions-diagnostics/app-insights-distributed-trace-gantt-chart.png#lightbox)
574574

575575
### Troubleshooting
576-
If you don't see the traces in Application Insights, please make sure to wait about five minutes after running the application to ensure that all of the data is propagated to the Application Insights resource.
576+
If you don't see the traces in Application Insights, make sure to wait about five minutes after running the application to ensure that all of the data is propagated to the Application Insights resource.
577577

578578
## Debugging
579579

0 commit comments

Comments
 (0)