Azure Cosmos DB: HTTP 400 in Application Insights

Onkel Toob

We're using Application Insights within an Azure App Service (some Web API) which queries an Azure Cosmos DB in .NET Core 2.1. The querying is done using a DocumentClient object from the Nuget package Microsoft.Azure.DocumentDB.Core 1.10.0, and on this client we're calling the CreateDocumentQuery<T>(Uri, FeedOptions) extension method.

Now from a user's perspective the querying seems to work fine. However, looking at Application Insights we are presented with a rather large number of dependency failures concerning the Cosmos DB. I'll try to visualize what I'm seeing in the Azure portal:

--------------------------------------------------------------------------------------------------
| Event                                                                        | Res. | Duration |
--------------------------------------------------------------------------------------------------
| ▼ web-api-resource-name POST api-endpoint-name                               | 200  | 149.1 ms |
--------------------------------------------------------------------------------------------------
|   AZURE DOCUMENTDB cosmosdb-name.documents.azure.com | Create/query document | 400  |     4 ms |
--------------------------------------------------------------------------------------------------
|   AZURE DOCUMENTDB cosmosdb-name.documents.azure.com | Query documents       | 200  |     7 ms |
--------------------------------------------------------------------------------------------------
|   AZURE DOCUMENTDB cosmosdb-name.documents.azure.com | Create/query document | 400  |     4 ms |
--------------------------------------------------------------------------------------------------
|   AZURE DOCUMENTDB cosmosdb-name.documents.azure.com | Query documents       | 200  |     5 ms |
--------------------------------------------------------------------------------------------------
|   AZURE DOCUMENTDB cosmosdb-name.documents.azure.com | Create/query document | 400  |     4 ms |
--------------------------------------------------------------------------------------------------
|   AZURE DOCUMENTDB cosmosdb-name.documents.azure.com | Query documents       | 200  |     6 ms |
--------------------------------------------------------------------------------------------------
|   AZURE DOCUMENTDB cosmosdb-name.documents.azure.com | Query documents       | 200  |     6 ms |
--------------------------------------------------------------------------------------------------
|   AZURE DOCUMENTDB cosmosdb-name.documents.azure.com | Query documents       | 200  |    12 ms |
--------------------------------------------------------------------------------------------------

The lines containing the HTTP 400 results are highlighted in red within the Azure portal and are obviously the ones displaying the dependency failures. Now since the overall request seems to result in a HTTP 200 and no errors are returned to the web api, I can only think of this being some internal Cosmos DB querying. And because there are multiple entries for a single request I'm guessing this could be related to some retry policy.

However, since I can't seem to find any further information on the erroneous requests: Can anyone shed some light on this issue?

UPDATE: Here's a screenshot of the Application Insights view within the Azure portal. Slightly different duration values, but same problem.

Screenshot of Application Insights view

Unfortunately, the column containing the Create/query document and Query documents texts is hidden here, since in the Azure portal you'd have to scroll horizontally to view that information.

Thanks in advance, Tobi

Kiran Kolli

You can ignore 400's as long as query succeeds. They are expected.

Cosmos service will execute query against a single server partition (or Shard). Cross partition queries are expected to be processed by SDK and server rejects with 400. You can control concurrency of SDK execution through FeedOptions.MaxDegreeOfParallism.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Azure Cosmos DB:ApplicationInsightsのHTTP400

分類Dev

Azure Cosmos DB-Application Insightsにエラーをスローせずに、アイテムが存在しないかどうかを確認します

分類Dev

Creating application insights with azure cli

分類Dev

Azure Cosmos DB CONTAINSの構文

分類Dev

Azure Cosmos DB CONTAINSの構文

分類Dev

How to structure relationships in Azure Cosmos DB?

分類Dev

Azure Cosmos DB, Delete IDS (definitely exist)

分類Dev

Azure Application Insights - Disable Logging Page Views

分類Dev

Set up Azure Application Insights for local environment

分類Dev

Azure Application Insights and Web Site projects

分類Dev

Azure - Configure disaster RECOVERY and automatic failover for Azure Cosmos DB?

分類Dev

cosmos db, generate authentication key on client for Azure Table endpoint

分類Dev

Azure Cosmos DB - 'RequestDisallowedByPolicy' error while creating container

分類Dev

SELECT rows between two dates in azure cosmos db

分類Dev

How to check what service is writing to Azure Cosmos Db?

分類Dev

Disabling dependency logging for Application insights on Azure app service (Web app)

分類Dev

Azure SDKでのAzure Cosmos DB Gremlin / Tinkerpopトークン認証

分類Dev

async query in cosmos db

分類Dev

OData and Cosmos DB

分類Dev

Cosmos DB + pyDocumentDB + Databricks

分類Dev

Azure Cosmos Db、行の後に選択しますか?

分類Dev

Exception: cross partition query can not be directly served in Azure Cosmos DB query

分類Dev

How Azure Cosmos Db decides to reject a request when it exceeds reserved RU?

分類Dev

Azure Cosmos DBでJSONを詳細に検索する方法は?

分類Dev

Azure Cosmos DB、IDSの削除(間違いなく存在します)

分類Dev

How do conflicts affect the Azure Cosmos DB Change Feed in multi-master replication scenarios?

分類Dev

Application Insights Dependency types

分類Dev

Solr to Application Insights

分類Dev

Azure Cosmos settings history

Related 関連記事

  1. 1

    Azure Cosmos DB:ApplicationInsightsのHTTP400

  2. 2

    Azure Cosmos DB-Application Insightsにエラーをスローせずに、アイテムが存在しないかどうかを確認します

  3. 3

    Creating application insights with azure cli

  4. 4

    Azure Cosmos DB CONTAINSの構文

  5. 5

    Azure Cosmos DB CONTAINSの構文

  6. 6

    How to structure relationships in Azure Cosmos DB?

  7. 7

    Azure Cosmos DB, Delete IDS (definitely exist)

  8. 8

    Azure Application Insights - Disable Logging Page Views

  9. 9

    Set up Azure Application Insights for local environment

  10. 10

    Azure Application Insights and Web Site projects

  11. 11

    Azure - Configure disaster RECOVERY and automatic failover for Azure Cosmos DB?

  12. 12

    cosmos db, generate authentication key on client for Azure Table endpoint

  13. 13

    Azure Cosmos DB - 'RequestDisallowedByPolicy' error while creating container

  14. 14

    SELECT rows between two dates in azure cosmos db

  15. 15

    How to check what service is writing to Azure Cosmos Db?

  16. 16

    Disabling dependency logging for Application insights on Azure app service (Web app)

  17. 17

    Azure SDKでのAzure Cosmos DB Gremlin / Tinkerpopトークン認証

  18. 18

    async query in cosmos db

  19. 19

    OData and Cosmos DB

  20. 20

    Cosmos DB + pyDocumentDB + Databricks

  21. 21

    Azure Cosmos Db、行の後に選択しますか?

  22. 22

    Exception: cross partition query can not be directly served in Azure Cosmos DB query

  23. 23

    How Azure Cosmos Db decides to reject a request when it exceeds reserved RU?

  24. 24

    Azure Cosmos DBでJSONを詳細に検索する方法は?

  25. 25

    Azure Cosmos DB、IDSの削除(間違いなく存在します)

  26. 26

    How do conflicts affect the Azure Cosmos DB Change Feed in multi-master replication scenarios?

  27. 27

    Application Insights Dependency types

  28. 28

    Solr to Application Insights

  29. 29

    Azure Cosmos settings history

ホットタグ

アーカイブ