Skip to content

Commit a3de36d

Browse files
authored
Merge pull request #217586 from seesharprun/cosmos-enable-full-text-query
Cosmos DB | Added instructions to enable full-text query using Azure CLI
2 parents c234deb + 4a05b5c commit a3de36d

13 files changed

+586
-419
lines changed

articles/cosmos-db/.openpublishing.redirection.cosmos-db.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3105,6 +3105,11 @@
31053105
"redirect_url": "/azure/cosmos-db/advanced-queries",
31063106
"redirect_document_id": true
31073107
},
3108+
{
3109+
"source_path_from_root": "/articles/cosmos-db/advanced-queries.md",
3110+
"redirect_url": "/azure/cosmos-db/nosql/diagnostic-queries",
3111+
"redirect_document_id": true
3112+
},
31083113
{
31093114
"source_path_from_root": "/articles/cosmos-db/cosmos-db-reserved-capacity.md",
31103115
"redirect_url": "/azure/cosmos-db/reserved-capacity",

articles/cosmos-db/cassandra/TOC.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,6 @@
352352
href: error-codes-solution.md
353353
- name: Monitor and debug with insights in API for Apache Cassandra
354354
href: monitor-insights.md
355-
- name: Advanced diagnostics for API for Apache Cassandra
356-
href: diagnostic-queries.md
357355
- name: Manage Azure Cosmos DB resources
358356
items:
359357
- name: Manage an Azure Cosmos DB account
@@ -432,10 +430,10 @@
432430
href: ../monitor-resource-logs.md
433431
- name: Troubleshoot issues using basic queries
434432
href: ../monitor-logs-basic-queries.md
435-
- name: Troubleshoot issues using advanced queries
436-
href: ../advanced-queries.md
437433
- name: Audit control plane logs
438434
href: ../audit-control-plane-logs.md
435+
- name: Troubleshoot issues with advanced diagnostics queries
436+
href: diagnostic-queries.md
439437
- name: Configure alerts
440438
items:
441439
- name: Create alert on metrics

articles/cosmos-db/cassandra/diagnostic-queries.md

Lines changed: 153 additions & 148 deletions
Large diffs are not rendered by default.

articles/cosmos-db/gremlin/TOC.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,6 @@
274274
href: headers.md
275275
- name: Limits
276276
href: limits.md
277-
- name: Monitor using Diagnostics Logs
278-
href: diagnostic-queries.md
279277
- name: Use developer tools
280278
items:
281279
- name: Develop locally with emulator
@@ -398,10 +396,10 @@
398396
href: ../monitor-resource-logs.md
399397
- name: Troubleshoot issues using basic queries
400398
href: ../monitor-logs-basic-queries.md
401-
- name: Troubleshoot issues using advanced queries
402-
href: ../advanced-queries.md
403399
- name: Audit control plane logs
404400
href: ../audit-control-plane-logs.md
401+
- name: Troubleshoot issues with advanced diagnostics queries
402+
href: diagnostic-queries.md
405403
- name: Configure alerts
406404
items:
407405
- name: Create alert on metrics
Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,32 @@
11
---
2-
title: Troubleshoot issues with advanced diagnostics queries for API for Gremlin
3-
titleSuffix: Azure Cosmos DB
4-
description: Learn how to query diagnostics logs for troubleshooting data stored in Azure Cosmos DB for the API for Gremlin.
5-
author: StefArroyo
6-
services: cosmos-db
2+
title: Troubleshoot issues with advanced diagnostics queries with Azure Cosmos DB for Apache Gremlin
3+
description: Learn how to query diagnostics logs for troubleshooting data stored in Azure Cosmos DB for Apache Gremlin.
4+
author: seesharprun
5+
ms.author: sidandrews
6+
ms.reviewer: esarroyo
77
ms.service: cosmos-db
88
ms.custom: ignite-2022
99
ms.topic: how-to
10-
ms.date: 06/12/2021
11-
ms.author: esarroyo
10+
ms.date: 11/08/2022
1211
---
1312

14-
# Troubleshoot issues with advanced diagnostics queries for the API for Gremlin
13+
# Troubleshoot issues with advanced diagnostics queries with Azure Cosmos DB for Apache Gremlin
1514

1615
[!INCLUDE[NoSQL, MongoDB, Cassandra, Gremlin](../includes/appliesto-nosql-mongodb-cassandra-gremlin.md)]
1716

18-
> [!div class="op_single_selector"]
19-
> * [API for NoSQL](../advanced-queries.md)
20-
> * [API for MongoDB](../mongodb/diagnostic-queries.md)
21-
> * [API for Cassandra](../cassandra/diagnostic-queries.md)
22-
> * [API for Gremlin](diagnostic-queries.md)
23-
>
17+
[!INCLUDE[Diagnostic queries selector](../includes/diagnostic-queries-selector.md)]
2418

2519
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.
2620

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.
21+
[!INCLUDE[Diagnostic tables](../includes/diagnostics-tables.md)]
3422

3523
## Common queries
24+
3625
Common queries are shown in the resource-specific and Azure Diagnostics tables.
3726

3827
### Top N(10) Request Unit (RU) consuming requests or queries in a specific time frame
3928

40-
# [Resource-specific](#tab/resource-specific)
29+
#### [Resource-specific](#tab/resource-specific)
4130

4231
```Kusto
4332
let topRequestsByRUcharge = CDBDataPlaneRequests
@@ -50,7 +39,8 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
5039
| order by RequestCharge desc
5140
| take 10
5241
```
53-
# [Azure Diagnostics](#tab/azure-diagnostics)
42+
43+
#### [Azure Diagnostics](#tab/azure-diagnostics)
5444

5545
```Kusto
5646
let topRequestsByRUcharge = AzureDiagnostics
@@ -63,12 +53,14 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
6353
| project databasename_s , collectionname_s , piiCommandText_s , requestCharge_s, TimeGenerated
6454
| order by requestCharge_s desc
6555
| take 10
66-
```
56+
```
57+
6758
---
6859

69-
### Requests throttled (statusCode = 429) in a specific time window
60+
### Requests throttled (statusCode = 429) in a specific time window
61+
62+
#### [Resource-specific](#tab/resource-specific)
7063

71-
# [Resource-specific](#tab/resource-specific)
7264
```Kusto
7365
let throttledRequests = CDBDataPlaneRequests
7466
| where StatusCode == "429"
@@ -78,7 +70,9 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
7870
| join kind=inner throttledRequests on ActivityId
7971
| project DatabaseName , CollectionName , PIICommandText , OperationName, TimeGenerated
8072
```
81-
# [Azure Diagnostics](#tab/azure-diagnostics)
73+
74+
#### [Azure Diagnostics](#tab/azure-diagnostics)
75+
8276
```Kusto
8377
let throttledRequests = AzureDiagnostics
8478
| where Category == "DataPlaneRequests"
@@ -89,12 +83,14 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
8983
| project piiCommandText_s, activityId_g, databasename_s , collectionname_s
9084
| join kind=inner throttledRequests on activityId_g
9185
| project databasename_s , collectionname_s , piiCommandText_s , OperationName, TimeGenerated
92-
```
86+
```
87+
9388
---
9489

9590
### Queries with large response lengths (payload size of the server response)
9691

97-
# [Resource-specific](#tab/resource-specific)
92+
#### [Resource-specific](#tab/resource-specific)
93+
9894
```Kusto
9995
let operationsbyUserAgent = CDBDataPlaneRequests
10096
| project OperationName, DurationMs, RequestCharge, ResponseLength, ActivityId;
@@ -106,7 +102,8 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
106102
| order by max_ResponseLength desc
107103
```
108104

109-
# [Azure Diagnostics](#tab/azure-diagnostics)
105+
#### [Azure Diagnostics](#tab/azure-diagnostics)
106+
110107
```Kusto
111108
let operationsbyUserAgent = AzureDiagnostics
112109
| where Category=="DataPlaneRequests"
@@ -117,12 +114,14 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
117114
| join kind=inner operationsbyUserAgent on activityId_g
118115
| summarize max(responseLength_s1) by piiCommandText_s
119116
| order by max_responseLength_s1 desc
120-
```
117+
```
118+
121119
---
122120

123121
### RU consumption by physical partition (across all replicas in the replica set)
124122

125-
# [Resource-specific](#tab/resource-specific)
123+
#### [Resource-specific](#tab/resource-specific)
124+
126125
```Kusto
127126
CDBPartitionKeyRUConsumption
128127
| where TimeGenerated >= now(-1d)
@@ -133,7 +132,9 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
133132
| summarize sum(todouble(RequestCharge)) by toint(PartitionKeyRangeId)
134133
| render columnchart
135134
```
136-
# [Azure Diagnostics](#tab/azure-diagnostics)
135+
136+
#### [Azure Diagnostics](#tab/azure-diagnostics)
137+
137138
```Kusto
138139
AzureDiagnostics
139140
| where TimeGenerated >= now(-1d)
@@ -144,12 +145,14 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
144145
//| where operationType_s == 'Create'
145146
| summarize sum(todouble(requestCharge_s)) by toint(partitionKeyRangeId_s)
146147
| render columnchart
147-
```
148+
```
149+
148150
---
149151

150152
### RU consumption by logical partition (across all replicas in the replica set)
151153

152-
# [Resource-specific](#tab/resource-specific)
154+
#### [Resource-specific](#tab/resource-specific)
155+
153156
```Kusto
154157
CDBPartitionKeyRUConsumption
155158
| where TimeGenerated >= now(-1d)
@@ -160,7 +163,9 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
160163
| summarize sum(todouble(RequestCharge)) by PartitionKey, PartitionKeyRangeId
161164
| render columnchart
162165
```
163-
# [Azure Diagnostics](#tab/azure-diagnostics)
166+
167+
#### [Azure Diagnostics](#tab/azure-diagnostics)
168+
164169
```Kusto
165170
AzureDiagnostics
166171
| where TimeGenerated >= now(-1d)
@@ -172,8 +177,10 @@ Common queries are shown in the resource-specific and Azure Diagnostics tables.
172177
| summarize sum(todouble(requestCharge_s)) by partitionKey_s, partitionKeyRangeId_s
173178
| render columnchart
174179
```
180+
175181
---
176182

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).
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
author: seesharprun
3+
ms.author: sidandrews
4+
ms.reviewer: esarroyo
5+
ms.service: cosmos-db
6+
ms.topic: include
7+
ms.date: 11/08/2022
8+
ms.custom: include file
9+
---
10+
11+
> [!div class="op_single_selector"]
12+
>
13+
> * [API for NoSQL](../nosql/diagnostic-queries.md)
14+
> * [API for MongoDB](../mongodb/diagnostic-queries.md)
15+
> * [API for Apache Cassandra](../cassandra/diagnostic-queries.md)
16+
> * [API for Apache Gremlin](../gremlin/diagnostic-queries.md)
17+
>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
author: seesharprun
3+
ms.author: sidandrews
4+
ms.reviewer: esarroyo
5+
ms.service: cosmos-db
6+
ms.topic: include
7+
ms.date: 11/08/2022
8+
ms.custom: include file
9+
---
10+
11+
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.

