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
In this article, we'll cover how to write more advanced queries to help troubleshoot issues with your Azure Cosmos DB account by using diagnostics logs sent to **Azure Diagnostics (legacy)** and **resource-specific (preview)** tables.
26
20
27
-
For Azure Diagnostics tables, all data is written into one single table. Users specify which category they want to query. If you want to view the full-text query of your request, see [Monitor Azure Cosmos DB data by using diagnostic settings in Azure](../monitor-resource-logs.md) to learn how to enable this feature.
28
-
29
-
For [resource-specific tables](../monitor-resource-logs.md), data is written into individual tables for each category of the resource. We recommend this mode because it:
30
-
31
-
- Makes it much easier to work with the data.
32
-
- Provides better discoverability of the schemas.
33
-
- Improves performance across both ingestion latency and query times.
@@ -106,7 +102,8 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
106
102
| order by max_ResponseLength desc
107
103
```
108
104
109
-
# [Azure Diagnostics](#tab/azure-diagnostics)
105
+
#### [Azure Diagnostics](#tab/azure-diagnostics)
106
+
110
107
```Kusto
111
108
let operationsbyUserAgent = AzureDiagnostics
112
109
| where Category=="DataPlaneRequests"
@@ -117,12 +114,14 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
117
114
| join kind=inner operationsbyUserAgent on activityId_g
118
115
| summarize max(responseLength_s1) by piiCommandText_s
119
116
| order by max_responseLength_s1 desc
120
-
```
117
+
```
118
+
121
119
---
122
120
123
121
### RU consumption by physical partition (across all replicas in the replica set)
124
122
125
-
# [Resource-specific](#tab/resource-specific)
123
+
#### [Resource-specific](#tab/resource-specific)
124
+
126
125
```Kusto
127
126
CDBPartitionKeyRUConsumption
128
127
| where TimeGenerated >= now(-1d)
@@ -133,7 +132,9 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
133
132
| summarize sum(todouble(RequestCharge)) by toint(PartitionKeyRangeId)
134
133
| render columnchart
135
134
```
136
-
# [Azure Diagnostics](#tab/azure-diagnostics)
135
+
136
+
#### [Azure Diagnostics](#tab/azure-diagnostics)
137
+
137
138
```Kusto
138
139
AzureDiagnostics
139
140
| where TimeGenerated >= now(-1d)
@@ -144,12 +145,14 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
144
145
//| where operationType_s == 'Create'
145
146
| summarize sum(todouble(requestCharge_s)) by toint(partitionKeyRangeId_s)
146
147
| render columnchart
147
-
```
148
+
```
149
+
148
150
---
149
151
150
152
### RU consumption by logical partition (across all replicas in the replica set)
151
153
152
-
# [Resource-specific](#tab/resource-specific)
154
+
#### [Resource-specific](#tab/resource-specific)
155
+
153
156
```Kusto
154
157
CDBPartitionKeyRUConsumption
155
158
| where TimeGenerated >= now(-1d)
@@ -160,7 +163,9 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
160
163
| summarize sum(todouble(RequestCharge)) by PartitionKey, PartitionKeyRangeId
161
164
| render columnchart
162
165
```
163
-
# [Azure Diagnostics](#tab/azure-diagnostics)
166
+
167
+
#### [Azure Diagnostics](#tab/azure-diagnostics)
168
+
164
169
```Kusto
165
170
AzureDiagnostics
166
171
| where TimeGenerated >= now(-1d)
@@ -172,8 +177,10 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
172
177
| summarize sum(todouble(requestCharge_s)) by partitionKey_s, partitionKeyRangeId_s
173
178
| render columnchart
174
179
```
180
+
175
181
---
176
182
177
-
## Next steps
178
-
* For more information on how to create diagnostic settings for Azure Cosmos DB, see [Create diagnostic settings](../monitor-resource-logs.md).
179
-
* For detailed information about how to create a diagnostic setting by using the Azure portal, the Azure CLI, or PowerShell, see [Create diagnostic settings to collect platform logs and metrics in Azure](../../azure-monitor/essentials/diagnostic-settings.md).
183
+
## Next steps
184
+
185
+
- For more information on how to create diagnostic settings for Azure Cosmos DB, see [Create diagnostic settings](../monitor-resource-logs.md).
186
+
- For detailed information about how to create a diagnostic setting by using the Azure portal, the Azure CLI, or PowerShell, see [Create diagnostic settings to collect platform logs and metrics in Azure](../../azure-monitor/essentials/diagnostic-settings.md).
For Azure Diagnostics tables, all data is written into one single table. Users specify which category they want to query. If you want to view the full-text query of your request, see [Monitor Azure Cosmos DB data by using diagnostic settings in Azure](../monitor-resource-logs.md#enable-full-text-query-for-logging-query-text) to learn how to enable this feature.
12
+
13
+
For [resource-specific tables](../monitor-resource-logs.md#create-diagnostic-settings), data is written into individual tables for each category of the resource. We recommend this mode because it:
14
+
15
+
- Makes it much easier to work with the data.
16
+
- Provides better discoverability of the schemas.
17
+
- Improves performance across both ingestion latency and query times.
0 commit comments