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

  1. Create a new service account using the API:

    curl -X POST <NEED URL>/api/tenants/<id>/service-accounts -d '{"name": "<service-account-name>"}'
  2. 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 to service-account

    • role_name set to metrics-reader

    curl -X PUT <NEED URL>/api/tenants/<id>/role-bindings -d '{"actor_id": "<ID>","actor_type": "service-account","role_name": "metrics-reader"}'
  3. 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

  4. Retrieve the metrics by querying the https://<NEED URL>/prometheus/api/v1/query endpoint and authenticating with the service account token.



Last edited: Wednesday, Apr 27, 2022