Anypoint Monitoring Archive API

(0 reviews)
Download Anypoint Monitoring collected metric data for APIs.

home

Overview

Anypoint Monitoring stores metrics from API in archive warehouse as data files for Titanium subscriptions. These data files may be retrieved using the monitoring archive API. Data files are organized in the warehouse in a hierarchy to allow discovery of data files by entity, type, and date. The hierarchy has the following levels:

  1. organization -- Anypoint organization that contains the API
  2. environment -- Anypoint environment within an organization containing the API
  3. entityType -- runtime entity type, such as API, within an environment that produced data. See below for a list of supported entity types.
  4. entityID -- runtime entity identifier for either API for the entity in the environment that produced data. Note that this identifier is created by the archive warehouse.
  5. fileType -- Anypoint Monitoring archives data using various file types. For example, API summary data are placed together in one set of data files while API IP metrics are placed in a separate set of data files. See below for a list of available file types
  6. year -- the year when the data is generated
  7. month -- the month when the data is generated
  8. dayOfMonth -- the day of month when the data is generated
  9. fileName -- data file name

To access the above hierarchy, monitoring archive API uses the following URL resource structure:

/organizations/{organization}/environments/{environment}/{entityType}/{entityID}/{fileType}/{year}/{month}/{dayOfMonth}/{fileName}

Entity Type

The following entity types are supported:

  • apis metrics for API instances
  • applications metrics for Mule applications
  • servers metrics for on-prem Mule servers
File Type

The following file types are supported:

  • raw non aggregated API metric data
  • summary pre-aggregated API metric data
  • ip for API instances only, pre-aggregated metric with top IPs
  • path for API instances only, pre-aggregated metrics with top request paths
  • logs for application logs

See Metric Data for more information about the structure of metric.

Note: File types are made available through Anypoint Monitoring releases. Consult with Anypoint Monitoring Release Notes on the latest availability for various file types.

API Authentication

To access this API, a caller must be given Anypoint Monitoring User permission in Anypoint Access Management. A caller with Anypoint Monitoring User permission first authenticate to the Anypoint Platform by using Anypoint Access Management's Login API with the caller's username and password. Once authenticated, use the bearer token returned by Anypoint Access Management in every API request header:

Request:

curl -X GET \
-H 'Authorization:bearer ea27ee48-43d3-4d63-a71c-e7cf3c9ff167' \
'https://monitoring.anypoint.mulesoft.com/monitoring/archive/api/v1/organizations/'

Response:
{
  "resources": [
    {"id":"dc8c810f-8ecd-4f3c-9d64-cab2021764d8"},
    {"id":"cf40d25b-5441-4fe3-8fb1-b0e2f51492b9"}
  ]
}

API Rate Limit

Archive API is rate limited for 60 total requests per minute. The caller may make the requests sequentially or concurrently. When the rate limit is exceeded, the caller receives a 429 HTTP response code. If HTTP response code 429 is received, please wait for 1 minute before retrying the request again.

Discovery And Download

Anypoint Monitoring continuously add data files of various types from different runtime entities in the archive warehouse. Use the monitoring archive API to discover the data files by navigating the URL resource structure hierarchy. Start with the Anypoint organization that contains the API. For example, to discover the data files for organization with id dc8c810f-8ecd-4f3c-9d64-cab2021764d8, make an API call to:

GET /monitoring/archive/api/v1/organizations/dc8c810f-8ecd-4f3c-9d64-cab2021764d8/environments

The API returns a list of environment ids for each environment in this organization containing archived data file.

{
  "resources": [
    {"id":"88bcd3de-d9c4-4677-8a86-6c0dd4cd486f"},
    {"id":"4b27db73-7f3b-4eb0-8f3c-3dbacc8de9c8"}
  ]
}

If an environment is not returned, it means there are no data files for that environment. Next, take one of the returned environment id values, append to the URL to navigate into the next level:

GET /monitoring/archive/api/v1/organizations/dc8c810f-8ecd-4f3c-9d64-cab2021764d8/environments/4b27db73-7f3b-4eb0-8f3c-3dbacc8de9c8

which returns a list of entity type ids, such as:

{
  "resources": [
    {"id":"apis"}
  ]
}

Repeat this process of using one of the returned ids, append to the URL and navigate down the hierarchy until day of month. E.g.

GET /monitoring/archive/api/v1/organizations/dc8c810f-8ecd-4f3c-9d64-cab2021764d8/environments/4b27db73-7f3b-4eb0-8f3c-3dbacc8de9c8/apis/120322/summary/2020/02/21

which returns a list of data files, each with an id, time of creation, and size. For example:

{
 "resources": [
   {
     "id": "5cbaf563-d91a-4970-8169-b7f90044a4f1.2020-03-05T21.26.part0.txt",
     "time": "2020-03-05T21:26:55Z",
     "size": 1934
   }, 
   {
     "id": "239cae2a-70bc-4738-b444-bfbd71404330.2020-03-05T22.26.part1.txt",
     "time": "2020-03-05T22:26:26Z",
     "size": 20312
   }
 ]
}

To download the data file, append the data file id to the URL path:

GET /monitoring/archive/api/v1/organizations/dc8c810f-8ecd-4f3c-9d64-cab2021764d8/environments/4b27db73-7f3b-4eb0-8f3c-3dbacc8de9c8/apis/120322/summary/2020/02/21/239cae2a-70bc-4738-b444-bfbd71404330.2020-03-05T22.26.part1.txt

Reviews