HTTP Interface for Administration and Monitoring

This is an introduction to ArangoDB's HTTP interface for administration and monitoring of the server.

Read global logs from the server

returns the server logs

GET /_admin/log

Query Parameters

  • upto (optional): Returns all log entries up to log level upto. Note that upto must be:
  • fatal or 0
  • error or 1
  • warning or 2
  • info or 3
  • debug or 4 The default value is info.
  • level (optional): Returns all log entries of log level level. Note that the query parameters upto and level are mutually exclusive.
  • start (optional): Returns all log entries such that their log entry identifier (lid value) is greater or equal to start.
  • size (optional): Restricts the result to at most size log entries.
  • offset (optional): Starts to return log entries skipping the first offset log entries. offset and size can be used for pagination.
  • search (optional): Only return the log entries containing the text specified in search.
  • sort (optional): Sort the log entries either ascending (if sort is asc) or descending (if sort is desc) according to their lid values. Note that the lid imposes a chronological order. The default value is asc.

Returns fatal, error, warning or info log messages from the server's global log. The result is a JSON object with the following attributes:

A json document with these Properties is returned:

HTTP 200

  • lid (string): a list of log entry identifiers. Each log message is uniquely identified by its @LIT{lid} and the identifiers are in ascending order.
  • level: A list of the loglevels for all log entries.
  • timestamp (string): a list of the timestamps as seconds since 1970-01-01 for all log entries.
  • topic: a list of the topics of all log entries
  • text: a list of the texts of all log entries
  • totalAmount: the total amount of log entries before pagination.

Return Codes

  • 200:

Response Body

  • lid (string): a list of log entry identifiers. Each log message is uniquely identified by its @LIT{lid} and the identifiers are in ascending order. - level: A list of the loglevels for all log entries.
  • text: a list of the texts of all log entries
  • topic: a list of the topics of all log entries
  • timestamp (string): a list of the timestamps as seconds since 1970-01-01 for all log entries. - totalAmount: the total amount of log entries before pagination.

Return the current server loglevel

returns the current loglevel settings

GET /_admin/log/level

Returns the server's current loglevel settings. The result is a JSON object with the log topics being the object keys, and the log levels being the object values.

Return Codes

  • 200: is returned if the request is valid
  • 500: is returned if the server cannot generate the result due to an out-of-memory error.

Modify and return the current server loglevel

modifies the current loglevel settings

PUT /_admin/log/level

Modifies and returns the server's current loglevel settings. The request body must be a JSON object with the log topics being the object keys and the log levels being the object values.

The result is a JSON object with the adjusted log topics being the object keys, and the adjusted log levels being the object values.

It can set the loglevel of all facilities by only specifying the loglevel as string without json.

Possible loglevels are:

  • FATAL - There will be no way out of this. ArangoDB will go down after this message.
  • ERROR - This is an error. you should investigate and fix it. It may harm your production.
  • WARNING - This may be serious application-wise, but we don't know.
  • INFO - Something has happened, take notice, but no drama attached.
  • DEBUG - output debug messages
  • TRACE - trace - prepare your log to be flooded - don't use in production.

