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
Copy file name to clipboardExpand all lines: articles/azure-web-pubsub/howto-troubleshoot-resource-logs.md
+56-27Lines changed: 56 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: How to Troubleshoot with Azure Web PubSub Service Resource Logs
2
+
title: Troubleshoot with Azure Web PubSub Service Resource Logs
3
3
description: Learn what resource logs are and how to use them to troubleshoot common problems.
4
4
author: wanlwanl
5
5
ms.author: wanl
@@ -16,9 +16,9 @@ This how-to guide provides an overview of Azure Web PubSub resource logs and tip
16
16
17
17
There are three types of resource logs:
18
18
19
-
-**Connectivity** logs provide detailed information for Azure Web PubSub hub connections. They might include basic information like user ID and connection ID, or event information like connect and disconnect.
20
-
-**Messaging** logs provide tracing information for hub messages that are sent or received via the Azure Web PubSub service, like the tracing ID or message type.
21
-
-**HTTP request** logs provide tracing information for HTTP requests to the Azure Web PubSub service, like HTTP method or status code. Typically, an HTTP request is recorded when it arrives at or leaves from the service.
19
+
-*Connectivity* logs provide detailed information for Azure Web PubSub hub connections. They might include basic information like user ID and connection ID, or event information like connect and disconnect.
20
+
-*Messaging* logs provide tracing information for hub messages that are sent or received via the Azure Web PubSub service, like the tracing ID or message type.
21
+
-*HTTP request* logs provide tracing information for HTTP requests to the Azure Web PubSub service, like HTTP method or status code. Typically, an HTTP request is recorded when it arrives at or leaves from the service.
22
22
23
23
## Capture resource logs by using the live trace tool
24
24
@@ -30,44 +30,59 @@ You should consider the following factors when using the live trace tool:
30
30
- The Free tier instance of the Azure Web PubSub service has a daily limit of 20,000 messages (outbound traffic). You can unexpectedly reach the daily limit by using live trace.
31
31
- The live trace tool doesn't currently support Microsoft Entra authorization. You must enable access keys to use live trace. Under **Settings**, select **Keys**, and then enable **Access Key**.
32
32
33
-
## Launch the live trace tool
33
+
## Open the live trace tool
34
34
35
35
When you enable an access key, you use the access token to authenticate the live trace tool. Otherwise, you use Microsoft Entra ID to authenticate the live trace tool. You can find out if the access key is enabled by going to the **Keys** pane in your Azure SignalR Service instance in the Azure portal.
36
36
37
-
### Launch the live trace when the access key is enabled
37
+
### Open the live trace when the access key is enabled
38
38
39
39
1. Go to the Azure portal and your SignalR Service pane.
40
+
40
41
1. On the service menu, under **Monitoring**, select **Live trace settings**.
42
+
41
43
1. Select **Enable Live Trace**.
44
+
42
45
1. Select the **Save** button. It takes a moment for the changes to take effect.
46
+
43
47
1. When updating is complete, select **Open Live Trace Tool**.
44
48
45
49
:::image type="content" source="./media/howto-troubleshoot-diagnostic-logs/diagnostic-logs-with-live-trace-tool.png" alt-text="Screenshot of opening the live trace tool.":::
46
50
47
-
### Launch the live trace tool when the access key is disabled
51
+
### Open the live trace tool when the access key is disabled
48
52
49
53
#### Assign live trace tool API permission to yourself
50
54
51
55
1. Go to the Azure portal and your SignalR Service pane.
56
+
52
57
1. Select **Access control (IAM)**.
58
+
53
59
1. Select **+Add** and then select **Role assignment**.
60
+
54
61
1. On the **Job function roles** tab, select the **SignalR Service Owner** role, and then select **Next**.
62
+
55
63
1. On the **Members** pane, click **+Select members**.
64
+
56
65
1. Search and select members, and then click **Select**.
66
+
57
67
1. Select **Review + assign** and wait for the completion notification.
58
68
59
69
#### Enable the live trace tool
60
70
1. Go to the Azure portal and your SignalR Service pane.
71
+
61
72
1. From the service menu, under **Monitoring**, select **Live trace settings**.
73
+
62
74
1. Select **Enable Live Trace**.
75
+
63
76
1. Select the **Save** button. It takes a moment for the changes to take effect.
77
+
64
78
1. When updating is complete, select **Open Live Trace Tool**.
65
79
66
80
:::image type="content" source="./media/howto-troubleshoot-diagnostic-logs/diagnostic-logs-with-live-trace-tool.png" alt-text="Screenshot of opening the live trace tool.":::
67
81
68
82
#### Sign in with your Microsoft account
69
83
70
84
1. The live trace tool causes a Microsoft sign-in window to open. If no window opens, allow pop-up windows in your browser settings.
85
+
71
86
1. Wait for **Ready** to appear on the status bar.
72
87
73
88
### Capture the resource logs
@@ -83,24 +98,24 @@ The live trace tool can help you capture the resource logs for troubleshooting.
83
98
84
99
The real-time resource logs captured by the live trace tool contain detailed information for troubleshooting.
|**Exception**| Runtime exception of the Azure Web PubSub service |
108
+
|**Hub**| User-defined hub name |
109
+
|**Connection ID**| Identity of the connection |
110
+
|**User ID**| User identity |
111
+
|**IP**| Client IP address |
112
+
|**Route Template**| Route template of the API |
113
+
|**HTTP Method**| HTTP method (`POST`, `GET`, `PUT` or `DELETE`) |
114
+
|**URL**| Uniform resource locator |
115
+
|**Trace ID**| Unique identifier to the invocation |
116
+
|**Status Code**| HTTP response code |
117
+
|**Duration**| Duration between receiving the request and processing the request |
118
+
|**Headers**| Additional information passed by the client and the server with an HTTP request or response |
104
119
105
120
## Capture resource logs with Azure Monitor
106
121
@@ -109,15 +124,21 @@ The real-time resource logs captured by the live trace tool contain detailed inf
109
124
Currently, Azure Web PubSub supports integration with [Azure Storage](/azure/azure-monitor/essentials/resource-logs#send-to-azure-storage).
110
125
111
126
1. Go to the Azure portal.
127
+
112
128
1. On the **Diagnostic settings** pane of your Azure Web PubSub service instance, select **+ Add diagnostic setting**.
129
+
113
130
:::image type="content" source="./media/howto-troubleshoot-diagnostic-logs/diagnostic-settings-list.png" alt-text="Screenshot of viewing diagnostic settings and creating a new one.":::
131
+
114
132
1. In **Diagnostic setting name**, enter the setting name.
133
+
115
134
1. In **Category details**, select any log category you need.
135
+
116
136
1. In **Destination details**, select **Archive to a storage account**.
117
137
118
138
:::image type="content" source="./media/howto-troubleshoot-diagnostic-logs/diagnostic-settings-details.png" alt-text="Screenshot of configuring the diagnostic setting.":::
119
139
120
140
1. Select **Save** to save the diagnostic setting.
141
+
121
142
> [!NOTE]
122
143
> The storage account should be in the same region as the Azure Web PubSub service.
123
144
@@ -184,7 +205,9 @@ The following code is an example of a JSON string in an archive log:
184
205
To send logs to a Log Analytics workspace:
185
206
186
207
1. On the **Diagnostic setting** pane, under **Destination details**, select **Send to Log Analytics workspace**.
208
+
187
209
1. For **Subscription**, select the subscription that you want to use.
210
+
188
211
1. For the destination for the logs, select **Log Analytics workspace**.
189
212
190
213
To view the resource logs, follow these steps:
@@ -199,10 +222,14 @@ To view the resource logs, follow these steps:
199
222
200
223
To use a sample query for SignalR service, follow these steps:
201
224
202
-
1. Select **Logs** in your target Log Analytics.
225
+
1. Select **Logs** in your target Log Analytics workspace.
226
+
203
227
1. Select **Queries** to open the query explorer.
228
+
204
229
1. Select **Resource type** to group sample queries by resource type.
230
+
205
231
1. Select **Run** to run the script.
232
+
206
233
:::image type="content" alt-text="Screenshot of a sample query in Log Analytics." source="./media/howto-troubleshoot-diagnostic-logs/log-analytics-sample-query.png" lightbox="./media/howto-troubleshoot-diagnostic-logs/log-analytics-sample-query.png":::
207
234
208
235
Archive log columns include elements listed in the following table.
@@ -249,4 +276,6 @@ If you get **401 Unauthorized** returned for client requests, check your resourc
249
276
250
277
### Throttling
251
278
252
-
If you find that you can't establish client connections to the Azure Web PubSub service, check your resource logs. If you see `Connection count reaches limit` in the resource log, you established too many connections to the Azure Web PubSub service and reached the connection count limit. Consider scaling up your Azure Web PubSub service instance. If you see `Message count reaches limit` in the resource log and you're using the Free tier, it means you used up the quota of messages. If you want to send more messages, consider changing your Azure Web PubSub service instance to Standard tier. For more information, see [Azure Web PubSub pricing](https://azure.microsoft.com/pricing/details/web-pubsub/).
279
+
If you find that you can't establish client connections to the Azure Web PubSub service, check your resource logs. If you see `Connection count reaches limit` in the resource log, you established too many connections to the Azure Web PubSub service and reached the connection count limit. Consider scaling up your Azure Web PubSub service instance.
280
+
281
+
If you see `Message count reaches limit` in the resource log and you're using the Free tier, it means you used up the quota of messages. If you want to send more messages, consider changing your Azure Web PubSub service instance to Standard tier. For more information, see [Azure Web PubSub pricing](https://azure.microsoft.com/pricing/details/web-pubsub/).
0 commit comments