Skip to content

Commit 9ef12b9

Browse files
authored
Merge pull request #263430 from george-guirguis/main
Added resource logs
2 parents 0a8944a + af0a358 commit 9ef12b9

File tree

1 file changed

+212
-1
lines changed

1 file changed

+212
-1
lines changed

articles/event-grid/monitor-mqtt-delivery-reference.md

Lines changed: 212 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,219 @@ This article provides a reference of log and metric data collected to analyze th
5353
| DropReason | The reason a session was dropped. The available values include: <br><br>- SessionExpiry: a persistent session has expired. <br>- TransientSession: a non-persistent session has expired. <br>- SessionOverflow: a client didn't connect during the lifespan of the session to receive queued QOS1 messages until the queue reached its maximum limit. <br>- AuthorizationError: a session drop because of any authorization reasons.
5454

5555

56+
## Resource logs
57+
58+
MQTT broker in Azure Event Grid captures diagnostic logs for the following categories:
59+
60+
- [Failed MQTT connections](#failed-mqtt-connections)
61+
- [Successful MQTT connections](#successful-mqtt-connections)
62+
- [MQTT disconnections](#mqtt-disconnections)
63+
- [Failed MQTT published messages](#failed-mqtt-published-messages)
64+
- [Failed MQTT subscription operations](#failed-mqtt-subscription-operations)
65+
66+
This section provides schema and examples for these logs.
67+
68+
### Common properties
69+
The following properties are common for all the resource logs from MQTT broker.
70+
71+
| Property name | Type | Description |
72+
| ----------- | ---- | ----------- |
73+
| `time` | `DateTime` | Timestamp (UTC) when the log was generated. |
74+
| `resourceId` | `String` | Resource ID of the Event Grid namespace. For example: `/SUBSCRIPTIONS/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/RESOURCEGROUPS/MYRG/PROVIDERS/MICROSOFT.EVENTGRID/NAMESPACE/MYNAMESPACE`. |
75+
| `location` | `String` | Location of the namespace |
76+
| `operationName` | `String` | Name of the operation. For example: `Microsoft.EventGrid/topicspaces/connect`, `Microsoft.EventGrid/topicspaces/disconnect`, `Microsoft.EventGrid/topicspaces/publish`, `Microsoft.EventGrid/topicspaces/subscribe`, `Microsoft.EventGrid/topicspaces/unsubscribe`. |
77+
| `category` | `String` | Category or type of the operation. For example: `FailedMQTTConnections`, `SuccessfulMQTTConnections`, `MQTTDisconnections`, `FailedMQTTPublishedMessages`, `FailedMQTTSubscriptionOperations`. |
78+
| `resultType` | `String` | Result of the operation. For example: `Failed`, `Succeeded`. |
79+
| `resultSignature` | `String` | Result of the failed operation. For example: `QuotaExceeded`, `ClientAuthenticationError`, `AuthorizationError`. This property isn't included for the successful events like `SuccessfulMQTTConnections`. |
80+
| `resultDescription` | `String` | More description about the result of the failed operation. This property isn't included for the successful events like `SuccessfulMQTTConnections`. |
81+
| `AuthenticationAuthority` | `String` | Type of authority used to authenticate your MQTT client. It's set to one of the following values: `Local` for clients registered in Event Grid's local registry, or `AAD` for clients using Microsoft Entra for authentication. |
82+
| `authenticationType` | `String` | Type of authentication used by the client. It's set to one of the following values: `CertificateThumbprintMatch`, `AccessToken`, or `CACertificate`. |
83+
| `clientIdentitySource` | `String` | Source of the client’s identity. It's `JWT` when you use Microsoft Entra ID authentication. |
84+
| `authenticationAuthority` | `String` | Authority of the client's identity. It's set to one of the following values: `local` for the clients in Event Grid namespace's local registry, `AAD` for AAD clients. |
85+
| `clientIdentity` | `String` | Value of the client’s identity. It's the name of the local registry or object ID for Microsoft Entra ID clients.|
86+
87+
88+
### Failed MQTT connections
89+
This log includes an entry for every failed `MQTT CONNECT` operation by the client. This log can be used to diagnose connectivity issues.
90+
91+
Here's a sample Failed MQTT connection log entry.
92+
93+
```json
94+
[
95+
{
96+
"time": "2023-11-06T22:45:02.6829930Z",
97+
"resourceId": "/SUBSCRIPTIONS/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/RESOURCEGROUPS/MYRG/PROVIDERS/MICROSOFT.EVENTGRID/NAMESPACE/MYNS",
98+
"location": "eastus",
99+
"operationName": "Microsoft.EventGrid/topicspaces/connect",
100+
"category": "FailedMqttConnections",
101+
"resultType": "Failed",
102+
"resultSignature": "AuthenticationError",
103+
"resultDescription": "Client could not be found",
104+
"identity": {
105+
"authenticationType": "CertificateThumbprintMatch",
106+
"clientIdentitySource": "UserName",
107+
"authenticationAuthority": "Local",
108+
"clientIdentity": "testclient-1"
109+
},
110+
"properties": {
111+
"sessionName": "testclient1",
112+
"protocol": "MQTT5",
113+
"traceId": "pwu5p3uuvzbyzpe4vyygij3it4"
114+
}
115+
}
116+
]
117+
```
118+
Here are the properties and their descriptions.
119+
120+
| Property | Type | Description |
121+
| ----------- | ---- | ----------- |
122+
| `sessionName` | `String` | Name of the session provided by the client in the `MQTT CONNECT` packet’s clientId field. |
123+
| `protocol` | `String` | Protocol used by the client to connect. Possible values are: MQTT3, MQTT3-WS, MQTT5, MQTT5-WS. |
124+
| `traceId` | `Int` | Generated trace ID. |
125+
126+
127+
### Successful MQTT connections
128+
This log includes an entry for every successful `MQTT CONNECT` operation by the client. This log can be used for auditing purposes.
129+
130+
```json
131+
[
132+
{
133+
"time": "2023-11-07T01:22:05.2804980Z",
134+
"resourceId": "/SUBSCRIPTIONS/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/RESOURCEGROUPS/MYRG/PROVIDERS/MICROSOFT.EVENTGRID/NAMESPACE/MYNS",
135+
"location": "eastus",
136+
"operationName": "Microsoft.EventGrid/topicspaces/connect",
137+
"category": "SuccessfulMqttConnections",
138+
"resultType": "Succeeded",
139+
"identity": {
140+
"authenticationType": "CertificateThumbprintMatch",
141+
"clientIdentitySource": "UserName",
142+
"authenticationAuthority": "Local",
143+
"clientIdentity": "client1"
144+
},
145+
"properties": {
146+
"sessionName": "client1",
147+
"protocol": "MQTT5"
148+
}
149+
}
150+
]
151+
```
152+
153+
Here are the properties and their descriptions.
154+
155+
| Property | Type | Description |
156+
| ----------- | ---- | ----------- |
157+
| `sessionName` | `String` | Name of the session provided by the client in the `MQTT CONNECT` packet’s clientId field. |
158+
| `protocol` | `String` | Protocol used by the client to connect. Possible values are: MQTT3, MQTT3-WS, MQTT5, MQTT5-WS. |
159+
160+
161+
### MQTT disconnections
162+
This log includes an entry for every MQTT client disconnection from an Event Grid namespace. This log can be used to diagnose connectivity issues.
163+
164+
```json
165+
[
166+
{
167+
"time": "2023-11-07T01:29:22.4591610Z",
168+
"resourceId": "/SUBSCRIPTIONS/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/RESOURCEGROUPS/MYRG/PROVIDERS/MICROSOFT.EVENTGRID/NAMESPACE/MYNS",
169+
"location": "eastus",
170+
"operationName": "Microsoft.EventGrid/topicspaces/disconnect",
171+
"category": "MqttDisconnections",
172+
"resultType": "Failed",
173+
"resultSignature": "ClientError",
174+
"resultDescription": "Timed out per negotiated Keep Alive",
175+
"identity": {
176+
"clientIdentity": "client1"
177+
},
178+
"properties": {
179+
"sessionName": "client1",
180+
"protocol": "MQTT5"
181+
}
182+
}
183+
]
184+
```
185+
186+
Here are the properties and their descriptions.
187+
188+
| Property | Type | Description |
189+
| ----------- | ---- | ----------- |
190+
| `sessionName` | `String` | Name of the session provided by the client in the `MQTT CONNECT` packet’s clientId field. |
191+
| `protocol` | `String` | Protocol used by the client to connect. Possible values are: MQTT3, MQTT3-WS, MQTT5, MQTT5-WS. |
192+
193+
194+
### Failed MQTT published messages
195+
This log includes an entry for every MQTT message that failed to be published to or delivered by an Event Grid namespace. This log can be used to diagnose publishing issues and message loss.
196+
197+
```json
198+
[
199+
{
200+
"time": "2023-11-07T01:22:48.2811790Z",
201+
"resourceId": "/SUBSCRIPTIONS/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/RESOURCEGROUPS/MYRG/PROVIDERS/MICROSOFT.EVENTGRID/NAMESPACE/MYNS",
202+
"location": "eastus",
203+
"operationName": "Microsoft.EventGrid/topicspaces/publish",
204+
"category": "FailedMqttPublishedMessages",
205+
"resultType": "Failed",
206+
"resultSignature": "AuthorizationError",
207+
"resultDescription": "Topic name 'testtopic/small4.0' does not match any topicspaces",
208+
"identity": { "clientIdentity": "client1" },
209+
"properties": {
210+
"sessionName": "client1",
211+
"protocol": "MQTT5",
212+
"traceId": "ako65yewjjhzbdp3lxny7557fu",
213+
"qos": 1,
214+
"topicName": "testtopic/small4.0",
215+
"operationCount": 1
216+
}
217+
}
218+
]
219+
```
220+
221+
Here are the columns of the `EventGridNamespaceFailedMqttPublishedMessages` Log Analytics table and their descriptions.
222+
223+
| Column name | Type | Description |
224+
| ----------- | ---- | ----------- |
225+
| `sessionName` | `String` | Name of the session provided by the client in the MQTT CONNECT packet’s clientId field. |
226+
| `protocol` | `String` | Protocol used by the client to publish. Possible values are: MQTT3, MQTT3-WS, MQTT5, MQTT5-WS. |
227+
| `traceId` | `Int` | Generated trace ID. |
228+
| `qos` | `Int` | Quality of service used by the client to publish. Possible values are: 0 or 1. |
229+
| `topicName` | `String` | MQTT Topic Name used by the client to publish. |
230+
| `operationCount` | `Int` | Count of MQTT message that failed to be published to or delivered by an Event Grid namespace with the same resultDescription. |
231+
232+
### Failed MQTT subscription operations
233+
This log includes an entry for every MQTT subscribe operation by an MQTT client. A log entry is added for each topic filter within the same subscribe/unsubscribe packet that has the same error. This log can be used to diagnose subscription issues and message loss.
234+
235+
```json
236+
[
237+
{
238+
"time": "2023-11-07T01:22:39.0339970Z",
239+
"resourceId": "/SUBSCRIPTIONS/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/RESOURCEGROUPS/MYRG/PROVIDERS/MICROSOFT.EVENTGRID/NAMESPACE/MYNS",
240+
"location": "eastus",
241+
"operationName": "Microsoft.EventGrid/topicspaces/subscribe",
242+
"category": "FailedMqttSubscriptionOperations",
243+
"resultType": "Failed",
244+
"resultSignature": "AuthorizationError",
245+
"resultDescription": "Topic filter 'testtopic/#' does not match any topicspaces",
246+
"identity": { "clientIdentity": "client1" },
247+
"properties": {
248+
"sessionName": "client1",
249+
"protocol": "MQTT5",
250+
"traceId": "gnz3cgqpozg4tbm5anvsvopafi",
251+
"topicFilters": ["testtopic/#"]
252+
}
253+
}
254+
]
255+
```
256+
257+
Here are the columns of the `EventGridNamespaceFailedMqttSubscriptions` Log Analytics table and their descriptions.
258+
259+
| Column name | Type | Description |
260+
| ----------- | ---- | ----------- |
261+
| `sessionName` | `String` | Name of the session provided by the client in the MQTT CONNECT packet’s clientId field. |
262+
| `protocol` | `String` | Protocol used by the client to publish. Possible values are: MQTT3, MQTT3-WS, MQTT5, MQTT5-WS. |
263+
| `traceId` | `Int` | Generated trace ID. |
264+
| `topicFilters` | Array of strings | List of topic names within the same packet that have the same error. |
265+
266+
56267
## Next steps
57268
See the following articles:
58269

59270
- [Monitor pull delivery reference](monitor-pull-reference.md).
60-
- [Monitor push delivery reference](monitor-push-reference.md).
271+
- [Monitor push delivery reference](monitor-push-reference.md).

0 commit comments

Comments
 (0)