A JSON object with these properties is required:

  • audit-service: One of the possible loglevels.
  • cache: One of the possible loglevels.
  • syscall: One of the possible loglevels.
  • communication: One of the possible loglevels.
  • audit-authentication: One of the possible loglevels.
  • agencycomm: One of the possible loglevels.
  • startup: One of the possible loglevels.
  • general: One of the possible loglevels.
  • cluster: One of the possible loglevels.
  • audit-view: One of the possible loglevels.
  • collector: One of the possible loglevels.
  • audit-documentation: One of the possible loglevels.
  • engines: One of the possible loglevels.
  • trx: One of the possible loglevels.
  • mmap: One of the possible loglevels.
  • agency: One of the possible loglevels.
  • authentication: One of the possible loglevels.
  • memory: One of the possible loglevels.
  • performance: One of the possible loglevels.
  • config: One of the possible loglevels.
  • authorization: One of the possible loglevels.
  • development: One of the possible loglevels.
  • datafiles: One of the possible loglevels.
  • views: One of the possible loglevels.
  • ldap: One of the possible loglevels.
  • replication: One of the possible loglevels.
  • threads: One of the possible loglevels.
  • audit-database: One of the possible loglevels.
  • v8: One of the possible loglevels.
  • ssl: One of the possible loglevels.
  • pregel: One of the possible loglevels.
  • audit-collection: One of the possible loglevels.
  • rocksdb: One of the possible loglevels.
  • supervision: One of the possible loglevels.
  • graphs: One of the possible loglevels.
  • compactor: One of the possible loglevels.
  • queries: One of the possible loglevels.
  • heartbeat: One of the possible loglevels.
  • requests: One of the possible loglevels.

Return Codes

  • 200: is returned if the request is valid
  • 400: is returned when the request body contains invalid JSON.
  • 405: is returned when an invalid HTTP method is used.
  • 500: is returned if the server cannot generate the result due to an out-of-memory error.

Reloads the routing information

Reload the routing table.

POST /_admin/routing/reload

Reloads the routing information from the collection routing.

Return Codes

  • 200: Routing information was reloaded successfully.

Read the statistics

return the statistics information

GET /_admin/statistics

Returns the statistics information. The returned object contains the statistics figures grouped together according to the description returned by _admin/statistics-description. For instance, to access a figure userTime from the group system, you first select the sub-object describing the group stored in system and in that sub-object the value for userTime is stored in the attribute of the same name.

In case of a distribution, the returned object contains the total count in count and the distribution list in counts. The sum (or total) of the individual values is returned in sum.

Example:

shell> curl --dump - http://localhost:8529/_admin/statistics

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff

{ 
  "time" : 1516907617.8872316, 
  "enabled" : true, 
  "system" : { 
    "minorPageFaults" : 76569, 
    "majorPageFaults" : 183, 
    "userTime" : 2.21, 
    "systemTime" : 0.49, 
    "numberOfThreads" : 48, 
    "residentSize" : 426942464, 
    "residentSizePercent" : 0.02556949617048751, 
    "virtualSize" : 3208433664 
  }, 
  "client" : { 
    "httpConnections" : 1, 
    "connectionTime" : { 
      "sum" : 0, 
      "count" : 0, 
      "counts" : [ 
        0, 
        0, 
        0, 
        0 
      ] 
    }, 
    "totalTime" : { 
      "sum" : 12.890824556350708, 
      "count" : 4034, 
      "counts" : [ 
        3799, 
        145, 
        76, 
        10, 
        4, 
        0, 
        0 
      ] 
    }, 
    "requestTime" : { 
      "sum" : 0.030986785888671875, 
      "count" : 4034, 
      "counts" : [ 
        4033, 
        1, 
        0, 
        0, 
        0, 
        0, 
        0 
      ] 
    }, 
    "queueTime" : { 
      "sum" : 0.0002090930938720703, 
      "count" : 9, 
      "counts" : [ 
        9, 
        0, 
        0, 
        0, 
        0, 
        0, 
        0 
      ] 
    }, 
    "ioTime" : { 
      "sum" : 12.859628677368164, 
      "count" : 4034, 
      "counts" : [ 
        3800, 
        144, 
        76, 
        10, 
        4, 
        0, 
        0 
      ] 
    }, 
    "bytesSent" : { 
      "sum" : 1794760, 
      "count" : 4034, 
      "counts" : [ 
        304, 
        3392, 
        319, 
        19, 
        0, 
        0 
      ] 
    }, 
    "bytesReceived" : { 
      "sum" : 871054, 
      "count" : 4034, 
      "counts" : [ 
        3727, 
        307, 
        0, 
        0, 
        0, 
        0 
      ] 
    } 
  }, 
  "http" : { 
    "requestsTotal" : 4034, 
    "requestsAsync" : 9, 
    "requestsGet" : 1019, 
    "requestsHead" : 0, 
    "requestsPost" : 2794, 
    "requestsPut" : 70, 
    "requestsPatch" : 3, 
    "requestsDelete" : 148, 
    "requestsOptions" : 0, 
    "requestsOther" : 0 
  }, 
  "server" : { 
    "uptime" : 19.03903317451477, 
    "physicalMemory" : 16697335808, 
    "v8Context" : { 
      "available" : 4, 
      "busy" : 4, 
      "dirty" : 0, 
      "free" : 0, 
      "max" : 16 
    }, 
    "threads" : { 
      "running" : 8, 
      "working" : 4, 
      "blocked" : 0, 
      "queued" : 4 
    } 
  }, 
  "error" : false, 
  "code" : 200 
}

