Introduction
ArcGIS Enterprise To operate ArcGIS Enterprise reliably, it’s important to continuously monitor a range of information, such as whether it’s running properly, whether there are any resource issues involving CPU or memory, and whether services are taking too long to respond.
The Metrics API, introduced as a beta in ArcGIS Enterprise 12.0, became generally available in ArcGIS Enterprise 12.1.
The Metrics API lets you retrieve metrics that indicate the status of ArcGIS Enterprise components and the machines on which they run.
This article walks through the steps for retrieving metrics from the Metrics API using ArcGIS Enterprise 12.1 for Windows. You need permission to create developer credentials to perform these operations. Note that the interface and steps may vary depending on the product version and your organization’s settings.
The steps are as follows:
- Create an API key for the Metrics API
- Access the Metrics API using curl
- Review the retrieved metrics
What is the Metrics API?
The Metrics API is an API that enhances the observability of ArcGIS Enterprise. It provides information for understanding system performance and status by collecting and aggregating metrics.
The official documentation describes the following common use cases:
Understand usage
You can group requests per second by service, user, and operation. This helps you identify the most popular services and the services used by each user. This information can help you decide which content to promote or remove, and determine the appropriate licenses and access permissions for each user.
Understand system status
- Uptime: whether the system is available
- Service error rate: how often services return errors
- Response time: how long services take to respond
- Service load: load based on requests and service usage time
By tracking these indicators, GIS and IT administrators can help keep ArcGIS Enterprise running reliably.
Create an API key for the Metrics API
- Sign in to your organization with an account that has permission to create developer credentials.
- On the Content page, click the My Content tab, then click New item and select Developer credentials.
3. Select API key credentials, then click Next.
4. Select Private application with selected privileges and access, then click Next.
5. Select No item access, then click Next.
6. Select Observability, then click Next.
7. Choose an expiration date and, optionally, a referrer URL, then click Next.
8. Add a title and, optionally, tags or a summary, then click Next.
9. Click Next.
10. Click Next.
An API key is issued. Store it in a secure location.
Access the Metrics API using curl
Use Windows curl.exe to access the Metrics API.
curl.exe -H "Authorization: Bearer <YOUR_API_KEY>" ^
https://<SERVER>:6443/arcgis/monitoring/metrics
Replace <YOUR_API_KEY> with the API key you generated and <SERVER> with the hostname of the target ArcGIS Server.
Here’s an example. The API key is redacted in the screenshot. In this example, the -k option is specified because of the certificate used in the test environment. Specifying -k
disables TLS certificate validation, so do not use it in production.
Review the retrieved metrics
The request succeeded, and metrics were returned in Prometheus’s text-based exposition format. In this environment, we were able to review information about ArcGIS Enterprise and the operating system, as well as values such as CPU usage, disk capacity, and available disk space.
An excerpt from the response is shown below.
# HELP about_information OS, arcgis, and infrastructure information
# TYPE about_information gauge
about_information{...} 1.0
# HELP cpu_percent CPU percent.
# TYPE cpu_percent gauge
cpu_percent{...} 0.0
# HELP disk_capacity_GB Disk storage capacity in GB
# TYPE disk_capacity_GB gauge
disk_capacity_GB{...} 199.04
# HELP disk_free_GB Disk free space in GB
# TYPE disk_free_GB gauge
disk_free_GB{...} 97.08
If the response displays “# HELP,” “# TYPE,” and metric names and values, the metrics have been successfully retrieved.
Summary
In this article, we used the ArcGIS Enterprise 12.1 Metrics API to retrieve metrics about ArcGIS Enterprise and its machines.
Using the Metrics API lets you continuously monitor system uptime, resource usage, and service response times, helping you detect problems early and maintain reliable operations. Use the Metrics API to make monitoring your ArcGIS Enterprise deployment more effective.
Related links
Esri U.S. website