curl -X POST <NEED URL>/api/tenants/<id>/service-accounts -d '{"name": "<service-account-name>"}'
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:
-
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 created -
actor_type
set toservice-account
-
role_name
set tometrics-reader
curl -X PUT <NEED URL>/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 <NEED URL>/api/service-accounts/<ID>/token
Save the account token for future reference
-
Retrieve the metrics by querying the
https://<NEED URL>/prometheus/api/v1/query
endpoint and authenticating with the service account token.