Metrics

[BETA] Get aggregated metered requests for a given time period.

Changed on

Enterprise feature

[BETA] This API is in beta state, which means it may change or be removed in the future.

Gets metered requests count for the selected period, either aggregated by day or by month.

get/api/admin/metrics/request

Request

  • Base URL
    https://app.unleash-instance.example.com
  • URL
    https://app.unleash-instance.example.com/api/admin/metrics/request
  • Auth
    • API key in header Authorization
    • or HTTP bearer

Query parameters

grouping'daily' | 'monthly' required
Example:daily

Whether to aggregate the data by month or by day

fromstring date required
Example:2024-01-01

The starting date of the traffic data usage search in IS:yyyy-MM-dd format

tostring date required
Example:2024-01-31

The starting date of the traffic data usage search in IS:yyyy-MM-dd format

Response

meteredRequestsSchema

grouping'monthly' | 'daily' required

Whether the data is aggregated by month or by day.

Example response

{
  "grouping": "monthly",
  "dateRange": {
    "from": "2023-04-01",
    "to": "2023-04-30"
  },
  "apiData": [
    {
      "meteredGroup": "default",
      "dataPoints": [
        {
          "period": "2023-04-01",
          "requests": 1200
        }
      ]
    }
  ]
}

Changes