Access the metrics API

As an administrator, you can use the metrics API with PromQL queries to directly query and obtain raw metrics that can be used by third-party viewers or graphical applications, such as Grafana, that may be running inside or outside of your cluster.

The Prometheus monitoring system is used by the metrics API to collect these metrics from each GIS service pod and persist the information into a time-series database. The metrics viewer registers the metrics API as a data store, so it can query the metrics API to obtain usage statistics.

The metrics API is exposed in the usagestatistics API in the administrator directory. To access the metrics API, follow these steps:

  1. Go to the usagestatistics API in the administrator directory: https://organization.example.com/<context>/admin/usagestatistics.
  2. Click Rest Metrics API.

    The metrics API application opens on a new tab.

  3. Sign in to the Prometheus web page.

    By default, system generated credentials are used to sign in. Before you sign in to the Prometheus dashboard, configure your organization and update your credentials. To update these credentials, use the Update Credentials operation in admin/usagestatistics. The new password must be a minimum of eight characters and must contain at least one letter (A-Z, a-z), one number (0-9), and one special character.

Raw metrics collected by the metrics API

The raw metrics that are collected by the metrics API are described in the following table:

S.noMetric nameDescriptionType

1

requests

Requests that can be used to find the rate of requests.

Counter

2

requests_succeeded

Succeeded requests that can be used to find the rate of succeeded requests.

Counter

3

requests_failed

Failed requests that can be used to find the rate of failed requests.

Counter

4

requests_usage_timedout

Requests that are usage timed out that can be used to find the rate of usage timed out requests.

Counter

5

requests_wait_timedout

Requests that are wait timed out that can be used to find the rate of wait time-out requests.

Counter

6

requests_response_time_seconds

Response times in seconds.

Samples, observations, and counts are included in buckets of: 0.05, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10, and Inf.

Histogram

7

gp_job_wait_time_seconds

Time taken for a geoprocessing job to be selected for execution in seconds.

Samples, observations, and counts are included in buckets of: 0.05, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10, and Inf.

Histogram

Labels captured by the metrics API

Along with each raw metric collected by the metrics API, the labels described in the following table are also collected and can be used to query metrics from the metrics API using PromQL queries and result filters:

Label nameDescription

nodeName

The name of the machine with the service pod handling the request.

podName

The name of the service pod handling the request.

apiType

The API where the metric is collected.

The current possible value is service, which represents a service request.

folderName

The name of the folder where the service is created.

serviceName

The name of the service, including the folder name in which the service resides.

serviceType

The type of service, for example, a MapService or FeatureService.

Operation

The requested operation, for example, a query or export.

Note:

Operation information is only available for REST requests. SOAP requests only return a value of soap.

orgId

The organization ID.

username

The user name of the user making the request.