This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.5.4. Accessing registry metrics
The OpenShift Container Registry provides an endpoint for Prometheus metrics. Prometheus is a stand-alone, open source systems monitoring and alerting toolkit.
The metrics are exposed at the /extensions/v2/metrics path of the registry endpoint.
Procedure
There are two ways in which you can access the metrics, running a metrics query or using the cluster role.
Metrics query
Run a metrics query, for example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
<user>
can be arbitrary, but<secret>
must match the value specified in the registry configuration.
Cluster role
Create a cluster role if you do not already have one to access the metrics:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add this role to a user, run the following command:
oc adm policy add-cluster-role-to-user prometheus-scraper <username>
$ oc adm policy add-cluster-role-to-user prometheus-scraper <username>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Access the metrics using cluster role. The part of the configuration file responsible for metrics should look like this:
openshift: version: 1.0 metrics: enabled: true ...
openshift: version: 1.0 metrics: enabled: true ...
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Additional resources
-
A
kubeadmin
can access the registry until deleted. See Removing the kubeadmin user for more information. - For more information on configuring an identity provider, see Understanding identity provider configuration.