In Harbor v2.2 and later you are able to enable metrics in your Harbor configuration file. Harbor metrics are available at based on your configured values.

Harbor metrics show data related to

  • Runtime information from the
  • Performance metrics about all API requests in core
  • Number of requests in flight in core
  • Some data related to business logic which already exist in the Harbor database

Metrics are exposed by several Harbor components: exporter, core, jobservice, and registry. In addition to runtime and performance data, these components also expose Harbor specific metrics. The following sections list the available Harbor metrics.

The exporter component metrics relate to your Harbor instance configuration and collects some data from the Harbor database. Metrics are available at <harbor_instance>:<metrics_port>/<metrics_path>.

The following are metrics pulled from the Docker distribution and are available at <harbor_instance>:<metrics_port>/<metrics_path>?comp=registry.

The following are metrics pulled from the Harbor Jobservice and are available at <harbor_instance>:<metrics_port>/<metrics_path>?comp=jobservice.

To begin accessing your Harbor instance’s metrics with Prometheus,

  1. Enable exposing metrics in your harbor.yml and set the port and path for metrics to be exposed on. Also see more about reconfiguring your Harbor instance.

  2. Configure your Prometheus config file to scrape Harbor metrics exposed at your configured port and path. Below is an example scrape config, see the Prometheus documentation for all available .

  3. Once you have configured your Prometheus server to collect your Harbor metrics, you can use Grafana to visualize your data. An is available in the Harbor repo to help you get started visualizing Harbor metrics.

You can also use Prometheus to collect metrics from a Harbor instance deployed in your Kubernetes cluster. You should already have and set up to pull metrics from your cluster.

  1. Create a ServiceMonitor in Prometheus for Harbor.

    1. apiVersion: monitoring.coreos.com/v1
    2. kind: ServiceMonitor
    3. name: harbor
    4. labels:
    5. app: harbor
    6. spec:
    7. selector:
    8. matchLabels:
    9. app: harbor
    10. endpoints:

Prometheus should now show your Harbor instance’s metrics.