{"id":13575488,"url":"https://github.com/c4po/harbor_exporter","last_synced_at":"2025-10-26T17:31:23.380Z","repository":{"id":46716070,"uuid":"238507801","full_name":"c4po/harbor_exporter","owner":"c4po","description":"Harbor prometheus exporter","archived":false,"fork":false,"pushed_at":"2023-05-09T00:03:39.000Z","size":7128,"stargazers_count":85,"open_issues_count":1,"forks_count":51,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-31T21:52:43.843Z","etag":null,"topics":["docker","grafana","harbor","kubernetes","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/c4po.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-02-05T17:24:30.000Z","updated_at":"2025-01-06T07:37:57.000Z","dependencies_parsed_at":"2024-01-14T03:52:05.517Z","dependency_job_id":"a9ffe347-048e-444a-96ac-7137122a7ff3","html_url":"https://github.com/c4po/harbor_exporter","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4po%2Fharbor_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4po%2Fharbor_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4po%2Fharbor_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4po%2Fharbor_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c4po","download_url":"https://codeload.github.com/c4po/harbor_exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238375203,"owners_count":19461568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","grafana","harbor","kubernetes","prometheus"],"created_at":"2024-08-01T15:01:01.530Z","updated_at":"2025-10-26T17:31:18.093Z","avatar_url":"https://github.com/c4po.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Prometheus exporter for Harbor \n\n[![CircleCI](https://circleci.com/gh/c4po/harbor_exporter.svg?style=svg)](https://circleci.com/gh/c4po/harbor_exporter)\n\n- [Change Log](CHANGELOG.md)\n\nExport harbor service health to Prometheus.\n\nTo run it:\n\n```bash\nmake build\n./harbor_exporter [flags]\n```\n\nTo build a Docker image:\n\n```\nmake dockerbuild\n```\n\n## Exported Metrics\n\n| Metric | Meaning | Labels |\n| ------ | ------- | ------ |\n|harbor_up| | |\n|harbor_health| | |\n|harbor_components_health| | component=[chartmuseum,core,database,jobservice,notary,portal,redis,registry,registryctl]|\n|harbor_health_latency| | |\n|harbor_scans_completed | | |\n|harbor_scans_total | | |\n|harbor_scans_success | | |\n|harbor_scans_error | | |\n|harbor_scans_requester | | |\n|harbor_scans_latency| | |\n|harbor_project_count_total| |type=[private_project, public_project, total_project]|\n|harbor_repo_count_total| |type=[private_repo, public_repo, total_repo]|\n|harbor_statistics_latency| | |\n|harbor_quotas_count_total| |repo_id, repo_name, type=[hard, used]|\n|harbor_quotas_size_bytes| | repo_id, repo_name, type=[hard, used]|\n|harbor_quotas_latency| | |\n|harbor_system_volumes_bytes| |storage=[free, total]|\n|harbor_system_volumes_latency| | |\n|harbor_repositories_pull_total| |repo_id, repo_name|\n|harbor_repositories_star_total| |repo_id, repo_name|\n|harbor_repositories_tags_total| |repo_id, repo_name|\n|harbor_repositories_latency| | |\n|harbor_replication_status|status of the last execution of this replication policy: Succeed = 1, any other status = 0|repl_pol_name, repl_trigger_type[manual, scheduled, event_based]|\n|harbor_replication_tasks|number of replication tasks, with various results, in the latest execution of this replication policy|repl_pol_name, repl_trigger_type[manual, scheduled, event_based], result=[failed, succeed, in_progress, stopped]|\n|harbor_system_info               | |auth_mode, project_creation_restriction, harbor_version, registry_storage_provider_name\n|harbor_system_with_notary        | |\n|harbor_system_self_registration  | |\n|harbor_system_has_ca_root        | |\n|harbor_system_read_only          | |\n|harbor_system_with_chartmuseum   | |\n|harbor_system_notification_enable| |                              \n|harbor_replication_latency| | |\n|harbor_artifacts_vulnerabilities|quantity of detected vulnerabilities|artifact_id, artifact_name, project_id, project_name, repo_id, repo_name, report_id, status=[fixable, total, fixable, low, medium, high]|\n|harbor_artifacts_size|size in bytes|artifact_id, artifact_name, project_id, project_name, repo_id, repo_name|\n|harbor_artifacts_vulnerabilities_scans|current status of scan process: 1 - Success, 2 - Running, 0 - other|artifact_id, artifact_name, project_id, project_name, repo_id, repo_name, status|\n|harbor_artifacts_vulnerabilities_scan_duration|time spent on the last scan|artifact_id, artifact_name, project_id, project_name, repo_id, repo_name, report_id|\n|harbor_artifacts_vulnerabilities_scan_start|the last scan start timestamp|artifact_id, artifact_name, project_id, project_name, repo_id, repo_name, report_id|\n\n\n_Note: when the harbor.instance flag is used, each metric name starts with `harbor_instancename_` instead of just `harbor_`._\n\n### Flags\n\n```bash\n./harbor_exporter --help\n```\n\n`skip.metrics` - Skip collection of certain metric groups (optional)\n\n* valid value: `artifacts|scans|statistics|quotas|repositories|replication|health`\n* default value: empty\n* example:\n```\n./harbor_exporter --skip.metrics scans --skip.metrics quotas\n```\n\n---\n\n`cache.enabled` - Enable caching of metrics (optional)\n* valid value: `true|false`\n* default value: `false`\n* Cache duration can be changed with `--cache.duration` (default 20s).\n* example:\n```\n./harbor_exporter --cache.enabled --cache.duration 30s\n```\nThis can also be configured via the environment variables `HARBOR_CACHE_ENABLED` and `HARBOR_CACHE_DURATION`.\n\n---\n`harbor.pagesize` - Set page size for results. Can be also set with Environment variable `HARBOR_PAGESIZE`\n* default value: `100`\n\n### Environment variables\nBelow environment variables can be used instead of the corresponding flags. Easy when running the exporter in a container.\n\n```\nHARBOR_INSTANCE\nHARBOR_URI\nHARBOR_USERNAME\nHARBOR_PASSWORD\nHARBOR_CACHE_ENABLED\nHARBOR_CACHE_DURATION\n```\n\n## Using Docker\n\nYou can deploy this exporter using the Docker image.\n\nFor example:\n\n```bash\ndocker pull c4po/harbor-exporter\n\ndocker run -d -p 9107:9107 -e HARBOR_USERNAME=admin -e HARBOR_PASSWORD=password c4po/harbor-exporter --harbor.server=https://harbor.dev\n```\n### Run in Kubernetes\n\nif you deploy Harbor to Kubernetes using the helm chart [goharbor/harbor-helm](https://github.com/goharbor/harbor-helm), you can use this file [kubernetes/harbor-exporter.yaml](kubernetes/harbor-exporter.yaml) to deploy the `harbor-exporter` with `secretKeyRef`\n\n## Using Grafana\n\nYou can load this json file [grafana/harbor-overview.json](grafana/harbor-overview.json) to Grafana instance to have the dashboard. ![screenshot](grafana/screenshot.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc4po%2Fharbor_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc4po%2Fharbor_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc4po%2Fharbor_exporter/lists"}