You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Learn how to monitor Azure Blob Storage lifecycle management policy execution by using events, metrics, and logs.
5
5
author: normesta
6
6
7
7
ms.author: normesta
@@ -13,11 +13,11 @@ ms.topic: conceptual
13
13
14
14
# Monitor lifecycle management policy runs
15
15
16
-
You can determine when a lifecycle management run completes by subscribing to an event. You can use event properties to identify issues and investigate errors by using metrics and logs.
16
+
You can monitor Azure Blob Storage lifecycle management policy run by using events, metrics, and logs. To determine when a lifecycle management run completes by subscribing to an event. You can use event properties to identify issues and then diagnose those issues by using metrics and logs.
17
17
18
18
## Receiving notifications when a run is complete
19
19
20
-
A client can be notified when a lifecycle management run is complete by subscribing to the `LifecyclePolicyCompleted` event. This event is generated when the actions defined by a lifecycle management policy are performed. A summary section appears for each action that is included in the policy definition. The following json shows an example `LifecyclePolicyCompleted` event for a policy. Because the policy definition includes the `delete`, `tierToCool`, `tierToCold`, and `tierToArchive` actions, a summary section appears for each one.
20
+
To be notified when a lifecycle management run is complete, subscribe to the `LifecyclePolicyCompleted` event. This event is generated when the actions defined by a lifecycle management policy are performed. A summary section appears for each action that is included in the policy definition. The following json shows an example `LifecyclePolicyCompleted` event for a policy. A summary section appears for the `delete`, `tierToCool`, `tierToCold`, and `tierToArchive` actions. The following JSON shows an example of an event notification.
21
21
22
22
```json
23
23
{
@@ -54,21 +54,11 @@ A client can be notified when a lifecycle management run is complete by subscrib
54
54
}
55
55
```
56
56
57
-
The following table describes the schema of the `LifecyclePolicyCompleted` event.
58
-
59
-
|Field|Type|Description|
60
-
|---|---|---|
61
-
|scheduleTime|string|The time that the lifecycle policy was scheduled|
62
-
|deleteSummary|vector\<byte\>|The results summary of blobs scheduled for delete operation|
63
-
|tierToCoolSummary|vector\<byte\>|The results summary of blobs scheduled for tier-to-cool operation|
64
-
|tierToColdSummary|vector\<byte\>|The results summary of blobs scheduled for tier-to-cold operation|
65
-
|tierToArchiveSummary|vector\<byte\>|The results summary of blobs scheduled for tier-to-archive operation|
66
-
67
57
To learn more about the different ways to subscribe to an event, see [Event handlers in Azure Event Grid](../../event-grid/event-handlers.md?toc=/azure/storage/blobs/toc.json#microsoftstoragelifecyclepolicycompleted-event).
68
58
69
59
## Investigating errors by using metric and logs
70
60
71
-
The event response from the previous section shows that the lifecycle management policy attempted to delete five objects, but succeeded with only three of them. The `testFile4.txt` and `testFile5.txt` files were not successfully deleted as part of that run. To diagnose why some objects weren't processed successfully, you can use metrics explorer and query resource logs in Azure Monitor.
61
+
The event response example from the previous section shows that the lifecycle management policy attempted to delete five objects, but succeeded with only three of them. The `testFile4.txt` and `testFile5.txt` files were not successfully deleted as part of that run. To diagnose why some objects weren't processed successfully, you can use metrics explorer and query resource logs in Azure Monitor.
72
62
73
63
### Metrics
74
64
@@ -82,14 +72,14 @@ Use the following metric filters to narrow transactions to those executed by the
82
72
| API name | equal |`DeleteBlob`|
83
73
| Response type | not equal |`Success`|
84
74
85
-
The following image shows an example. The line chart shows the time these operations failed.
75
+
The following image shows an example of the query and the query result. The line chart that appears in the query result shows the time when these operations failed.
86
76
87
77
> [!div class="mx-imgBorder"]
88
78
> 
89
79
90
80
### Logs
91
81
92
-
To find out why objects weren't successfully processed by the policy, you can look at resource logs. Narrow logs to the time frame of the failures. Then, look at entries where the **UserAgentHeader** field is set to **ObjectLifeCycleScanner** or **OLCMScanner**. If you configured a diagnostic setting to send logs to Azure Monitor Log Analytics workspace, then you can use a Kusto query. The following example query finds log entries for failed delete operations that were initiated by a lifecycle management policy.
82
+
To find out why objects weren't successfully processed by the policy, you can look at resource logs. Narrow logs to the time frame of the failures. Then, look at entries where the **UserAgentHeader** field is set to **ObjectLifeCycleScanner** or **OLCMScanner**. If you configured a diagnostic setting to send logs to Azure Monitor Log Analytics workspace, then you can use a Kusto query to locate those log entries. The following example query finds log entries for failed delete operations that were initiated by a lifecycle management policy.
0 commit comments