Skip to content

Commit f6017a1

Browse files
authored
Merge pull request #112990 from spelluru/egriddiag0427
Event Grid - Diagnostic Logs
2 parents 7dd6b91 + 68a1bd7 commit f6017a1

File tree

10 files changed

+45
-13
lines changed

10 files changed

+45
-13
lines changed
Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
11
---
2-
title: Azure Event Grid - Enable diagnostic logs for a topic
2+
title: Azure Event Grid - Enable diagnostic logs for topics or domains
33
description: This article provides step-by-step instructions on how to enable diagnostic logs for an Azure event grid topic.
44
services: event-grid
55
author: spelluru
66

77
ms.service: event-grid
88
ms.topic: how-to
9-
ms.date: 01/30/2020
9+
ms.date: 04/27/2020
1010
ms.author: spelluru
1111
---
1212

13-
# Diagnostic logs for an Azure event grid topic
14-
Diagnostic settings allow Event Grid users to capture and view publish and delivery failure Logs in one of the following places: an Azure storage account, an event hub, or a Log Analytics workspace. This article provides step-by-step instructions to enable diagnostic logs for an event grid topic.
13+
# Enable Diagnostic logs for Azure event grid topics or domains
14+
Diagnostic Settings now allow Event Grid users to capture and view **publish and delivery failure** Logs in either a Storage account, an event hub, or a Log Analytics Workspace. This article provides step-by-step instructions to enable these settings on an Event Grid Topic.
1515

1616
## Prerequisites
1717

1818
- A provisioned event grid topic
19-
- A provisioned destination for capturing diagnostic logs. It can one of the following destinations:
19+
- A provisioned destination for capturing diagnostic logs. It can one of the following destinations in the same location as the event grid topic:
2020
- Azure storage account
2121
- Event hub
2222
- Log Analytics workspace
2323

24-
2524
## Steps for enabling diagnostic logs for a topic
2625

