groups: - name: MongoDB Alerts rules: - alert: mongodb_Down expr: mongodb_up{job="Mongodb-Exporter"} !=1 for: 10s labels: severity: critical annotations: summary: "Mongo node is down(instance {{ $labels.instance }})" description: "MongoDB Node :{{ $labels.instance }} down" - alert: mongodb_ReplicaLag expr: mongodb_mongod_replset_member_replication_lag{job="Mongodb-Exporter"} > 20 for: 10s labels: severity: critical annotations: summary: "MongoDB replication lag for (instance {{ $labels.instance }})" description: "MongoDB replication lag for {{ $labels.instance }} is :{{ $value }}" - alert: mongodb_CurrentConnection expr: mongodb_connections{state="current",job="Mongodb-Exporter"} > 750 for: 10s labels: severity: critical annotations: summary: "MongoDB current connection for (instance {{ $labels.instance }}) is high." description: "MongoDB Current Connections for {{ $labels.instance }} is :{{ $value }}" - alert: mongodb_Members expr: mongodb_mongod_replset_number_of_members{job="Mongodb-Exporter"} < 3 for: 10s labels: severity: critical annotations: summary: "MongoDB replica member count (instance {{ $labels.instance }})" description: "MongoDB replica members are less than 3 for the service" - alert: mongodb_UsedMemory_Invoice expr: (mongodb_memory{type="resident"} / 1024 ) > 75 for: 10s labels: severity: critical annotations: summary: "MongoDB UsedMemory is High (instance {{ $labels.instance }})" description: "MongoDB UsedMemory for {{ $labels.instance }} is :{{ $value }}"