goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
23.59k stars 4.71k forks source link

Harbor Metrics ServiceMonitor(Prometheus/Victoriametrics) #20759

Open Twisterrr opened 1 month ago

Twisterrr commented 1 month ago

Hi,

I want to monitor my Harbor kubernetes (v2.9.1) instance but I got an issue. I use a Victoriametrics agent (similar propertiers as prometheus operator) with a VMServiceScrape (similar as ServiceMonitor) yaml file : `apiVersion: operator.victoriametrics.com/v1beta1 kind: VMServiceScrape metadata: name: harbor namespace: harbor spec: endpoints:

With "https-metrics" = not working : image

With "metrics" = working : image

How can I change it in values.yaml files ?

MinerYang commented 1 month ago

the metrics path by default is /metrics, if you need to specify them please modify at metrics fields

metrics:
  enabled: false
  ...
  exporter:
    path: /metrics
    port: 8001
Twisterrr commented 1 month ago

sorry for the long return, basically in the deployment of harbor, the name of the default ports are "https-metrics". And to modify that for the moment I'm obliged to modify hard in the yaml file directly on Rancher in this case.

Even by putting in my scrape service "https-metrics", prometheus does not retrieve the metrics.