Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation of Harbor statistics Prometheus metric #514

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Description for export Harbor statistics as Prometheus metric for PR g…
…oharbor/harbor#18679

Signed-off-by: Vadim Bauer <1492007+Vad1mo@users.noreply.github.com>
Vad1mo committed Nov 18, 2023
commit 31de14024da0a54a693c02d83cd0aa1125af4b28
16 changes: 16 additions & 0 deletions docs/administration/metrics/_index.md
Original file line number Diff line number Diff line change
@@ -51,6 +51,22 @@ Name | Description | Labels (Values) | Metric type
`harbor_core_http_request_total` | The total number of requests | method (`GET`, `POST`, `HEAD`, `PATCH`, `PUT`), operation (values from `operationId` in [Harbor API](https://github.com/goharbor/harbor/blob/main/api/v2.0/swagger.yaml). Some legacy endpoints do not have an `operationId`, so the label value is `unknown`) | counter
{{< /table >}}

## Harbor Statistics Metrics
Get the statistic information about the projects and repositories
The data exposed as metrics are 1:1 taken from the statistics API `/api/v2.0/statistics`.

{{< table caption="Statistics Metrics exposed by Harbor Core" >}}
Name | Description | Labels (Values) | Metric type
:---------|:------------|:-------|:-------
`harbor_statistics_private_project_amount` "Amount of private projects" || gauge
`harbor_statistics_private_repo_amount` | "Amount of private repositories" || gauge
`harbor_statistics_public_project_amount` | "Amount of public projects" || gauge
`harbor_statistics_public_repo_amount` | "Amount of public repositories" || gauge
`harbor_statistics_total_project_amount` | Total amount of projects || gauge
`harbor_statistics_total_repo_amount` | "Total amount of repositories" || gauge
`harbor_statistics_total_storage_consumption` | Total storage used | | gauge
{{< /table >}}

## Registry Metrics

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