Harbor

Metrics, Dashboards, Alerts and more for Harbor Integration in Sysdig Monitor.
Harbor

This integration is enabled by default.

Versions supported: > v2.3

This integration is out-of-the-box, so it doesn’t require any exporter.

This integration has 44 metrics.

Timeseries generated: 800 timeseries

List of Alerts

AlertDescriptionFormat
[Harbor] Harbor Core Is DownHarbor Core Is DownPrometheus
[Harbor] Harbor Database Is DownHarbor Database Is DownPrometheus
[Harbor] Harbor Registry Is DownHarbor Registry Is DownPrometheus
[Harbor] Harbor Redis Is DownHarbor Redis Is DownPrometheus
[Harbor] Harbor Trivy Is DownHarbor Trivy Is DownPrometheus
[Harbor] Harbor JobService Is DownHarbor JobService Is DownPrometheus
[Harbor] Project Quota Is Raising The LimitProject Quota Is Raising The LimitPrometheus
[Harbor] Harbor p99 latency is higher than 10 secondsHarbor p99 latency is higher than 10 secondsPrometheus
[Harbor] Harbor Error Rate is HighHarbor Error Rate is HighPrometheus

List of Dashboards

Harbor

The dashboard provides information on the Harbour instance status, storage usage, projects and tasks. Harbor

List of Metrics

Metric name
go_build_info
go_gc_duration_seconds
go_gc_duration_seconds_count
go_gc_duration_seconds_sum
go_goroutines
go_memstats_buck_hash_sys_bytes
go_memstats_gc_sys_bytes
go_memstats_heap_alloc_bytes
go_memstats_heap_idle_bytes
go_memstats_heap_inuse_bytes
go_memstats_heap_released_bytes
go_memstats_heap_sys_bytes
go_memstats_lookups_total
go_memstats_mallocs_total
go_memstats_mcache_inuse_bytes
go_memstats_mcache_sys_bytes
go_memstats_mspan_inuse_bytes
go_memstats_mspan_sys_bytes
go_memstats_next_gc_bytes
go_memstats_stack_inuse_bytes
go_memstats_stack_sys_bytes
go_memstats_sys_bytes
go_threads
harbor_artifact_pulled
harbor_core_http_request_duration_seconds
harbor_jobservice_task_process_time_seconds
harbor_project_member_total
harbor_project_quota_byte
harbor_project_quota_usage_byte
harbor_project_repo_total
harbor_project_total
harbor_quotas_size_bytes
harbor_task_concurrency
harbor_task_queue_latency
harbor_task_queue_size
harbor_up
process_cpu_seconds_total
process_max_fds
process_open_fds
registry_http_request_duration_seconds_bucket
registry_http_request_size_bytes_bucket
registry_http_requests_total
registry_http_response_size_bytes_bucket
registry_storage_action_seconds_bucket

Preparing the Integration

Enable Prometheus Metrics

As seen in the Harbor documentation page Configure the Harbor YML File, to make Harbor expose an endpoint for scraping metrics, you need to set the ‘metric.enabled’ configuration to ’true’.

If you install Harbor with Helm, you need to use the following flag:

--set 'metrics.enabled=true'

Installing

The installation of an exporter is not required for this integration.

Monitoring and Troubleshooting Harbor

This document describes important metrics and queries that you can use to monitor and troubleshoot Harbor.

Tracking metrics status

You can track Harbor metrics status with following alerts: Exporter proccess is not serving metrics

# [Harbor] Exporter Process Down
absent(harbor_up{kube_cluster_name=~$cluster,kube_namespace_name=~$namespace,kube_workload_name=~$workload}) > 0

Agent Configuration

These are the default agent jobs for this integration:

