Share via

VCoreMongoRequests not showing any logging?

Levi Gerrits 0 Reputation points
2026-04-03T09:44:09.2733333+00:00

My team is using Azure DocumentDB (with MongoDB compatibility) resources (vCore, not RU) for our environments for CQRS projection. We've recently had some incidents where one of our Spring Boot applications was suddenly receiving CursorNotFound exceptions to all of our requests to the DocumentDB instances. The problem was luckily resolved by restarting the offending Spring Boot application.

However, when investigating why this issue occured we tried looking at the logging of the DocumentDB instances where the issue occured, but we could not see any logging in the VCoreMongoRequests table. We tried turning on the Diagnostic Settings in order to send logging to our Log Analytics Workspaces, but this also resulted in no logging being sent, even when we definitely know that there was traffic to the DocumentDB instances and queries being executed.

So our questions are:

  1. Are the sudden CursorNotFound exceptions a known problem when using Azure DocumentDB with Spring Boot (spring-data-mongodb)?
  2. How do I turn on the logging for our DocumentDB instances?

Spring-data-mongodb version: 4.3.13

Azure DocumentDB Mongo version: 6.0

Azure Cosmos DB
Azure Cosmos DB

An Azure NoSQL database service for app development.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Pilladi Padma Sai Manisha 6,430 Reputation points Microsoft External Staff Moderator
    2026-04-03T22:33:24.4166667+00:00

    Hi Levi Gerrits,

    it looks like you’re hitting two separate areas: cursor timeouts on your Spring Data MongoDB driver and missing diagnostic logs on your vCore cluster. Here’s a rundown on each:

    1. CursorNotFound exceptions
    • MongoDB cursors on Azure Cosmos DB for MongoDB vCore have a 10-minute idle timeout by design. If your Spring Boot app keeps a cursor open but idle for longer than that, Cosmos DB will clean it up and your driver will see CursorNotFound.
    • This isn’t a bug in Spring Data or Cosmos DB—it’s a documented service limit. To avoid it you can: • Use the “noCursorTimeout” flag on your queries (e.g. collection.find().noCursorTimeout(true)) • Break long-running scans into smaller batches • Catch CursorNotFound in your code and retry/refresh the cursor
    • See “Manage Cursor Lifetimes” under “Handle query execution limits” in the vCore feature-limitations doc.
    1. Enabling vCoreMongoRequests logging

    By default you won’t see any entries until you explicitly turn on the vCore resource logs for your cluster. Here’s how:

    1. In the Azure portal open your Cosmos DB for MongoDB vCore cluster resource.
    2. Under Monitoring, click Diagnostic settings.
    3. Click + Add diagnostic setting.
    4. Give it a name, then under Logs check the category vCoreMongoRequests (and any other categories you want, like commands).
    5. Under Destination details, select Send to Log Analytics workspace and pick your workspace.
    6. Click Save.

    Wait 5–10 minutes, then go to your Log Analytics workspace and run a query such as:

    
    VCoreMongoRequests
    
    | where TimeGenerated > ago(1h)
    
    | project TimeGenerated, OperationName, DatabaseName, CollectionName, ErrorCode
    
    | order by TimeGenerated desc
    
    

    You should now see all your data-plane requests.

    If you still don’t see logs:

    • Make sure you selected the vCoreMongoRequests log category (not the RU-based “MongoRequests”).
    • Verify your Log Analytics workspace is in a supported region and your cluster has permission to write to it.
    • Confirm you’re looking at the right time range.

    Let me know if this gets you unblocked or if you need more help!

    References

    Note: This content was drafted with the help of an AI system. Please verify the information before relying on it for decision-making.


  2. Q&A Assist
    2026-04-03T09:44:28.8933333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more
    1. CursorNotFound with Spring Data MongoDB and Azure DocumentDB

    The provided context does not document CursorNotFound as a known or documented interoperability issue between Azure DocumentDB (MongoDB compatibility) and Spring Data MongoDB. The MongoDB compatibility guidance states that Azure DocumentDB implements the MongoDB wire protocol and that most drivers and tools work, but also notes that there can be small differences in certain administrative commands, server-side extensions, and edge-case behaviors, and recommends testing workloads and consulting the compatibility matrix for unsupported commands or behaviors.

    From the context:

    • Azure DocumentDB “fully implements the MongoDB wire protocol for feature compatibility” and is intended to run “nearly all MongoDB workloads without any application changes,” but
    • Some MongoDB features are unsupported or limited, and certain administrative operations are abstracted or restricted.

    The context does not list CursorNotFound as a specific known issue, nor does it provide a Spring Boot–specific workaround. Any deeper analysis of the CursorNotFound behavior in this scenario would require information beyond the provided documentation.

    1. Enabling and verifying logging for Azure DocumentDB (Mongo vCore)

    For Azure DocumentDB / Azure Cosmos DB for MongoDB (vCore), there are two relevant log tables in Azure Monitor, depending on the resource type:

    • For vCore Mongo clusters (microsoft.documentdb/mongoclusters):
      • Resource log category: vCoreMongoRequests
      • Log table: AzureDiagnostics
      • Dedicated data-plane table: VCoreMongoRequests
    • For Mongo API accounts on the classic Azure Cosmos DB model (microsoft.documentdb/databaseaccounts):
      • Data-plane table: CDBMongoRequests

    From the monitoring reference:

    • VCoreMongoRequests is a table that “details data plane requests for MongoDB (vCore).”
    • For microsoft.documentdb/mongoclusters, the vCoreMongoRequests category writes into the AzureDiagnostics table and does not support basic log plan or ingestion-time transformations.
    • CDBMongoRequests is a table that “details data plane operations, specifically for Mongo API accounts,” and supports the basic log plan and ingestion-time DCR.

    To turn on and use logging for vCore Mongo clusters:

    1. Ensure diagnostic settings are configured on the correct resource type
      • The resource type for vCore Mongo is microsoft.documentdb/mongoclusters.
      • Diagnostic settings must be created on the Mongo cluster resource (not on unrelated resources) and must include the vCoreMongoRequests category.
    2. Configure Diagnostic Settings to send logs to Log Analytics
      • In Azure Monitor / resource Diagnostic settings for the Mongo cluster, select:
        • Category: vCoreMongoRequests (this is the resource log category for Mongo vCore requests).
        • Destination: the target Log Analytics workspace.
      • Once enabled, the logs for this category will be written into the AzureDiagnostics table (as per the monitoring reference), and the data-plane–specific view is available in the VCoreMongoRequests table.
    3. Query the correct tables
      • For vCore Mongo clusters, use:
        • VCoreMongoRequests for data-plane request analytics, for example:
                 VCoreMongoRequests
                 // optional time filter
                 // | where TimeGenerated between (StartTime .. EndTime)
                 // optional resource filter
                 // | where _ResourceId == "/subscriptions/.../resourcegroups/.../providers/microsoft.documentdb/mongoclusters/<cluster-name>"
                 | summarize percentile(DurationMs, 99) by bin(TimeGenerated, 1h), OperationName
          
        • Or query AzureDiagnostics filtered by the vCoreMongoRequests category if needed.
    4. Confirm that the workspace and plan support the logs
      • VCoreMongoRequests supports basic log and lake-only ingestion.
      • Ensure the Log Analytics workspace and any data collection rules are configured to ingest this table type.

    If no data appears in VCoreMongoRequests despite confirmed traffic and correctly configured diagnostic settings on the microsoft.documentdb/mongoclusters resource with the vCoreMongoRequests category enabled, further investigation would require service-side checks that are outside the scope of the provided documentation.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.