Scannedps metric clarification/alternative


using mongodb community edition + datadog integration, I am trying to simulate the “Scanned / Returned” metrics offered by Atlas.
I was trying to use
mongodb.metrics.queryexecutor.scannedps / mongodb.metrics.document.returnedps

But when re-reading the documentation, it seems to me that the scannedps metrics actually corresponds to amount of items read from the index, not from the collection. So this would be equivalent to IXSCAN, but as far as I understand, to achieve the metric provided by Atlas, I would need the COLLSCAN value.

Is there an alternative metric. Have I misunderstood the meaning of the metrics provided by Atlas?

hey Nuno,

Did you get the metrics formula required to simulate Query targeting metrics of Cloud Atlas on datadog?.

Welcome to the MongoDB Community @Priyesh_Patel!

I’m not familiar with how metrics are surfaced in Datadog, but looking at the description for scannedps and queryps in the link shared by @Nuno_Pinheiro, these appear to be aggregate activity metrics calculated by Datadog (both measures are per-second, not per-query).

The query targeting alert for Atlas is based on the keys and documents examined for a specific query, which is available via server logs and the executionStats in explain(). I’m not sure if Datadog collects detailed per-query metrics, but I would reach out to their support team for assistance.

Note: if you want metrics from both Atlas and Datadog and have an M10+ Atlas cluster, you have the option of configuring Datadog Integration.