26+
> [!NOTE]
27+
> The following procedure provides step-by-step instructions for enabling diagnostic logs for a topic. Steps for enabling diagnostic logs for a domain are very similar. In step 2, navigate to the event grid **domain** in the Azure portal.
28+
2729
1. Sign in to the [Azure portal](https://portal.azure.com).
2830
2. Navigate to the event grid topic for which you want to enable diagnostic log settings.
2931
3. Select **Diagnostic settings** under **Monitoring** in the left menu.
3032
4. On the **Diagnostic settings** page, select **Add New Diagnostic Setting**.
3133

3234
![Add diagnostic setting button](./media/enable-diagnostic-logs-topic/diagnostic-settings-add.png)
3335
5. Specify a **name** for the diagnostic setting.
34-
35-
![Diagnostic settings - name](./media/enable-diagnostic-logs-topic/diagnostic-settings-name.png)
36+
7. Select the **DeliveryFailures** and **PublishFailures** options in the **Log** section.
37+
![Select the failures](./media/enable-diagnostic-logs-topic/log-failures.png)
3638
6. Enable one or more of the capture destinations for the logs, and then configure them by selecting a previous created capture resource.
3739
- If you select **Archive to a storage account**, select **Storage account - Configure**, and then select the storage account in your Azure subscription.
3840

@@ -41,13 +43,43 @@ Diagnostic settings allow Event Grid users to capture and view publish and deliv
4143
![Stream to an event hub](./media/enable-diagnostic-logs-topic/archive-event-hub.png)
4244
- If you select **Send to Log Analytics**, select the Log Analytics workspace.
4345
![Send to Log Analytics](./media/enable-diagnostic-logs-topic/send-log-analytics.png)
44-
7. Select the **DeliveryFailures** and **PublishFailures** options in the **Log** section.
45-
![Select the failures](./media/enable-diagnostic-logs-topic/log-failures.png)
46-
8. Select **Save**. Select **X** in the right-corner to close the page.
46+
8. Select **Save**. Then, select **X** in the right-corner to close the page.
4747
9. Now, back on the **Diagnostic settings** page, confirm that you see a new entry in the **Diagnostics Settings** table.
4848
![Diagnostic setting in the list](./media/enable-diagnostic-logs-topic/diagnostic-setting-list.png)
4949

5050
You can also enable collection of all metrics for the topic.
5151

52+
## View diagnostic logs in Azure Storage
53+
54+
1. Once you enable a storage account as a capture destination and Event Grid starts emitting diagnostic logs, you should see new containers named **insights-logs-deliveryfailures** and **insights-logs-publishfailures** in the storage account.
55+
56+
![Storage - containers for diagnostic logs](./media/enable-diagnostic-logs-topic/storage-containers.png)
57+
2. As you navigate through one of the containers, you will end up at a blob in JSON format. The file contains log entries for either a delivery failure or a publish failure. The navigation path represents the **ResourceId** of the event grid topic and the timestamp (minute level) as to when the log entries were emitted. The blob/JSON file, which is downloadable, in the end adheres to the schema described in the next section.
58+
59+
[ ![JSON file in the storage](./media/enable-diagnostic-logs-topic/select-json.png) ](./media/enable-diagnostic-logs-topic/select-json.png)
60+
3. You should see content in the JSON file similar to the following example:
61+
62+
```json
63+
{
64+
"time": "2019-11-01T00:17:13.4389048Z",
65+
"resourceId": "/SUBSCRIPTIONS/SAMPLE-SUBSCTIPTION-ID /RESOURCEGROUPS/SAMPLE-RESOURCEGROUP-NAME/PROVIDERS/MICROSOFT.EVENTGRID/TOPICS/SAMPLE-TOPIC-NAME ",
66+
"eventSubscriptionName": "SAMPLEDESTINATION",
67+
"category": "DeliveryFailures",
68+
"operationName": "Deliver",
69+
"message": "Message:outcome=NotFound, latencyInMs=2635, systemId=17284f7c-0044-46fb-84b7-59fda5776017, state=FilteredFailingDelivery, deliveryTime=11/1/2019 12:17:10 AM, deliveryCount=0, probationCount=0, deliverySchema=EventGridEvent, eventSubscriptionDeliverySchema=EventGridEvent, fields=InputEvent, EventSubscriptionId, DeliveryTime, State, Id, DeliverySchema, LastDeliveryAttemptTime, SystemId, fieldCount=, requestExpiration=1/1/0001 12:00:00 AM, delivered=False publishTime=11/1/2019 12:17:10 AM, eventTime=11/1/2019 12:17:09 AM, eventType=Type, deliveryTime=11/1/2019 12:17:10 AM, filteringState=FilteredWithRpc, inputSchema=EventGridEvent, publisher=DIAGNOSTICLOGSTEST-EASTUS.EASTUS-1.EVENTGRID.AZURE.NET, size=363, fields=Id, PublishTime, SerializedBody, EventType, Topic, Subject, FilteringHashCode, SystemId, Publisher, FilteringTopic, TopicCategory, DataVersion, MetadataVersion, InputSchema, EventTime, fieldCount=15, url=sb://diagnosticlogstesting-eastus.servicebus.windows.net/, deliveryResponse=NotFound: The messaging entity 'sb://diagnosticlogstesting-eastus.servicebus.windows.net/eh-diagnosticlogstest' could not be found. TrackingId:c98c5af6-11f0-400b-8f56-c605662fb849_G14, SystemTracker:diagnosticlogstesting-eastus.servicebus.windows.net:eh-diagnosticlogstest, Timestamp:2019-11-01T00:17:13, referenceId: ac141738a9a54451b12b4cc31a10dedc_G14:"
70+
}
71+
```
72+
73+
## Schema for publish/delivery failure logs
74+
75+
| Property name | Data type | Description |
76+
| ------------- | --------- | ----------- |
77+
| Time | DateTime | The time when the log entry was generated <p>**Example value:** 01-29-2020 09:52:02.700</p> |
78+
| EventSubscriptionName | String | The name of the event subscription <p>**Example value:** "EVENTSUB1"</p> <p>This property exists only for delivery failure logs.</p> |
79+
| Category | String | The log category name. <p>**Example values:** "DeliveryFailures" or "PublishFailures" |
80+
| OperationName | String | The name of the operation performed while encountering the failure.<p>**Example Values:** "Deliver" for delivery failures. |
81+
| Message | String | The log message for the user explaining the reason for the failure and other additional details. |
82+
| ResourceId | String | The resource ID for the topic/domain resource<p>**Example Values:** `/SUBSCRIPTIONS/SAMPLE-SUBSCRIPTION-ID/RESOURCEGROUPS/SAMPLE-RESOURCEGROUP/PROVIDERS/MICROSOFT.EVENTGRID/TOPICS/TOPIC1` |
83+
5284
## Next steps
53-
If you need more help, post your issue in the [Stack Overflow forum](https://stackoverflow.com/questions/tagged/azure-eventgrid) or open a [support ticket](https://azure.microsoft.com/support/options/).
85+
See the following article: [Create diagnostic setting to collect resource logs and metrics in Azure](../azure-monitor/platform/diagnostic-settings.md)
10.7 KB
Loading
17.6 KB
Loading
1.71 KB
Loading
3.14 KB
Loading
12.1 KB
Loading
38.3 KB
Loading
13.9 KB
Loading
58.8 KB
Loading

articles/event-grid/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
href: custom-disaster-recovery.md
194194
- name: Troubleshoot
195195
items:
196-
- name: Enable diagnostic logs for a topic
196+
- name: Enable diagnostic logs
197197
href: enable-diagnostic-logs-topic.md
198198
- name: Troubleshoot errors
199199
href: troubleshoot-errors.md

0 commit comments

Comments
 (0)