Return Codes

  • 200: Statistics were returned successfully.

Examples

shell> curl --dump - http://localhost:8529/_admin/statistics

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff

show response body

Statistics description

fetch descriptive info of statistics

GET /_admin/statistics-description

Returns a description of the statistics returned by /_admin/statistics. The returned objects contains an array of statistics groups in the attribute groups and an array of statistics figures in the attribute figures.

A statistics group is described by

  • group: The identifier of the group.
  • name: The name of the group.
  • description: A description of the group.

A statistics figure is described by

  • group: The identifier of the group to which this figure belongs.
  • identifier: The identifier of the figure. It is unique within the group.
  • name: The name of the figure.
  • description: A description of the figure.
  • type: Either current, accumulated, or distribution.
  • cuts: The distribution vector.
  • units: Units in which the figure is measured.

Example:

shell> curl --dump - http://localhost:8529/_admin/statistics-description

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff

{ 
  "groups" : [ 
    { 
      "group" : "system", 
      "name" : "Process Statistics", 
      "description" : "Statistics about the ArangoDB process" 
    }, 
    { 
      "group" : "client", 
      "name" : "Client Connection Statistics", 
      "description" : "Statistics about the connections." 
    }, 
    { 
      "group" : "http", 
      "name" : "HTTP Request Statistics", 
      "description" : "Statistics about the HTTP requests." 
    }, 
    { 
      "group" : "server", 
      "name" : "Server Statistics", 
      "description" : "Statistics about the ArangoDB server" 
    } 
  ], 
  "figures" : [ 
    { 
      "group" : "system", 
      "identifier" : "userTime", 
      "name" : "User Time", 
      "description" : "Amount of time that this process has been scheduled in user mode, measured in seconds.", 
      "type" : "accumulated", 
      "units" : "seconds" 
    }, 
    { 
      "group" : "system", 
      "identifier" : "systemTime", 
      "name" : "System Time", 
      "description" : "Amount of time that this process has been scheduled in kernel mode, measured in seconds.", 
      "type" : "accumulated", 
      "units" : "seconds" 
    }, 
    { 
      "group" : "system", 
      "identifier" : "numberOfThreads", 
      "name" : "Number of Threads", 
      "description" : "Number of threads in the arangod process.", 
      "type" : "current", 
      "units" : "number" 
    }, 
    { 
      "group" : "system", 
      "identifier" : "residentSize", 
      "name" : "Resident Set Size", 
      "description" : "The total size of the number of pages the process has in real memory. This is just the pages which count toward text, data, or stack space. This does not include pages which have not been demand-loaded in, or which are swapped out. The resident set size is reported in bytes.", 
      "type" : "current", 
      "units" : "bytes" 
    }, 
    { 
      "group" : "system", 
      "identifier" : "residentSizePercent", 
      "name" : "Resident Set Size", 
      "description" : "The percentage of physical memory used by the process as resident set size.", 
      "type" : "current", 
      "units" : "percent" 
    }, 
    { 
      "group" : "system", 
      "identifier" : "virtualSize", 
      "name" : "Virtual Memory Size", 
      "description" : "On Windows, this figure contains the total amount of memory that the memory manager has committed for the arangod process. On other systems, this figure contains The size of the virtual memory the process is using.", 
      "type" : "current", 
      "units" : "bytes" 
    }, 
    { 
      "group" : "system", 
      "identifier" : "minorPageFaults", 
      "name" : "Minor Page Faults", 
      "description" : "The number of minor faults the process has made which have not required loading a memory page from disk. This figure is not reported on Windows.", 
      "type" : "accumulated", 
      "units" : "number" 
    }, 
    { 
      "group" : "system", 
      "identifier" : "majorPageFaults", 
      "name" : "Major Page Faults", 
      "description" : "On Windows, this figure contains the total number of page faults. On other system, this figure contains the number of major faults the process has made which have required loading a memory page from disk.", 
      "type" : "accumulated", 
      "units" : "number" 
    }, 
    { 
      "group" : "client", 
      "identifier" : "httpConnections", 
      "name" : "Client Connections", 
      "description" : "The number of connections that are currently open.", 
      "type" : "current", 
      "units" : "number" 
    }, 
    { 
      "group" : "client", 
      "identifier" : "totalTime", 
      "name" : "Total Time", 
      "description" : "Total time needed to answer a request.", 
      "type" : "distribution", 
      "cuts" : [ 
        0.01, 
        0.05, 
        0.1, 
        0.2, 
        0.5, 
        1 
      ], 
      "units" : "seconds" 
    }, 
    { 
      "group" : "client", 
      "identifier" : "requestTime", 
      "name" : "Request Time", 
      "description" : "Request time needed to answer a request.", 
      "type" : "distribution", 
      "cuts" : [ 
        0.01, 
        0.05, 
        0.1, 
        0.2, 
        0.5, 
        1 
      ], 
      "units" : "seconds" 
    }, 
    { 
      "group" : "client", 
      "identifier" : "queueTime", 
      "name" : "Queue Time", 
      "description" : "Queue time needed to answer a request.", 
      "type" : "distribution", 
      "cuts" : [ 
        0.01, 
        0.05, 
        0.1, 
        0.2, 
        0.5, 
        1 
      ], 
      "units" : "seconds" 
    }, 
    { 
      "group" : "client", 
      "identifier" : "bytesSent", 
      "name" : "Bytes Sent", 
      "description" : "Bytes sents for a request.", 
      "type" : "distribution", 
      "cuts" : [ 
        250, 
        1000, 
        2000, 
        5000, 
        10000 
      ], 
      "units" : "bytes" 
    }, 
    { 
      "group" : "client", 
      "identifier" : "bytesReceived", 
      "name" : "Bytes Received", 
      "description" : "Bytes receiveds for a request.", 
      "type" : "distribution", 
      "cuts" : [ 
        250, 
        1000, 
        2000, 
        5000, 
        10000 
      ], 
      "units" : "bytes" 
    }, 
    { 
      "group" : "client", 
      "identifier" : "connectionTime", 
      "name" : "Connection Time", 
      "description" : "Total connection time of a client.", 
      "type" : "distribution", 
      "cuts" : [ 
        0.1, 
        1, 
        60 
      ], 
      "units" : "seconds" 
    }, 
    { 
      "group" : "http", 
      "identifier" : "requestsTotal", 
      "name" : "Total requests", 
      "description" : "Total number of HTTP requests.", 
      "type" : "accumulated", 
      "units" : "number" 
    }, 
    { 
      "group" : "http", 
      "identifier" : "requestsAsync", 
      "name" : "Async requests", 
      "description" : "Number of asynchronously executed HTTP requests.", 
      "type" : "accumulated", 
      "units" : "number" 
    }, 
    { 
      "group" : "http", 
      "identifier" : "requestsGet", 
      "name" : "HTTP GET requests", 
      "description" : "Number of HTTP GET requests.", 
      "type" : "accumulated", 
      "units" : "number" 
    }, 
    { 
      "group" : "http", 
      "identifier" : "requestsHead", 
      "name" : "HTTP HEAD requests", 
      "description" : "Number of HTTP HEAD requests.", 
      "type" : "accumulated", 
      "units" : "number" 
    }, 
    { 
      "group" : "http", 
      "identifier" : "requestsPost", 
      "name" : "HTTP POST requests", 
      "description" : "Number of HTTP POST requests.", 
      "type" : "accumulated", 
      "units" : "number" 
    }, 
    { 
      "group" : "http", 
      "identifier" : "requestsPut", 
      "name" : "HTTP PUT requests", 
      "description" : "Number of HTTP PUT requests.", 
      "type" : "accumulated", 
      "units" : "number" 
    }, 
    { 
      "group" : "http", 
      "identifier" : "requestsPatch", 
      "name" : "HTTP PATCH requests", 
      "description" : "Number of HTTP PATCH requests.", 
      "type" : "accumulated", 
      "units" : "number" 
    }, 
    { 
      "group" : "http", 
      "identifier" : "requestsDelete", 
      "name" : "HTTP DELETE requests", 
      "description" : "Number of HTTP DELETE requests.", 
      "type" : "accumulated", 
      "units" : "number" 
    }, 
    { 
      "group" : "http", 
      "identifier" : "requestsOptions", 
      "name" : "HTTP OPTIONS requests", 
      "description" : "Number of HTTP OPTIONS requests.", 
      "type" : "accumulated", 
      "units" : "number" 
    }, 
    { 
      "group" : "http", 
      "identifier" : "requestsOther", 
      "name" : "other HTTP requests", 
      "description" : "Number of other HTTP requests.", 
      "type" : "accumulated", 
      "units" : "number" 
    }, 
    { 
      "group" : "server", 
      "identifier" : "uptime", 
      "name" : "Server Uptime", 
      "description" : "Number of seconds elapsed since server start.", 
      "type" : "current", 
      "units" : "seconds" 
    }, 
    { 
      "group" : "server", 
      "identifier" : "physicalMemory", 
      "name" : "Physical Memory", 
      "description" : "Physical memory in bytes.", 
      "type" : "current", 
      "units" : "bytes" 
    } 
  ], 
  "error" : false, 
  "code" : 200 
}

