Stats API
Access metrics collected by Apigee Edge that measure API consumption and performance that are used to build Analytics reports.
Resource Types
Metrics
Method | Endpoint | Description |
---|---|---|
get | /organizations/{org_name}/environments/{env_name}/stats | Get metrics per time interval for an organization and environment. If you are using Edge Microgateway with the analytics plugin enabled (default), API calls to Edge Microgateway are included in the count. If you have multiple organizations and environments, make this API call for each one and add them to get the total number of calls per time interval for your API program. To convert the JSON response to a CSV format for use in spreadsheets, use a tool like https://json-csv.com/ For more granular metrics, use the Get metrics organized by dimensions API. For more information on the analytics management API, see Use the metrics APIs. You can also try the API Traffic Summarizer tool to get and graph traffic data by API proxy over a specific time range. Metrics The types of metrics you can retrieve (specifid by the For example, to get the average request size for your APIs, set the select query param as: To get metrics for the sum of policy errors, transactions per second, and the average request size, set the select query param as: Metrics API quotas Apigee Edge enforces a quota on the API calls. The quota is based on the backend system that handles the call:
If you exceed the call quota, this API returns an HTTP 429 response. Determine the backend system that handles the call by examining the response object. Every response object contains a metaData property that lists service that handled the call in the Source property. For example, for Postgres:
For BigQuery, the Source property is: |
get | /organizations/{org_name}/environments/{env_name}/stats/{dimension_name} | Gets metrics, groups them by dimensions, and filters the results. If you are using Edge Microgateway with the analytics plugin enabled (default), API calls to Edge Microgateway are included in results. For examples using this API, see Analytics command reference. Notes:
Metrics The types of metrics you can retrieve (specifid by the For example, to get the average request size for your APIs, set the select query param as: Note: If you want to use the Dimensions: Dimensions let you view metrics in meaningful groups. For example, instead of looking at total API traffic in your organization, you can see API traffic for each API proxy, for each app, for each developer, and more. For each dimension, you construct a request by adding the desired dimension in the URL after /stats. For example, to group metrics by API proxies, you'd use: You can specify multiple dimensions to the API, separated by commas. To group metrics by API proxy and target response code combinations, you'd comma-separate dimensions in the URL: For a description of all supported dimensions, see Dimensions. You can also include your own custom dimensions, as described in Analyze API message content using custom analytics. Here's an example that shows how to get the average response time (metric) for all API proxies (dimension) in an environment: Filters You can also apply filters to limit the data that's returned. For example, if you're getting message counts grouped by API proxies, you can add a filter that returns only metrics for API proxies that return 4xx or 5xx status codes. Use any available dimensions or metrics to build your filters. For more information on filters and the operators you can use, see filters. Metrics API quotas Apigee Edge enforces a quota on the API calls. The quota is based on the backend system that handles the call:
If you exceed the call quota, this API returns an HTTP 429 response. Determine the backend system that handles the call by examining the response object. Every response object contains a metaData property that lists service that handled the call in the Source property. For example, for Postgres:
For BigQuery, the Source property is: |