Harbor is an open-source registry that secures artifacts with policies and role-based access control, ensures images are scanned and free from vulnerabilities, and signs images as trusted. Harbor, a CNCF Graduated project, delivers compliance, performance, and interoperability to help you consistently and securely manage artifacts across cloud native compute platforms like Kubernetes and Docker.
Use New Relic to view a dashboard based on Prometheus metrics which helps you understand the Harbor infrastructure of your k8s cluster. With New Relic you can monitor:
- Harbor service status
- Harbor Project byte quota utilization percentage
- Harbor Server and Client error rates
Enable the integration
Follow these steps to enable the integration.
Follow the Harbor documentation for Prometheus to discover the Harbor metrics endpoints.
Set up Prometheus monitoring. Prometheus metrics needs to be integrated with New Relic, you can use the Prometheus Agent or the Remote Write integration. See how to send Prometheus metrics for more details.
Use the following query to confirm metrics are being ingested as expected:FROM Metric SELECT count(*) WHERE metricName LIKE 'harbor_%' FACET metricName LIMIT MAX
Once imported, you can edit or clone the assets to adapt them to your specific requirements.
Some charts of the dashboard include queries with conditions that require the identification of your pod or endpoint with one of the these labels
k8s-appcontaining the string
Find and use metrics
The different sets of metrics exposed by this integration are defined in the Harbor documentation.
Use the following NRQL queries to understand the metrics being ingested in New Relic:
List unique metric names:FROM Metric SELECT keysetlike('harbor_%')
Count number of metric updates:FROM Metric SELECT datapointcount() WHERE metricName LIKE 'harbor_%' LIMIT MAX
Estimate data ingestion (daily ingest, in bytes):FROM Metric SELECT bytecountestimate() FACET metricName WHERE metricName LIKE 'harbor_%' SINCE 1 DAY AGO LIMIT MAX
Use this command to verify that the Harbor Prometheus endpoint is emitting metrics on any K8s node configured with Harbor:curl <Harbor-Pod-IP>:9090/metrics
You can also check the specific troubleshooting guidelines for Prometheus integrations.