Configure manual metrics collection
While PDS includes built-in dashboards for monitoring common usage scenarios for your data services, you may wish to see additional metrics or combine metrics from multiple data services or your cluster. To do this, you can query the full list of metrics from a native Prometheus endpoint using a REST API.
Prerequisites
- PDS account admin privileges
Procedure
Create a new service account using the API:
curl -X POST https://prod.pds.portworx.com/api/tenants/<ID>/service-accounts -d `{"name": <service-account-name>"}`
Use the API to assign a “metrics-reader” role binding to this service account, actor-type: service-account:
actor_id
with the ID of the service account you just createdactor_type
set toservice-account
role_name
set tometrics-reader
curl -X PUT https://prod.pds.portworx.com/api/tenants/<ID>/role-bindings -d `{"actor_id": "<ID>","actor_type": "service-account","role_name": "metrics-reader"}`
Retrieve the service account token by issuing the following
GET
request:curl -X GET https://prod.pds.portworx.com/api/service-accounts/<ID>/token
Save the account token for future reference.
Retrieve the metrics by querying the
https://prod.pds.portworx.com/prometheus/api/v1/query
endpoint and authenticating with the service account token.