Service Metrics Data API
This topic covers how to programmatically retrieve Sonatype Nexus Repository usage metrics using the /service/metrics/data
API. Note that this API is not currently available in the Swagger documentation that displays within the Sonatype Nexus Repository user interface.
Required Privileges
You will need at least the nexus:metrics:read
privilege to use this API.
To programmatically retrieve Sonatype Nexus Repository usage metrics, query /service/metrics/data
, and look for the fields specified in the table below.
Metric* | JSON Path | Notes |
---|---|---|
Total Components |
| Shows current total |
Max Components (30 days) |
| Track |
Requests per Day |
| Shows current daily total |
Peak Requests per Day (30 days) |
| Track |
* "Metric" in this instance refers to the corresponding metric available in the user interface via the Usage Center. For maximum data parity with the user interface metrics information, you will want to retrieve this data before midnight (based on server time) each day.