Statistics

Endpoints

GET /servers/{server_id}/statistics

Query statistics.

Query PowerDNS internal statistics.

Parameters:
  • server_id (string) – The id of the server to retrieve

Query Parameters:
  • statistic (string) – When set to the name of a specific statistic, only this value is returned. If no statistic with that name exists, the response has a 422 status and an error message.

  • includerings (boolean) – “true” (default) or “false”, whether to include the Ring items, which can contain thousands of log messages or queried domains. Setting this to ”false” may make the response a lot smaller.

Example request:

GET /servers/{server_id}/statistics HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    List of Statistic Items

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "name": "string",
            "type": "string",
            "value": "string"
        },
        {
            "name": "string",
            "type": "string",
            "value": [
                {
                    "name": "string",
                    "value": "string"
                }
            ]
        },
        {
            "name": "string",
            "type": "string",
            "size": 1,
            "value": [
                {
                    "name": "string",
                    "value": "string"
                }
            ]
        }
    ]
    

  • 422 Unprocessable Entity – Returned when a non-existing statistic name has been requested. Contains an error message

  • default

    The input to the operation was not valid

    Example response:

    HTTP/1.1 default -
    Content-Type: application/json
    
    {
        "error": "string",
        "errors": [
            "string"
        ]
    }
    

Objects

The Statistics endpoint returns an array of objects that can be StatisticItem, MapStatisticItem or RingStatisticItem :

json StatisticItem : object

StatisticItem

Optional members:
name : string

Item name

type : string

set to “StatisticItem”

value : string

Item value

json MapStatisticItem : object

MapStatisticItem

Optional members:
name : string

Item name

type : string

Set to “MapStatisticItem”

value : array of SimpleStatisticItem

Named values

json RingStatisticItem : object

RingStatisticItem

Optional members:
name : string

Item name

size : integer

Ring size

type : string

Set to “RingStatisticItem”

value : array of SimpleStatisticItem

Named values

Both MapStatisticItem and RingStatisticItem objects contains an array of SimpleStatisticItem

json SimpleStatisticItem : object

SimpleStatisticItem

Optional members:
name : string

Item name

value : string

Item value