---
templates:
  - name: pmm_mongodb_high_memory_usage
    version: 1
    summary: Memory used by MongoDB
    expr: |-
      100 / ((node_memory_MemTotal_bytes)
      / on(node_name) group_left(service_name) (mongodb_ss_mem_resident * 1024 * 1024))
      > [[ .threshold ]]
    params:
      - name: threshold
        summary: A percentage from configured maximum
        unit: "%"
        type: float
        range: [0, 100]
        value: 80
    for: 5m
    severity: warning
    annotations:
      summary: MongoDB high memory usage ({{ $labels.service_name }})
      description: |-
        {{ $value }}% of memory (more than [[ .threshold ]]%) is used
        by {{ $labels.service_name }} on {{ $labels.node_name }}.
