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

Harbor should expose metrics. #4557

Closed
reasonerjt opened this issue Apr 1, 2018 · 50 comments
Closed

Harbor should expose metrics. #4557

reasonerjt opened this issue Apr 1, 2018 · 50 comments
Assignees
Labels
backlog Epic kind/requirement New feature or idea on top of harbor

Comments

@reasonerjt
Copy link
Contributor

reasonerjt commented Apr 1, 2018

This helpful for user who host Harbor as a service.

Harbor does not expose any metrics. As the registry will be a crucial piece of our pipeline (and offering) it will be subjected to an SLA and we'll need some internal metrics published over Prometheus (our monitoring solution). We must be able to quickly diagnose problems and eventually page SRE engineers.

@reasonerjt reasonerjt added the Epic label Apr 1, 2018
@jnovack
Copy link

jnovack commented Apr 1, 2018

I'm pretty sure Prometheus-compatible metrics exposure is almost a requirement in 2018 for project adoption. 🤔

@jcmartins
Copy link

+1

@stale
Copy link

stale bot commented Oct 7, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Oct 7, 2018
@stale stale bot closed this as completed Oct 28, 2018
@jakirpatel
Copy link

+1
This will be really helpful if harbor expose the metrics which will give insights of the harbor. @reasonerjt

@reasonerjt reasonerjt added backlog and removed Stale labels Oct 30, 2018
@reasonerjt reasonerjt reopened this Oct 30, 2018
@jakirpatel
Copy link

any update for this in roadmap activities..?

@ghost
Copy link

ghost commented Nov 6, 2018

Definitely on our roadmap and we hope to get to it as soon as possible. If anyone is interested in contributing please let me know. 😄

@aylei
Copy link

aylei commented Nov 15, 2018

@clouderati @reasonerjt I would love to help with this issue.😁

@aylei
Copy link

aylei commented Nov 27, 2018

Hi, is there any update on this issue? I think we can introduce the prometheus format metrics to harbor as the first step (we will get the golang runtime metrics and process metrics by default), and add necessary metrics later on.
Also, I want to clarify what additional metrics we need for each harbor component, any ideas?

@salkin
Copy link
Contributor

salkin commented Dec 14, 2018

A good start would be amount of pulls / push with error codes to get more insight about unauthorized pulls.

@darkl0rd
Copy link

You can effectively get this for "free" these days, as Docker Distribution provides Prometheus metrics since v2.7.1 (See distribution/distribution@e3c37a4 and for docs: https://github.com/docker/distribution/blob/master/docs/configuration.md)

To adopt, this would imply:

a) updating the version of docker distribution (currently 2.6.4) to 2.7.1 or later.
b) an adjustment to the registry/config.yml (see linked docs)
c) updating nginx.conf (to expose the endpoint).

@YakirShriker
Copy link

A good start would be amount of pulls / push with error codes to get more insight about unauthorized pulls.

does anyone know how can I query harbor(api) for pull and push operations?

@armandorvila
Copy link

+1

3 similar comments
@secret104278
Copy link

+1

@HaveFun83
Copy link

+1

@KarstenSiemer
Copy link

+1

@hairyhenderson
Copy link

I'm pretty sure the +1 messages are unhelpful and only serve to frustrate maintainers - use reactions (like 👍) instead to indicate that you're in support of this 😉

@hairyhenderson
Copy link

You can effectively get this for "free" these days, as Docker Distribution provides Prometheus metrics since v2.7.1

Seems that since #8003 the go.mod pulls in docker/distribution 2.7.1+, so at least part of the work is done - is anyone working on the remaining pieces?

@xaleeks xaleeks self-assigned this Aug 24, 2019
@xaleeks xaleeks added the kind/requirement New feature or idea on top of harbor label Aug 26, 2019
@xaleeks
Copy link
Contributor

xaleeks commented Aug 26, 2019

If anyone wants to work on this issue please reach out.

@MartinForReal
Copy link

I would like to work on this issue. Thanks!

@mawl
Copy link

mawl commented Jan 17, 2020

+1

@hrak
Copy link

hrak commented Jan 17, 2020

I subscribed to this issue to stay informed on the developments of this feature, not to be emailed every day with another useless "+1" response kthx.

@holooooo
Copy link

I subscribed to this issue to stay informed on the developments of this feature, not to be emailed every day with another useless "+1" response kthx.

+1

@c4po
Copy link

c4po commented Feb 6, 2020

I'm building a harbor-exporter https://github.com/c4po/harbor_exporter to dump the data from harbor API to prometheus format. All suggestions are welcome.

@pruthvirajkanmantha
Copy link

pruthvirajkanmantha commented Mar 17, 2020

I faced the below mentioned issue while using https://github.com/c4po/harbor_exporter.

