- Created ServiceMonitor for Harbor (harbor-core, harbor-exporter, harbor-jobservice, harbor-registry) - Port: http-metrics (8001) - Scrape interval: 30s - Verified metrics: harbor_core_http_request_duration_seconds_count - Created ServiceMonitor for External-DNS - Port: http (7979) - Scrape interval: 30s - Verified metrics: external_dns_registry_endpoints_total - Created ServiceMonitor for Ingress-NGINX - Port: metrics (10254) - Scrape interval: 30s - Verified metrics: nginx_ingress_controller_requests - Added Grafana dashboards: - Harbor Overview (dashboard 16366) - External-DNS (dashboard 15038) - Ingress-NGINX Controller (dashboard 9614) All ServiceMonitors deployed and actively scraping. Prometheus targets confirmed UP.
50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
# ------------------------------------------------------------------------------
|
|
# Harbor Metrics - ServiceMonitor
|
|
#
|
|
# Configures Prometheus Operator to scrape Harbor metrics
|
|
#
|
|
# Scrape interval: 30s
|
|
# Components scraped:
|
|
# - harbor-core: Core service HTTP metrics
|
|
# - harbor-registry: Registry-specific metrics
|
|
# - harbor-jobservice: Job and vulnerability scan metrics
|
|
# - harbor-exporter: Harbor metrics exporter
|
|
# Metrics namespace: harbor_* (harbor_core_*, harbor_project_*, etc.)
|
|
# ------------------------------------------------------------------------------
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: harbor-metrics
|
|
namespace: harbor
|
|
labels:
|
|
app: harbor
|
|
app.kubernetes.io/name: harbor
|
|
app.kubernetes.io/component: metrics
|
|
# Label selector for kube-prometheus-stack discovery
|
|
release: monitoring
|
|
spec:
|
|
# Select Harbor services with metrics endpoints
|
|
selector:
|
|
matchLabels:
|
|
app: harbor
|
|
|
|
# Namespace selector
|
|
namespaceSelector:
|
|
matchNames:
|
|
- harbor
|
|
|
|
# Scrape endpoint configuration
|
|
endpoints:
|
|
# Harbor Core - main API and web UI metrics
|
|
- port: http-metrics
|
|
interval: 30s
|
|
scrapeTimeout: 10s
|
|
path: /metrics
|
|
relabelings:
|
|
- sourceLabels: [__meta_kubernetes_service_label_component]
|
|
targetLabel: component
|
|
action: replace
|
|
- sourceLabels: [__meta_kubernetes_service_name]
|
|
targetLabel: service
|
|
action: replace
|