An Azure NoSQL database service for app development.
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:
- 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 • CatchCursorNotFoundin your code and retry/refresh the cursor - See “Manage Cursor Lifetimes” under “Handle query execution limits” in the vCore feature-limitations doc.
- 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:
- In the Azure portal open your Cosmos DB for MongoDB vCore cluster resource.
- Under Monitoring, click Diagnostic settings.
- Click + Add diagnostic setting.
- Give it a name, then under Logs check the category vCoreMongoRequests (and any other categories you want, like commands).
- Under Destination details, select Send to Log Analytics workspace and pick your workspace.
- 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
- Manage cursor lifetimes (avoid CursorNotFound): https://dori-uw-1.kuma-moon.com/azure/cosmos-db/mongodb/vcore/limits#handle-query-execution-limits
- How to monitor diagnostics logs for MongoDB vCore: https://dori-uw-1.kuma-moon.com/azure/cosmos-db/mongodb/vcore/how-to-monitor-diagnostics-logs
- VCoreMongoRequests table schema & sample queries: https://dori-uw-1.kuma-moon.com/azure/azure-monitor/reference/tables/vcoremongorequests
- Troubleshoot common issues in MongoDB vCore: https://dori-uw-1.kuma-moon.com/azure/cosmos-db/mongodb/vcore/troubleshoot-common-issues
Note: This content was drafted with the help of an AI system. Please verify the information before relying on it for decision-making.