Sign inSign up

c4po/harbor-exporter

By c4po

•Updated over 5 years ago

prometheus exporter for harbor repository

Image
0

500K+

c4po/harbor-exporter repository overview

⁠Prometheus exporter for Harbor

CircleCI

Export harbor service health to Prometheus.

To run it:

make build
./harbor_exporter [flags]

To build a Docker image:

make dockerbuild

⁠Exported Metrics

MetricMeaningLabels
harbor_up
harbor_scans_completed
harbor_scans_total
harbor_scans_requester
harbor_project_count_totaltype=[private_project, public_project, total_project]
harbor_repo_count_totaltype=[private_repo, public_repo, total_repo]
harbor_quotas_count_totalrepo_id, repo_name, type=[hard, used]
harbor_quotas_size_bytesrepo_id, repo_name, type=[hard, used]
harbor_system_volumes_bytesstorage=[free, total]
harbor_repositories_pull_totalrepo_id, repo_name
harbor_repositories_star_totalrepo_id, repo_name
harbor_repositories_tags_totalrepo_id, repo_name
harbor_replication_statusstatus of the last execution of this replication policy: Succeed = 1, any other status = 0repl_pol_name
harbor_replication_tasksnumber of replication tasks, with various results, in the latest execution of this replication policyrepl_pol_name, result=[failed, succeed, in_progress, stopped]

Note: when the harbor.instance flag is used, each metric name starts with harbor_instancename_ instead of just harbor_.

⁠Flags
./harbor_exporter --help
⁠Environment variables

Below environment variables can be used instead of the corresponding flags. Easy when running the exporter in a container.

HARBOR_INSTANCE
HARBOR_URI
HARBOR_USERNAME
HARBOR_PASSWORD

⁠Using Docker

You can deploy this exporter using the Docker image.

For example:

docker pull c4po/harbor-exporter

docker run -d -p 9107:9107 -e HARBOR_USERNAME=admin -e HARBOR_PASSWORD=password c4po/harbor-exporter --harbor.server=https://harbor.dev
⁠Run in Kubernetes

if you deploy Harbor to Kubernetes using the helm chart goharbor/harbor-helm⁠, you can use this file kubernetes/harbor-exporter.yaml⁠ to deploy the harbor-exporter with secretKeyRef

⁠Using Grafana

You can load this json file grafana/harbor-overview.json⁠ to Grafana instance to have the dashboard. screenshot

Tag summary

Content type

Image

Digest

Size

10.3 MB

Last updated

almost 6 years ago

docker pull c4po/harbor-exporter