- job_name: harbor-exporter-default
  kubernetes_sd_configs:
  - role: pod
  relabel_configs:
  - action: keep
    source_labels: [__meta_kubernetes_pod_host_ip]
    regex: __HOSTIPS__
  - action: drop
    source_labels: [__meta_kubernetes_pod_annotation_promcat_sysdig_com_omit]
    regex: true
  - action: keep
    source_labels:
    - __meta_kubernetes_pod_container_name
    - __meta_kubernetes_pod_container_port_number
    regex: exporter;8080
  - action: replace
    source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme]
    target_label: __scheme__
    regex: (https?)
  - action: replace
    source_labels: [__address__,__meta_kubernetes_pod_container_port_number]
    regex: ([^:]+)(?::\d+)?;(\d+)
    replacement: $1:8001
    target_label: __address__
  - action: replace
    source_labels: [__meta_kubernetes_pod_uid]
    target_label: sysdig_k8s_pod_uid
  - action: replace
    source_labels: [__meta_kubernetes_pod_container_name]
    target_label: sysdig_k8s_pod_container_name

- job_name: harbor-core-default
  kubernetes_sd_configs:
  - role: pod
  relabel_configs:
  - action: keep
    source_labels: [__meta_kubernetes_pod_host_ip]
    regex: __HOSTIPS__
  - action: drop
    source_labels: [__meta_kubernetes_pod_annotation_promcat_sysdig_com_omit]
    regex: true
  - action: keep
    source_labels:
    - __meta_kubernetes_pod_container_name
    - __meta_kubernetes_pod_container_port_number
    regex: core;8080
  - action: replace
    source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme]
    target_label: __scheme__
    regex: (https?)
  - action: replace
    source_labels: [__address__,__meta_kubernetes_pod_container_port_number]
    regex: ([^:]+)(?::\d+)?;(\d+)
    replacement: $1:8001
    target_label: __address__
  - action: replace
    source_labels: [__meta_kubernetes_pod_uid]
    target_label: sysdig_k8s_pod_uid
  - action: replace
    source_labels: [__meta_kubernetes_pod_container_name]
    target_label: sysdig_k8s_pod_container_name

- job_name: harbor-registry-default
  kubernetes_sd_configs:
  - role: pod
  relabel_configs:
  - action: keep
    source_labels: [__meta_kubernetes_pod_host_ip]
    regex: __HOSTIPS__
  - action: drop
    source_labels: [__meta_kubernetes_pod_annotation_promcat_sysdig_com_omit]
    regex: true
  - action: keep
    source_labels:
    - __meta_kubernetes_pod_container_name
    - __meta_kubernetes_pod_container_port_number
    regex: registry;5000
  - action: replace
    source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme]
    target_label: __scheme__
    regex: (https?)
  - action: replace
    source_labels: [__address__,__meta_kubernetes_pod_container_port_number]
    regex: ([^:]+)(?::\d+)?;(\d+)
    replacement: $1:8001
    target_label: __address__
  - action: replace
    source_labels: [__meta_kubernetes_pod_uid]
    target_label: sysdig_k8s_pod_uid
  - action: replace
    source_labels: [__meta_kubernetes_pod_container_name]
    target_label: sysdig_k8s_pod_container_name

- job_name: harbor-jobservice-default
  kubernetes_sd_configs:
  - role: pod
  relabel_configs:
  - action: keep
    source_labels: [__meta_kubernetes_pod_host_ip]
    regex: __HOSTIPS__
  - action: drop
    source_labels: [__meta_kubernetes_pod_annotation_promcat_sysdig_com_omit]
    regex: true
  - action: keep
    source_labels:
    - __meta_kubernetes_pod_container_name
    - __meta_kubernetes_pod_container_port_number
    regex: jobservice;8080
  - action: replace
    source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme]
    target_label: __scheme__
    regex: (https?)
  - action: replace
    source_labels: [__address__,__meta_kubernetes_pod_container_port_number]
    regex: ([^:]+)(?::\d+)?;(\d+)
    replacement: $1:8001
    target_label: __address__
  - action: replace
    source_labels: [__meta_kubernetes_pod_uid]
    target_label: sysdig_k8s_pod_uid
  - action: replace
    source_labels: [__meta_kubernetes_pod_container_name]
    target_label: sysdig_k8s_pod_container_name