ArangoDB's Monitoring operations.
Every function takes the pool as its first argument and returns the decoded
response body. See Arangox.API.Client for the options they all accept and
for what a 404 returns.
Summary
Functions
Get the global server logs (deprecated)
Get the global server logs (deprecated). Raises on error.
Get the global server logs
Get the global server logs. Raises on error.
Get the server log levels
Get the server log levels. Raises on error.
Get the metrics
Get the metrics. Raises on error.
Get the metrics (deprecated)
Get the metrics (deprecated). Raises on error.
Get recent API calls
Get recent API calls. Raises on error.
Get recent AQL queries
Get recent AQL queries. Raises on error.
Reset the server log levels
Reset the server log levels. Raises on error.
Set the server log levels
Set the server log levels. Raises on error.
Set the structured log settings
Set the structured log settings. Raises on error.
Get the statistics
Get the statistics. Raises on error.
Get the statistics description
Get the statistics description. Raises on error.
Get the structured log settings
Get the structured log settings. Raises on error.
Get the usage metrics
Get the usage metrics. Raises on error.
Functions
@spec log( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Get the global server logs (deprecated)
WARNING: This endpoint should no longer be used. It is deprecated from version 3.8.0 onward and removed in ArangoDB 4.0. Use
/_admin/log/entriesinstead, which provides the same data in a more intuitive and easier to process format.
Returns fatal, error, warning or info log messages from the server's global log. The result is a JSON object with the attributes described below.
This API can be turned off via the startup option --log.api-enabled. In case
the API is disabled, all requests will be responded to with HTTP 403. If the
API is enabled, accessing it requires admin privileges, or even superuser
privileges, depending on the value of the --log.api-enabled startup option.
Returns
Recorded against ArangoDB 3.12.10:
%{
"level" => [integer],
"lid" => [integer],
"text" => [string],
"timestamp" => [integer],
"topic" => [string],
"totalAmount" => integer
}
@spec log!( Arangox.conn(), keyword() ) :: term()
Get the global server logs (deprecated). Raises on error.
See log/1.
@spec log_entries( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Get the global server logs
Returns fatal, error, warning or info log messages from the server's global log. The result is a JSON object with the following properties:
- total: the total amount of log entries before pagination
- messages: an array with log messages that matched the criteria
This API can be turned off via the startup option --log.api-enabled. In case
the API is disabled, all requests will be responded to with HTTP 403. If the
API is enabled, accessing it requires admin privileges, or even superuser
privileges, depending on the value of the --log.api-enabled startup option.
Returns
Recorded against ArangoDB 3.12.10:
%{
"messages" => [%{
"date" => string,
"id" => integer,
"level" => string,
"message" => string,
"topic" => string
}],
"total" => integer
}
@spec log_entries!( Arangox.conn(), keyword() ) :: term()
Get the global server logs. Raises on error.
See log_entries/1.
@spec log_level( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Get the server log levels
Returns the server's current log level settings. The result is a JSON object with the log topics being the object keys, and the log levels being the object values.
This API can be turned off via the startup option --log.api-enabled. In case
the API is disabled, all requests will be responded to with HTTP 403. If the
API is enabled, accessing it requires admin privileges, or even superuser
privileges, depending on the value of the --log.api-enabled startup option.
Returns
Recorded against ArangoDB 3.12.10:
%{...} # 55 keys, among them "agency", "agencycomm", "agencystore", "aql", "arangosearch", "audit-authentication", "audit-authorization", "audit-collection"
@spec log_level!( Arangox.conn(), keyword() ) :: term()
Get the server log levels. Raises on error.
See log_level/1.
@spec metrics( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Get the metrics
Returns the instance's current metrics in Prometheus format. The returned document collects all instance metrics, which are measured at any given time and exposes them for collection by Prometheus.
The document contains different metrics and metrics groups dependent
on the role of the queried instance. All exported metrics are
published with a arangodb_ or rocksdb_ prefix to distinguish them
from other collected data.
The API then needs to be added to the Prometheus configuration file for collection.
Returns
Recorded against ArangoDB 3.12.10:
string
@spec metrics!( Arangox.conn(), keyword() ) :: term()
Get the metrics. Raises on error.
See metrics/1.
@spec metrics_v2( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Get the metrics (deprecated)
WARNING: The
GET /_admin/metricsandGET /_admin/metrics/v2endpoints return the same metrics since ArangoDB v3.10.0. The latter is deprecated and removed in v4.0.
Returns the instance's current metrics in Prometheus format. The returned document collects all instance metrics, which are measured at any given time and exposes them for collection by Prometheus.
The document contains different metrics and metrics groups dependent
on the role of the queried instance. All exported metrics are
published with a arangodb_ or rocksdb_ prefix to distinguish
them from other collected data.
The API then needs to be added to the Prometheus configuration file for collection.
Returns
Recorded against ArangoDB 3.12.10:
string
@spec metrics_v2!( Arangox.conn(), keyword() ) :: term()
Get the metrics (deprecated). Raises on error.
See metrics_v2/1.
@spec recent_api_calls( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Get recent API calls
Get a list of the most recent requests with a timestamp and the endpoint. In cluster deployments, the list contains only those requests that were submitted to the Coordinator you call this endpoint on. This feature is for debugging purposes.
You can control how much memory is used to record API calls with the
--server.api-recording-memory-limit startup option.
You can disable this and the /_admin/server/aql-queries endpoint
with the --log.recording-api-enabled startup option.
Whether API calls are recorded is independently controlled by the
--server.api-call-recording startup option.
The endpoint returns an empty list of calls if turned off.
Returns
Recorded against ArangoDB 3.12.10:
%{
"code" => integer,
"error" => boolean,
"result" => %{
"calls" => [%{
"database" => string,
"path" => string,
"requestType" => string,
"timeStamp" => string
}]
}
}
@spec recent_api_calls!( Arangox.conn(), keyword() ) :: term()
Get recent API calls. Raises on error.
See recent_api_calls/1.
@spec recent_aql_queries( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Get recent AQL queries
Get a list of the most recent AQL queries with a timestamp and information about the submitted query. In cluster deployments, the list contains only those queries that were submitted to the Coordinator you call this endpoint on. This feature is for debugging purposes.
You can control how much memory is used to record AQL queries with the
--server.aql-recording-memory-limit startup option.
You can disable this and the /_admin/server/api-calls endpoint
with the --log.recording-api-enabled startup option.
Whether AQL queries are recorded is independently controlled by the
--server.aql-query-recording startup option.
The endpoint returns an empty list of queries if turned off.
Returns
Recorded against ArangoDB 3.12.10:
%{
"code" => integer,
"error" => boolean,
"result" => %{
"queries" => [%{
"bindVars" => %{
"@collection" => string,
"vertex" => string
},
"database" => string,
"query" => string,
"timeStamp" => string
}]
}
}
@spec recent_aql_queries!( Arangox.conn(), keyword() ) :: term()
Get recent AQL queries. Raises on error.
See recent_aql_queries/1.
@spec reset_log_level( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Reset the server log levels
Revert the server's log level settings to the values they had at startup, as determined by the startup options specified on the command-line, a configuration file, and the factory defaults.
The result is a JSON object with the log topics being the object keys, and the log levels being the object values.
This API can be turned off via the startup option --log.api-enabled. In case
the API is disabled, all requests will be responded to with HTTP 403. If the
API is enabled, accessing it requires admin privileges, or even superuser
privileges, depending on the value of the --log.api-enabled startup option.
@spec reset_log_level!( Arangox.conn(), keyword() ) :: term()
Reset the server log levels. Raises on error.
See reset_log_level/1.
@spec set_log_level(Arangox.conn(), term(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
Set the server log levels
Modifies and returns the server's current log level settings. The request body must be a JSON string with a log level or a JSON object with the log topics being the object keys and the log levels being the object values.
If only a JSON string is specified as input, the log level is adjusted for the "general" log topic only. If a JSON object is specified as input, the log levels will be set only for the log topic mentioned in the input object, but preserved for every other log topic. To set the log level for all log levels to a specific value, it is possible to hand in the special pseudo log topic "all".
The result is a JSON object with all available log topics being the object keys, and the adjusted log levels being the object values.
Possible log levels are:
FATAL- Only critical errors are logged after which the arangod process terminates.ERROR- Only errors are logged. You should investigate and fix errors as they may harm your production.WARNING- Errors and warnings are logged. Warnings may be serious application-wise and can indicate issues that might lead to errors later on.INFO- Errors, warnings, and general information is logged.DEBUG- Outputs debug messages used in the development of ArangoDB in addition to the above.TRACE- Logs detailed tracing of operations in addition to the above. This can flood the log. Don't use this log level in production.
This API can be turned off via the startup option --log.api-enabled. In case
the API is disabled, all requests will be responded to with HTTP 403. If the
API is enabled, accessing it requires admin privileges, or even superuser
privileges, depending on the value of the --log.api-enabled startup option.
@spec set_log_level!(Arangox.conn(), term(), keyword()) :: term()
Set the server log levels. Raises on error.
See set_log_level/2.
@spec set_structured_log(Arangox.conn(), term(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
Set the structured log settings
Modifies and returns the server's current structured log settings.
The request body must be a JSON object with the structured log parameters
being the object keys and true or false object values, for either
enabling or disabling the parameters.
The result is a JSON object with all available structured log parameters being
the object keys, and true or false being the object values, meaning the
parameter in the object key is either enabled or disabled.
This API can be turned off via the startup option --log.api-enabled. In case
the API is disabled, all requests will be responded to with HTTP 403. If the
API is enabled, accessing it requires admin privileges, or even superuser
privileges, depending on the value of the --log.api-enabled startup option.
@spec set_structured_log!(Arangox.conn(), term(), keyword()) :: term()
Set the structured log settings. Raises on error.
See set_structured_log/2.
@spec statistics( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Get the statistics
WARNING: This endpoint should no longer be used. It is deprecated from version 3.8.0 onward and removed in ArangoDB v4.0. Use
GET /_admin/metricsinstead, which provides the data exposed by this API and a lot more.
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.
The transaction statistics show the local started, committed and aborted transactions as well as intermediate commits done for the server queried. The intermediate commit count will only take non zero values for the RocksDB storage engine. Coordinators do almost no local transactions themselves in their local databases, therefore cluster transactions (transactions started on a Coordinator that require DB-Servers to finish before the transactions is committed cluster wide) are just added to their local statistics. This means that the statistics you would see for a single server is roughly what you can expect in a cluster setup using a single Coordinator querying this Coordinator. Just with the difference that cluster transactions have no notion of intermediate commits and will not increase the value.
Returns
Recorded against ArangoDB 3.12.10:
%{
"client" => %{
"bytesReceived" => %{
"count" => integer,
"counts" => [integer],
"sum" => integer
},
"bytesSent" => %{
"count" => integer,
"counts" => [integer],
"sum" => integer
},
"connectionTime" => %{
"count" => integer,
"counts" => [integer],
"sum" => float
},
"httpConnections" => integer,
"ioTime" => %{
"count" => integer,
"counts" => [integer],
"sum" => float
},
"queueTime" => %{
"count" => integer,
"counts" => [integer],
"sum" => float
},
"requestTime" => %{
"count" => integer,
"counts" => [integer],
"sum" => float
},
"totalTime" => %{
"count" => integer,
"counts" => [integer],
"sum" => float
}
},
"clientUser" => %{
"bytesReceived" => %{
"count" => integer,
"counts" => [integer],
"sum" => integer
},
"bytesSent" => %{
"count" => integer,
"counts" => [integer],
"sum" => integer
},
"connectionTime" => %{
"count" => integer,
"counts" => [integer],
"sum" => float
},
"httpConnections" => integer,
"ioTime" => %{
"count" => integer,
"counts" => [integer],
"sum" => float
},
"queueTime" => %{
"count" => integer,
"counts" => [integer],
"sum" => float
},
"requestTime" => %{
"count" => integer,
"counts" => [integer],
"sum" => float
},
"totalTime" => %{
"count" => integer,
"counts" => [integer],
"sum" => float
}
},
"code" => integer,
"enabled" => boolean,
"error" => boolean,
"http" => %{
"requestsAsync" => integer,
"requestsDelete" => integer,
"requestsGet" => integer,
"requestsHead" => integer,
"requestsOptions" => integer,
"requestsOther" => integer,
"requestsPatch" => integer,
"requestsPost" => integer,
"requestsPut" => integer,
"requestsSuperuser" => integer,
"requestsTotal" => integer,
"requestsUser" => integer
},
"server" => %{
"physicalMemory" => integer,
"threads" => %{
"blocked" => integer,
"direct-exec" => integer,
"in-progress" => integer,
"queued" => integer,
"scheduler-threads" => integer
},
"transactions" => %{
"aborted" => integer,
"committed" => integer,
"dirtyReadOnly" => integer,
"intermediateCommits" => integer,
"readOnly" => integer,
"started" => integer
},
"uptime" => float,
"v8Context" => %{
"available" => integer,
"busy" => integer,
"dirty" => integer,
"free" => integer,
"max" => integer,
"memory" => [%{
"contextId" => integer,
"countOfTimes" => integer,
"heapMax" => integer,
"heapMin" => integer,
"invocations" => integer,
"tMax" => float
}],
"min" => integer
}
},
"system" => %{
"majorPageFaults" => integer,
"minorPageFaults" => integer,
"numberOfThreads" => integer,
"residentSize" => integer,
"residentSizePercent" => float,
"systemTime" => float,
"userTime" => float,
"virtualSize" => integer
},
"time" => float
}
@spec statistics!( Arangox.conn(), keyword() ) :: term()
Get the statistics. Raises on error.
See statistics/1.
@spec statistics_description( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Get the statistics description
WARNING: This endpoint should no longer be used. It is deprecated from version 3.8.0 onward and removed in ArangoDB v4.0. Use
GET /_admin/metricsinstead, which provides the data exposed by the statistics API and a lot more.
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: Eithercurrent,accumulated, ordistribution.cuts: The distribution vector.units: Units in which the figure is measured.
Returns
Recorded against ArangoDB 3.12.10:
%{
"code" => integer,
"error" => boolean,
"figures" => [%{
"description" => string,
"group" => string,
"identifier" => string,
"name" => string,
"type" => string,
"units" => string
}],
"groups" => [%{
"description" => string,
"group" => string,
"name" => string
}]
}
@spec statistics_description!( Arangox.conn(), keyword() ) :: term()
Get the statistics description. Raises on error.
@spec structured_log( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Get the structured log settings
Returns the server's current structured log settings.
The result is a JSON object with the log parameters being the object keys, and
true or false being the object values, meaning the parameters are either
enabled or disabled.
This API can be turned off via the startup option --log.api-enabled. In case
the API is disabled, all requests will be responded to with HTTP 403. If the
API is enabled, accessing it requires admin privileges, or even superuser
privileges, depending on the value of the --log.api-enabled startup option.
Returns
Recorded against ArangoDB 3.12.10:
%{}
@spec structured_log!( Arangox.conn(), keyword() ) :: term()
Get the structured log settings. Raises on error.
See structured_log/1.
@spec usage_metrics( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Get the usage metrics
Returns detailed shard usage metrics on DB-Servers.
These metrics can be enabled by setting the
--server.export-shard-usage-metrics startup option
to enabled-per-shard to make DB-Servers collect per-shard
usage metrics, or to enabled-per-shard-per-user to make DB-Servers collect
usage metrics per shard and per user whenever a shard is accessed.
Returns
Recorded against ArangoDB 3.12.10:
null
@spec usage_metrics!( Arangox.conn(), keyword() ) :: term()
Get the usage metrics. Raises on error.
See usage_metrics/1.