Email alerts configuration for Mongodb

Hi All,

Am trying to configure emails alerts for critical parameters like service down ,replication lag and connections for now.
For Service down I used the default alert rule templates it worked. But for replication lag and connections I tried to configure alert and it gives me alert with data dource not found.
Alert email sample :
Firing: 1 alert for alertname=DatasourceNoData grafana_folder=MongoDB
Firing DatasourceNoData
Value:
Labels:

  • alertname: DatasourceNoData
  • datasource_uid: PA58DA793C7250F1B
  • grafana_folder: MongoDB
  • ref_id: A
  • rulename: MongoDB_Connections

Condition used for Alert :
For monitoring connections : mongodb_mongod_connections > 100
For replication lag : mongodb_repl_lag_seconds > 30

the default template for service down has the below condition which is working properly.
up{service_type=“mongodb”} == bool 0 and on() (up{service_type=“mongodb”} == bool 0)[6s]

Can somehelp help to correct the datasource no data issue for configuring and triggering alert emais.

Thanks & Regards,
Dhivya.K