Return Codes

  • 200: Description was returned successfully.

Examples

shell> curl --dump - http://localhost:8529/_admin/statistics-description

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff

show response body

Return role of a server in a cluster

Get to know whether this server is a Coordinator or DB-Server

GET /_admin/server/role

Returns the role of a server in a cluster. The role is returned in the role attribute of the result. Possible return values for role are:

  • SINGLE: the server is a standalone server without clustering
  • COORDINATOR: the server is a coordinator in a cluster
  • PRIMARY: the server is a primary database server in a cluster
  • SECONDARY: the server is a secondary database server in a cluster
  • AGENT: the server is an agency node in a cluster
  • UNDEFINED: in a cluster, UNDEFINED is returned if the server role cannot be determined.

Return Codes

  • 200: Is returned in all cases.

Return id of a server in a cluster

Get to know the internal id of the server

GET /_admin/server/id

Returns the id of a server in a cluster. The id is empty if it is working in single server mode.

Return Codes

  • 200: Is returned in all cases.

Queries statistics of DBserver

allows to query the statistics of a DBserver in the cluster

GET /_admin/clusterStatistics

Query Parameters

  • DBserver (required):

Return Codes

  • 200: is returned when everything went well.
  • 400: the parameter DBserver was not given or is not the ID of a DBserver
  • 403: server is not a coordinator.