##
## Statistics and metrics
##

# Dovecot supports gathering statistics from events.
# Currently there are no statistics logged by default, and therefore they must
# be explicitly added using the metric configuration blocks.
#
# Unlike old stats, the new statistics do not require any plugins loaded.
#
# See https://doc.dovecot.org/latest/core/config/statistics.html for details

##
## Example metrics
##

#metric auth_success {
#  filter = (event=auth_request_finished AND success=yes)
#}
#
#metric auth_failure {
#  filter = (event=auth_request_finished AND NOT success=yes)
## See exporter config later in this file
## can be used to replace auth_verbose=yes
#  exporter = log
#}
#
#metric imap_command {
#  filter = event=imap_command_finished
#  group_by cmd_name {
#    method discrete {
#    }
#  }
#  group_by tagged_reply_state {
#    method discrete {
#    }
#  }
#}
#
#metric smtp_command {
#  filter = event=smtp_server_command_finished and protocol=submission
#  group_by cmd_name {
#     method discrete {
#    }
#  }
#  group_by status_code {
#     method discrete {
#    }
#  }
#  group_by duration {
#     method exponential {
#       base = 10
#       min_magnitude = 1
#       max_magnitude = 5
#    }
#  }
#}
#
#metric lmtp_command {
#  filter = event=smtp_server_command_finished and protocol=lmtp
#  group_by cmd_name {
#     method discrete {
#    }
#  }
#  group_by status_code {
#     method discrete {
#    }
#  }
#  group_by duration {
#     method exponential {
#       base = 10
#       min_magnitude = 1
#       max_magnitude = 5
#    }
#  }
#}
#
#metric mail_delivery {
#  filter = event=mail_delivery_finished
#  group_by duration {
#     method exponential {
#       base = 10
#       min_magnitude = 1
#       max_magnitude = 5
#     }
#  }
#}

##
## Prometheus
##

# To allow access to statistics with Prometheus, enable http listener
# on stats process. Stats will be available on /metrics path.
#
# See https://doc.dovecot.org/latest/core/config/statistics.html#openmetrics for more
# details.

#service stats {
#  inet_listener http {
#    port = 9900
#  }
#}

##
## Event exporting
##

# You can also export individual events.
#
# See https://doc.dovecot.org/configuration_manual/event_export/ for more
# details.

#event_exporter log {
#  format = json
#  time_format = rfc3339
#}
#
#metric imap_commands {
#  exporter = log
#  filter = event=imap_command_finished
#}
