—Rate this article—
 

Beta Release of SmartDocs

1. In the Resource URL, replace any values enclosed in "{}", such as your organization name.
2. Set the Basic Authentication credentials. These are your Edge credentials (user must be in the Org Admin role).
3. Tweak the Request Body as needed (if a body is needed).
4. Send the live request to Edge and view the response! You can also view Request data.

Retrieve and Filter Metrics for a Dimension

Resource Summary

Auth Type

BASICAUTH,

Content Type

application/json, text/xml

Category

Analytics,

updateReport

GET

Retrieve and Filter Metrics for a Dimension

Retrieve and filter metrics for a dimension.

Apigee Edge records and aggregates metrics for dimensions, where Edge defines 3 classes of dimensions:

  • Pre-computed, static dimensions used for operational dashboards.
  • Dynamic dimensions, whose metrics are computed 'on-demand' when a report is built.
  • Custom dimensions, which enable you to build reports based on message content.
For each type of dimension, you construct a request by adding the desired dimension by name as a URI parameter following /stats. The following dimensions are supported:

  • /apis
  • /apiproducts
  • /apps
  • /devs
  • /envs
For example:

/stats/apis

You can define queries against the collected metrics by specifying metrics, type of calculation to run, time range, and, optionally, any filters to use for drill-down into the data set that is returned by the query.

For pre-computed metrics, only simple calculations are needed, since the specific function used to perform the calculation is embedded in the metric.

To generate custom reports, you select a metric + function calculation to run over the specified dimensions.

The base request to create a custom report that calculates average response time for all APIs in an environment is:

/stats/apis?select=avg(total_response_time)
Use the additional query parameters defined in the API method to construct the complete request.

Filters can be applied to custom resources. Custom resources are:
Symbol Operation
in for list inclusion
notin for list exclusion
eq =
ne != or
gt >
lt <
ge >=
le <=

Sample filters
Description Filter query structure
Stats for API proxies named either api1 or api2 filter=(apiproxy in 'api1','api2')
Stats for all API proxies except api1 and api2 filter=(apiproxy notin 'ap1','api2')
Stats where there are no errors filter=(iserror eq 0)
Stats where there is no error messages or the API proxy name is api1 or api2 filter=(iserror eq 1) or (apiproxy in 'api1','api2')
Stats where (response code is either 201 or 301) and (there are errors) or (API proxy name is either api1 or api2) filter=(responsecode le 201 or responsecode eq 301)
and (iserror eq 1) or (apiproxy in 'api1','api2')

Resource URL

https://api.enterprise.apigee.com/v1 /organizations/{org_name}/environments/{env_name}/stats/{dimension_name}

    Query Parameters

  • Name
    Value
    Description
  • select
    (required)
    Designates the metric to be aggregated for the report. Supported metrics are: message_count, error_count, total_response_time, max_response_time, min_response_time, data_exchange_size, end_point_response_time.
  • timeRange
    (required)
    The start and end time for the desired interval. The date format is MM/DD/YYYY HH:MM. For example, 1/1/2013%2000:00~1/2/2013%2000:00
  • timeUnit
    (required)
    A value of second, minute, hour, day, week, month, quarter, year, decade, century, millennium.
  • sortby
    When two or more select values are specified, sortby can be used to specify the select used for sorting results: message_count, error_count, total_response_time, max_response_time, min_response_time, data_exchange_size, end_point_response_time.
  • sort
    Supported sort scopes are DESC or ASC.
  • topk
    Take 'top k' results from results, for example, to return the top 5 results 'topk=5'.
  • filter
    Enables drill-down on specific dimension values.
  • limit
    Set the limit for the number of entries returned by the API.
  • offset
    Use offset with limit to enable pagination of results. For example, to display results 11-20, set limit to '10' and offset to '10'.
  • realtime
    Lets you obtain real-time query data. When set to true, queries return recently arrived API traffic data when the user-submitted time range for the query is less than one hour.

    If set to false, then queries are taken from the default cloud data store, which results a delay in the availability of query data of up to three hours. This parameter overrides the accuracy query parameter setting.
  • accuracy
    Specify that queries return data either from the raw (non-sampled) API traffic data store or from a sample of the raw API data. Queries against sampled data sets are smaller than the raw data set, and therefore run faster. You can specify the following values for the accuracy query parameter:
    • 'accuracy=0': Retrieve query data from the raw API traffic.
    • 'accuracy=1': Retrieve query data from the 1% sampled traffic table; that is, the table that is 1% in size of the raw traffic table.
    • 'accuracy=10': Retrieve query data from the 10% sampled traffic table; that is, the table that is 1% in size of the raw traffic table. Note that the realtime query parameter overrides this parameter.

org_name Mention the organization name true

env_name Mention the environment name, such as test or prod true

dimension_name Mention the dimension name true

org_name Mention the organization name true

dimension_name Mention the dimension name true

org_name Mention the organization name true

dimension_name Mention the dimension name true

Basic Auth

OAuth 2

Custom Token

Reset

Make a request and see the response.

Make a request and see the response.

Working...

Help or comments?

  • Something's not working: See Apigee Support
  • Something's wrong with the docs: Click Send Feedback in the lower right.
    (Incorrect? Unclear? Broken link? Typo?)