Skip to content

Commit d36e50e

Browse files
author
Jill Grant
authored
Merge pull request #246701 from george-guirguis/main
added new metrics and events and fixed old events and a typo
2 parents 146707e + 95dd147 commit d36e50e

File tree

5 files changed

+279
-96
lines changed

5 files changed

+279
-96
lines changed

articles/event-grid/event-schema-event-grid-namespace.md

Lines changed: 115 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Azure Event Grid namespace (Preview) emits the following event types:
1717
| ---------- | ----------- |
1818
| Microsoft.EventGrid.MQTTClientSessionConnected | Published when an MQTT client’s session is connected to Event Grid. |
1919
| Microsoft.EventGrid.MQTTClientSessionDisconnected | Published when an MQTT client’s session is disconnected from Event Grid. |
20-
20+
| Microsoft.EventGrid.MQTTClientCreatedOrUpdated | Published when an MQTT client is created or updated in the Event Grid Namespace. |
21+
| Microsoft.EventGrid.MQTTClientDeleted | Published when an MQTT client is deleted from the Event Grid Namespace. |
2122

2223
## Example event
2324

@@ -27,16 +28,16 @@ This sample event shows the schema of an event raised when an MQTT client’s se
2728

2829
```json
2930
[{
30-
"id": "6f1b70b8-557a-4865-9a1c-94cc3def93db",
31-
"eventTime": "2023-04-28T00:49:04.0211141Z",
31+
"id": "5249c38a-a048-46dd-8f60-df34fcdab06c",
32+
"eventTime": "2023-07-29T01:23:49.6454046Z",
3233
"eventType": "Microsoft.EventGrid.MQTTClientSessionConnected",
33-
"topic": "/subscriptions/ 00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.EventGrid/namespaces/myns",
34-
"subject": "/clients/device1/sessions/session1",
34+
"topic": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.EventGrid/namespaces/myns",
35+
"subject": "clients/client1/sessions/session1",
3536
"dataVersion": "1",
3637
"metadataVersion": "1",
3738
"data": {
3839
"namespaceName": "myns",
39-
"clientAuthenticationName": "device1",
40+
"clientAuthenticationName": "client1",
4041
"clientSessionName": "session1",
4142
"sequenceNumber": 1
4243
}
@@ -46,18 +47,61 @@ This sample event shows the schema of an event raised when an MQTT client’s se
4647

4748
```json
4849
[{
49-
"id": "6f1b70b8-557a-4865-9a1c-94cc3def93db",
50-
"eventTime": "2023-04-28T00:49:04.0211141Z",
51-
"eventType": "Microsoft.EventGrid.MQTTClientSessionConnected",
52-
"topic": "/subscriptions/ 00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.EventGrid/namespaces/myns",
53-
"subject": "/clients/device1/sessions/session1",
50+
"id": "e30e5174-787d-4e19-8812-580148bfcf7b",
51+
"eventTime": "2023-07-29T01:27:40.2446871Z",
52+
"eventType": "Microsoft.EventGrid.MQTTClientSessionDisconnected",
53+
"topic": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.EventGrid/namespaces/myns",
54+
"subject": "clients/client1/sessions/session1",
5455
"dataVersion": "1",
5556
"metadataVersion": "1",
5657
"data": {
5758
"namespaceName": "myns",
58-
"clientAuthenticationName": "device1",
59+
"clientAuthenticationName": "client1",
5960
"clientSessionName": "session1",
60-
"sequenceNumber": 1
61+
"sequenceNumber": 1,
62+
"disconnectionReason": "ClientInitiatedDisconnect"
63+
}
64+
}]
65+
```
66+
This sample event shows the schema of an event raised when an MQTT client is created or updated in the Event Grid Namespace:
67+
68+
```json
69+
[{
70+
"id": "383d1562-c95f-4095-936c-688e72c6b2bb",
71+
"eventTime": "2023-07-29T01:14:35.8928724Z",
72+
"eventType": "Microsoft.EventGrid.MQTTClientCreatedOrUpdated",
73+
"topic": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.EventGrid/namespaces/myns",
74+
"subject": "clients/client1",
75+
"dataVersion": "1",
76+
"metadataVersion": "1",
77+
"data": {
78+
"createdOn": "2023-07-29T01:14:34.2048108Z",
79+
"updatedOn": "2023-07-29T01:14:34.2048108Z",
80+
"namespaceName": "myns",
81+
"clientName": "client1",
82+
"clientAuthenticationName": "client1",
83+
"state": "Enabled",
84+
"attributes": {
85+
"attribute1": "value1"
86+
}
87+
}
88+
}]
89+
```
90+
This sample event shows the schema of an event raised when an MQTT client is deleted from the Event Grid Namespace:
91+
92+
```json
93+
[{
94+
"id": "2a93aaf9-66c2-4f8e-9ba3-8d899c10bf17",
95+
"eventTime": "2023-07-29T01:30:52.5620566Z",
96+
"eventType": "Microsoft.EventGrid.MQTTClientDeleted",
97+
"topic": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.EventGrid/namespaces/myns",
98+
"subject": "clients/client1",
99+
"dataVersion": "1",
100+
"metadataVersion": "1",
101+
"data": {
102+
"clientName": "client1",
103+
"clientAuthenticationName": "client1",
104+
"namespaceName": "myns"
61105
}
62106
}]
63107
```
@@ -68,15 +112,15 @@ This sample event shows the schema of an event raised when an MQTT client's sess
68112

69113
```json
70114
[{
71-
"id": "6f1b70b8-557a-4865-9a1c-94cc3def93db",
72-
"time": "2023-04-28T00:49:04.0211141Z",
115+
"specversion": "1.0",
116+
"id": "5249c38a-a048-46dd-8f60-df34fcdab06c",
117+
"time": "2023-07-29T01:23:49.6454046Z",
73118
"type": "Microsoft.EventGrid.MQTTClientSessionConnected",
74119
"source": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.EventGrid/namespaces/myns",
75-
"subject": "/clients/device1/sessions/session1",
76-
"specversion": "1.0",
120+
"subject": "clients/client1/sessions/session1",
77121
"data": {
78122
"namespaceName": "myns",
79-
"clientAuthenticationName": "device1",
123+
"clientAuthenticationName": "client1",
80124
"clientSessionName": "session1",
81125
"sequenceNumber": 1
82126
}
@@ -86,25 +130,65 @@ This sample event shows the schema of an event raised when an MQTT client’s se
86130

87131
```json
88132
[{
89-
"id": "3b93123d-5427-4dec-88d5-3b6da87b0f64",
90-
"time": "2023-04-28T00:51:28.6037385Z",
91-
"type": "Microsoft.EventGrid.MQTTClientSessionDisconnected",
92-
"source": "/subscriptions/ 00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.EventGrid/namespaces/myns",
93-
"subject": "/clients/device1/sessions/session1",
94133
"specversion": "1.0",
134+
"id": "e30e5174-787d-4e19-8812-580148bfcf7b",
135+
"time": "2023-07-29T01:27:40.2446871Z",
136+
"type": "Microsoft.EventGrid.MQTTClientSessionDisconnected",
137+
"source": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.EventGrid/namespaces/myns",
138+
"subject": "clients/client1/sessions/session1",
95139
"data": {
96140
"namespaceName": "myns",
97-
"clientAuthenticationName": "device1",
141+
"clientAuthenticationName": "client1",
98142
"clientSessionName": "session1",
99143
"sequenceNumber": 1,
100-
"disconnectionReason": "ClientError"
144+
"disconnectionReason": "ClientInitiatedDisconnect"
101145
}
102146
}]
103147
```
148+
This sample event shows the schema of an event raised when an MQTT client is created or updated in the Event Grid Namespace:
104149

150+
```json
151+
[{
152+
"specversion": "1.0",
153+
"id": "383d1562-c95f-4095-936c-688e72c6b2bb",
154+
"time": "2023-07-29T01:14:35.8928724Z",
155+
"type": "Microsoft.EventGrid.MQTTClientCreatedOrUpdated",
156+
"source": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.EventGrid/namespaces/myns",
157+
"subject": "clients/client1",
158+
"data": {
159+
"createdOn": "2023-07-29T01:14:34.2048108Z",
160+
"updatedOn": "2023-07-29T01:14:34.2048108Z",
161+
"namespaceName": "myns",
162+
"clientName": "client1",
163+
"clientAuthenticationName": "client1",
164+
"state": "Enabled",
165+
"attributes": {
166+
"attribute1": "value1"
167+
}
168+
}
169+
}]
170+
```
171+
This sample event shows the schema of an event raised when an MQTT client is deleted from the Event Grid Namespace:
172+
173+
```json
174+
[{
175+
"specversion": "1.0",
176+
"id": "2a93aaf9-66c2-4f8e-9ba3-8d899c10bf17",
177+
"time": "2023-07-29T01:30:52.5620566Z",
178+
"type": "Microsoft.EventGrid.MQTTClientDeleted",
179+
"source": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.EventGrid/namespaces/myns",
180+
"subject": "clients/client1",
181+
"data": {
182+
"namespaceName": "myns",
183+
"clientName": "client1",
184+
"clientAuthenticationName": "client1"
185+
}
186+
}]
187+
```
105188
---
106189

107190

191+
108192
### Event properties
109193

110194
# [Event Grid event schema](#tab/event-grid-event-schema)
@@ -139,20 +223,20 @@ All events contain the same top-level data:
139223

140224
---
141225

142-
For all Event Grid namespace events, the data object contains the following properties:
226+
The data object contains the following properties:
143227

144228
| Property | Type | Description |
145229
| -------- | ---- | ----------- |
146230
| `namespaceName` | string | Name of the Event Grid namespace where the MQTT client was connected or disconnected. |
147231
| `clientAuthenticationName` | string | Unique identifier for the MQTT client that the client presents to the service for authentication. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters.|
148232
| `clientSessionName` | string | Unique identifier for the MQTT client's session. This case-sensitive string can be up to 128 characters long, and supports UTF-8 characters.|
149233
| `sequenceNumber` | string | A number that helps indicate order of MQTT client session connected or disconnected events. Latest event will have a sequence number that is higher than the previous event. |
150-
151-
For the **MQTT Client Session Disconnected** event, the data object also contains the following property:
152-
153-
| Property | Type | Description |
154-
| -------- | ---- | ----------- |
155234
| `disconnectionReason` | string | Reason for the disconnection of the MQTT client's session. The value could be one of the values in the disconnection reasons table. |
235+
| `createdOn` | string | The time the client resource is created based on the provider's UTC time. |
236+
| `updatedOn` | string | The time the client resource is last updated based on the provider's UTC time. If the client resource was never updated, this value is identical to the value of the 'createdOn' property |
237+
| `clientName` | string | The time the client resource is last updated based on the provider's UTC time. If the client resource was never updated, this value is identical to the value of the 'createdOn' property. |
238+
| `state` | string | The configured state of the client. The value could be Enabled or Disabled.|
239+
| `attributes` | string | The array of key-value pair attributes that are assigned to the client resource.|
156240

157241
### Disconnection reasons:
158242

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@ This article provides a reference of log and metric data collected to analyze th
1919
| MQTT.SuccessfulPublishedMessages | MQTT: Successful Published Messages | Count | Total | The number of MQTT messages that were published successfully into the namespace. | Protocol, QoS |
2020
| MQTT.FailedPublishedMessages | MQTT: Failed Published Messages | Count | Total | The number of MQTT messages that failed to be published into the namespace. | Protocol, QoS, Error |
2121
| MQTT.SuccessfulDeliveredMessages | MQTT: Successful Delivered Messages | Count | Total | The number of messages delivered by the namespace, regardless of the acknowledgments from MQTT clients. There are no failures for this operation. | Protocol, QoS |
22+
| MQTT.Throughput | MQTT: Throughput | Count | Total | The total bytes published to or delivered by the namespace. | Direction |
2223
| MQTT.SuccessfulSubscriptionOperations | MQTT: Successful Subscription Operations | Count | Total | The number of successful subscription operations (Subscribe, Unsubscribe). This metric is incremented for every topic filter within your subscription request that gets accepted by Event Grid. | OperationType, Protocol |
2324
| MQTT.FailedSubscriptionOperations | MQTT: Failed Subscription Operations | Count | Total | The number of failed subscription operations (Subscribe, Unsubscribe). This metric is incremented for every topic filter within your subscription request that gets rejected by Event Grid. | OperationType, Protocol, Error |
25+
| Mqtt.SuccessfulRoutedMessages | MQTT: Successful Routed Messages | Count | Total | The number of MQTT messages that were routed successfully from the namespace. | |
26+
| Mqtt.FailedRoutedMessages | MQTT: Failed Routed Messages | Count | Total | The number of MQTT messages that failed to be routed from the namespace. | Error |
2427
| MQTT.Connections | MQTT: Active Connections | Count | Total | The number of active connections in the namespace. The value for this metric is a point-in-time value. Connections that were active immediately after that point-in-time may not be reflected in the metric. | Protocol |
25-
| MQTT.Throughput | MQTT: Throughput | Count | Total | The total bytes published to or delivered by the namespace. | Direction |
28+
| Mqtt.DroppedSessions | MQTT: Dropped Sessions | Count | Total | The number of dropped sessions in the namespace. The value for this metric is a point-in-time value. Sessions that were dropped immediately after that point-in-time may not be reflected in the metric. | DropReason |
29+
30+
2631

2732
> [!NOTE]
2833
> Each subscription request increments the MQTT.RequestCount metric, while each topic filter within the subscription request increments the subscription operation metrics. For example, consider a subscription request that is sent with five different topic filters. Three of these topic filters were succeessfully processed while two of the topic filters failed to be processed. The following list represent the resulting increments to the metrics:
@@ -40,6 +45,7 @@ This article provides a reference of log and metric data collected to analyze th
4045
| Error | Error occurred during the operation. The available values include: <br><br>-QuotaExceeded: the client exceeded one or more of the throttling limits that resulted in a failure <br>- AuthenticationError: a failure because of any authentication reasons. <br>- AuthorizationError: a failure because of any authorization reasons.<br>- ClientError: the client sent a bad request or used one of the unsupported features that resulted in a failure. <br>- ServiceError: a failure because of an unexpected server error or for a server's operational reason.|
4146
| QoS | Quality of service level. The available values are: 0, 1. |
4247
| Direction | The direction of the operation. The available values are: <br><br>- Inbound: inbound throughput to Event Grid. <br>- Outbound: outbound throughput from Event Grid. |
48+
| 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.
4349

4450
## Next steps
4551
See the following articles:

0 commit comments

Comments
 (0)