`Host has index suggestions` alerts on oplog queries (Secondary node)

What should I do if I’m getting Host has index suggestions alerts for monitoring aggregation I am running against the oplog?
As I know, it will never be going to use indexes because this is the nature of this collection.
How can I avoid these atlas alerts being fired?

Thanks.

Hi @Shay_I and welcome to the community!!

The log alerts Host has index suggestions can be avoided if the Performance Advisor is disabled for the specific cluster. Please follow the documentation for the same.

May I ask why you are querying the oplog to begin with? The oplog is for MongoDB internal use, and may change without notice (since it’s not for general usage). For these type of purposes, it’s generally best to use Change Stream which is a lot more configurable than querying the oplog.
For example, change streams can monitor a single collection, a server, or a whole sharded cluster. You can also manipulate the output of the change stream using an aggregation pipeline. This is not possible to do using the oplog.

However if your use case does not allow the use of change streams, do you mind sharing it?

The Performance Advisor monitors the slow query and help in improving the performance.

Also, the Index suggestion in performance advisor help in performance improvement which the suggested index would bring. Hence, disabling the alerts would also result in disabling of other related alerts.

Please let us know if you have any further questions.

Thanks
Aasawari

1 Like

Thank you @Aasawari,

I am using oplog queries, mainly for monitoring whether the change stream is working fine or becoming idle,
for example: if I see the oplog contains a newer data from the last processed change and it has past a significant amount of time - I can get to the conclusion that something is wrong with the cursor and usually I perform a restart in that case.

do you have maybe a better way to monitor change stream health? and keep the change stream running (forever)?

Hi @Shay_I and welcome to the MongoDB community forum!!

It would be very helpful if you could share example for your use case which would help me understand the issue further.

Thanks
Aasawari