Every service exposes the /state/v1
API - use
vespa-model-inspect to find ports,
see the multinode-HA
sample application for practical examples.
HTTP request | state/v1 operation | Description |
---|---|---|
GET |
|
|
Service config generation |
/state/v1/config In the response, config has a mandatory generation and one or more <service> elements:
Note: Other configuration elements can also be added as a service. A <service> has a mandatory generation. An optional message can be returned. Example: |
|
Service version |
/state/v1/version Returns a mandatory service version. Example: |
|
Service health |
/state/v1/health
Returns the service status,
with time, status and metrics.
Metrics contains Example: |
|
Service metrics |
/state/v1/metrics
Same as A metric has a name and values, and can have a description and a set of dimensions: |
|
Service metric histograms |
/state/v1/metrics/histograms See histograms for usage. The histograms are implemented using HdrHistogram, and the CSV result is what that library generates. |
Non-exhaustive list of status codes:
Code | Description |
---|---|
200 | OK. |
Responses are in JSON format, with the following fields:
Element | Parent | Type | Description |
---|---|---|---|
config |
Object | Root element for /state/v1/config. | |
generation |
config | Number | The generation number is the number for the config that is active in the application. |
message |
config | String | An info or error message. |
version |
String | Vespa version. | |
time |
Number | Epoch in microseconds. | |
status |
Object | ||
code |
status | String |
Service status code - one of:
Containers with the query API enabled return |
message |
status | String | Message is optional - it is normally empty if the service is up, while it is set to a textual reason for why it is unavailable, if so. |
metrics |
Object | Snapshot of metric values. | |
snapshot |
metrics | Object | Time period for metrics snapshot. |
from |
snapshot | Number | Epoch in seconds, with microseconds fraction. |
to |
snapshot | Number | Epoch in seconds, with microseconds fraction. |
values |
metrics | Array | Array of metric objects. |
name |
values | String | Metric name. |
description |
values | String | Textual description of the metric. |
dimensions |
values | Object | Set of dimension name/value pairs. |
values |
values | Object | Set of metric values. |
average |
values | Number | Average metric value, typically sum divided by count. |
sum |
values | Number | Sum of metric values in snapshot. |
count |
values | Number | Number of times metric has been set. For instance in a metric counting number of operations done, it will give the number of operations added for that snapshot period. For a value metric, for instance latency of operations, the count will give how many times latencies have been added to the metric. |
last |
values | Number | Last metric value. |
max |
values | Number | Max metric value in snapshot. |
min |
values | Number | Min metric value in snapshot. |
rate |
values | Number | Metric rate: count divided by snapshot interval. |