The Ansible Operator comes with three internal metrics that provide an insight to the frequency and time of operator reconciliations. These metrics can be scraped by a Prometheus instance or any other openmetrics system. To publish operator metrics and scrape them with an openmetrics system such as Prometheus, view Kubebuilder documentation on publishing metrics.

The default metrics recorded in Operator SDK are collected in a histogram.

The following three metrics are derived from the histogram:

  1. ansible_operator_reconciles_bucket - Each bucket in the histogram counts the number of reconciliations that have a period (in seconds) less than or equal to the upper limit of the bucket.
  2. ansible_operator_reconciles_count - The total number of reconciliations that have occurred up to that instance of time while running an Ansible operator.
  3. ansible_operator_reconciles_sum - The cumulative amount of time (in seconds) of all reconciliations that have occurred up to that instance of time while running an Ansible operator.

These metrics can be queried in the Prometheus UI.

Screen Shot 2021-06-24 at 2 10 28 PM

Last modified April 9, 2022: all: fix some typos (#5578) (e2303705)