articles/cosmos-db/mongodb/TOC.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@
302302
href: connect-using-mongochef.md
303303
- name: Connect using Compass
304304
href: connect-using-compass.md
305-
- name: Connect using Robo 3T
305+
- name: Connect using Studio 3T
306306
href: connect-using-robomongo.md
307307
- name: Connect using Mongoose
308308
href: connect-using-mongoose.md
@@ -425,8 +425,6 @@
425425
href: error-codes-solutions.md
426426
- name: Troubleshoot query performance
427427
href: troubleshoot-query-performance.md
428-
- name: Troubleshoot API for MongoDB queries with diagnostics
429-
href: diagnostic-queries.md
430428
- name: Prevent rate-limiting errors
431429
href: prevent-rate-limiting-errors.md
432430
- name: Optimize query and storage costs when upgrading
@@ -520,10 +518,10 @@
520518
href: ../monitor-resource-logs.md
521519
- name: Troubleshoot issues using basic queries
522520
href: ../monitor-logs-basic-queries.md
523-
- name: Troubleshoot issues using advanced queries
524-
href: ../advanced-queries.md
525521
- name: Audit control plane logs
526522
href: ../audit-control-plane-logs.md
523+
- name: Troubleshoot issues with advanced diagnostics queries
524+
href: diagnostic-queries.md
527525
- name: Configure alerts
528526
items:
529527
- name: Create alert on metrics

0 commit comments

Comments
 (0)