Issue:
level=error ts=2020-03-17T13:58:20.891Z caller=harbor_exporter.go:111 msg="error gathering metrics:8 error(s) occurred:\n* collected metric "harbor_quotas_count_total" { label:<name:"repo_id" value:"0" > label:<name:"repo_name" value:"" > label:<name:"type" value:"hard" > gauge:<value:-1 > } was collected before with the same name and label values\n* collected metric "harbor_quotas_count_total" { label:<name:"repo_id" value:"0" > label:<name:"repo_name" value:"" > label:<name:"type" value:"used" > gauge:<value:0 > } was collected before with the same name and label values\n* collected metric

@hrak
Copy link

hrak commented Mar 17, 2020

@pruthvi08 then open an issue there 🤷🏼‍♂️

@Hokwang
Copy link

Hokwang commented Apr 20, 2020

@xaleeks I am concerned that this issue is still in the backlog. Does that mean that this issue cannot be resolved until version 2.2?

@xaleeks
Copy link
Contributor

xaleeks commented May 18, 2020

@Hokwang We are still in planning stage and it didn't make it into the 2.1 release hopper unfortunately. To have a better chance of delivering this in 2.2, we need be finalizing some high level design pretty soon. Do you have some bandwidth to contribute to this as well?

@standup-jb
Copy link

+1
Hope provide the promethes exporter metrics

@unixzen
Copy link

unixzen commented Jul 10, 2020

+1

@bitsf
Copy link
Contributor

bitsf commented Aug 24, 2020

@addozhang
Copy link

+1

@DesistDaydream
Copy link

I prefer the official to provide metrics directly, rather than through exporter

@xaleeks
Copy link
Contributor

xaleeks commented Sep 13, 2020

Everyone please feel free to chime in with your requirements, we're working on a functional spec right now. Will share more on the next community meeting, or perhaps the one after that

@fredgate
Copy link

fredgate commented Oct 16, 2020

@xaleeks Some great metrics would be the results of the scans. So we could have alerts when vulnerabilties are found.

@xaleeks
Copy link
Contributor

xaleeks commented Oct 25, 2020

updated proposal is here
goharbor/community#147

@xaleeks
Copy link
Contributor

xaleeks commented Oct 30, 2020

metrics that will be captured in next v2.2 release are here

https://docs.google.com/document/d/1J_jiJVdV4AOB9lf9PtN5T1LoqHlHF8SjLjI2KL17b0o/edit

@kong62
Copy link

kong62 commented Dec 9, 2020

+1

1 similar comment
@dongjiang1989
Copy link

+1

@amaters-easy
Copy link

metrics that will be captured in next v2.2 release are here

https://docs.google.com/document/d/1J_jiJVdV4AOB9lf9PtN5T1LoqHlHF8SjLjI2KL17b0o/edit

this document shows that the following metrics will be implemented:
Scan status labels: scan job id
Total vulnerabilities(p2) labels: project id

Maybe I can't find them or they are still in development?

@ninjadq
Copy link
Member

ninjadq commented May 25, 2021

@amaters-easy The vulnerabilities are based on artifacts. So it can become a huge number. So it isn't a good practice to expose them. It will be added in a future release if we find a proper way.

@cparadal
Copy link

cparadal commented Jul 6, 2021

@ninjadq what about replication policy status metrics? They're also in the document but i can't see them in Prometheus. Is that something that's planned to be relased in further releases?
I'm especially interestered in knowing when scheduled replication rules stop triggering (something that happens a lot after Harbor version upgrades).

Thanks!

@ninjadq
Copy link
Member

ninjadq commented Jul 6, 2021

@cparadal replication jobs are run by Job service also. you can find replication related job status with job services' metrics

@cparadal
Copy link

cparadal commented Jul 6, 2021

@cparadal replication jobs are run by Job service also. you can find replication related job status with job services' metrics

Thanks for your reply!

These are the jobservice related metrics I can see on Prometheus:

image

I guess I could alert if the below count doesn't increase:

harbor_jobservice_task_process_time_seconds_count{status="success",type="SCHEDULER"} 157

... even though it applies to all scheduled replications, can't see a way to get metrics for specific ones.

@reasonerjt
Copy link
Contributor Author

@xaleeks Shall we close this one and open new issues, I believe adding/adjusting the metrics for Harbor will be a continuous effort.

@withlin
Copy link

withlin commented Mar 16, 2022

any update?

@reasonerjt
Copy link
Contributor Author

As per #4557 (comment) I'm closing this one.

Please open new issues when you want new metrics to be collected or make adjustment to the existing ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Epic kind/requirement New feature or idea on top of harbor
Projects
None yet
Development

No branches or pull requests