To view usage statistics using the metrics API as a data source, you can use a variety of third-party software that you can deploy inside or outside of your cluster.
For instance, you can use the Grafana app with the metrics API as source data and display results in a dashboard format.
Note:
Prior to ArcGIS Enterprise 11.2 on Kubernetes, Grafana was available directly from the ArcGIS Enterprise Administrator API but has since been removed. While it is no longer available directly from the software, you can still use Grafana with the metrics API by installing it separately.
Determine the URL pattern
To use the metrics API as a data source in your third-party app, you must register its URL with the app.
Note:
When registering the API as a data-source, ensure that its URL represents whether it can be accessed internally or externally to the cluster.
Note:
Use the URL pattern that matches your deployment.
- External service URL (used when accessing he API inside or outside of the cluster): https://<FQDN>/<context>/prometheus
- Internal service URL (used when accessing the API from within the same cluster): http://arcgis-rest-metrics-api.<deploymentNamespace>.svc.cluster.local:8443/arcgis/prometheus
Add Prometheus as the data source
To use the metrics API in your app, you must select Prometheus as the type of data source.
The following steps are an example of this process when using Grafana; however, other applications will use similar steps.
- From the Grafana UI, open the Configuration menu.
- Click Data Sources.
- Click Add data source.
- Select Prometheus as the type.
- Set server URL as the as the appropriate Prometheus server URL.
- External service URL (used when accessing the API inside or outside of the cluster): https://<FQDN>/<context>/prometheus
- Internal service URL (used when accessing the API from within the same cluster): http://arcgis-rest-metrics-api.<deploymentNamespace>.svc.cluster.local:8443/arcgis/prometheus
- Set Access as Browser.
- Enable Basic Auth and enter the credentials you specified when accessing the metrics API.
- Click Save and Test to save the new data source.
Example dashboard templates
Once you have registered the metrics API and set Prometheus as the source, you can start visualizing your organization's service data. To get started, several sample Grafana dashboard templates are available in the ArcGIS Enterprise on Kubernetes repository. You can import these dashboards by uploading a JSON of the template or by pasting the JSON text directly. Follow the steps below to import these example Grafana dashboards.
- In Grafana, click Dashboards.
- Click New.
- Select Import on the drop-down menu.
- Perform one of the following steps:
- Upload a dashboard .json file from the template.
- Paste the dashboard .json text directly into the text area copied from the template.