mgr_serveractions:
  query: |
    SELECT (
      SELECT COUNT(*)
        FROM rhnServerAction
        WHERE status = (
          SELECT id FROM rhnActionStatus WHERE name = 'Queued'
       )
    ) AS queued,
    (
      SELECT COUNT(*)
        FROM rhnServerAction
        WHERE status = (
          SELECT id FROM rhnActionStatus WHERE name = 'Picked Up'
       )
    ) AS picked_up,
    (
      SELECT COUNT(*)
        FROM rhnServerAction
        WHERE status = (
          SELECT id FROM rhnActionStatus WHERE name IN ('Completed')
       )
    ) AS completed,
    (
      SELECT COUNT(*)
        FROM rhnServerAction
        WHERE status = (
          SELECT id FROM rhnActionStatus WHERE name IN ('Failed')
       )
    ) AS failed;
  metrics:
    - queued:
        usage: "GAUGE"
        description: "Count of queued Actions"
    - picked_up:
        usage: "GAUGE"
        description: "Count of picked up Actions"
    - completed:
        usage: "COUNTER"
        description: "Count of completed Actions"
    - failed:
        usage: "COUNTER"
        description: "Count of failed Actions"
  salt_events:
    query: |
      SELECT COUNT(*)
        FROM suseSaltEvent
        AS salt_events_count;
    metrics:
      - salt_events_count:
          usage: "GAUGE"
          description: "Count of suse salt events"
