Reference For: developers

API: metrics

Operations of the metrics tag of the native REST API.

Performance counters and samples of hosts, VMs and datastores (20 s realtime, 5 min to 1 day rollups)

GET /metrics/perf

Prometheus text exposition of the newest performance samples of every host, VM and datastore the caller can see (all of them for an anonymous scrape when metrics_anonymous is set).

CLI
kyvernon metrics prometheus

Responses

StatusDescriptionSchema
200Prometheus text format 0.0.4string
401Not authenticated, or the session is restricted (error.mfa_required, error.password_rotation_required)ErrorBody
503Temporarily unavailable (not the leader, or the service is off)ErrorBody

GET /v1/metrics/counters

Lists the counter catalogue.

CLI
kyvernon metrics counters

Responses

StatusDescriptionSchema
200OKarray of CounterView

GET /v1/metrics/entities/{id}/available

Counters (and instances) with data for an entity at an interval.

CLI
kyvernon metrics available <entity>

Parameters

NameInTypeRequiredDescription
idpathstringyesHost, VM or datastore id
intervalqueryinteger (int32) or nullSampling period: 20 (default for hosts and VMs), 300, 1800, 7200 or 86400.

Responses

StatusDescriptionSchema
200OKAvailableView
404Not found (or not visible to the caller)ErrorBody

GET /v1/metrics/intervals

Lists the sampling intervals and their collection levels.

CLI
kyvernon metrics intervals

Responses

StatusDescriptionSchema
200OKarray of IntervalView
503Temporarily unavailable (not the leader, or the service is off)ErrorBody

GET /v1/metrics/query

Queries samples (URL parameters).

CLI
kyvernon metrics query --entity <ids> --counter <names>

Parameters

NameInTypeRequiredDescription
entityquerystringyesComma-separated entity ids.
counterquerystringyesComma-separated counter names or ids.
intervalqueryinteger (int32) or nullSampling period.
startquerystring or nullExclusive start (RFC 3339).
endquerystring or nullInclusive end (RFC 3339).
instancequerystring or nullInstance selector ("", "*" or a name).
maxSamplesqueryinteger (int32) or nullNewest N samples per series.

Responses

StatusDescriptionSchema
200OKMetricsQueryResponse
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody

POST /v1/metrics/query

Queries samples.

Request body

application/json: MetricsQueryRequest

NameTypeRequiredDescription
countersarray of stringyesCounter names (cpu.usage.average) or ids ("2").
endstring or nullInclusive end (RFC 3339); default now.
entitiesarray of stringyesEntity ids (vm-42, host-1, datastore-3).
instancestring or null"" the aggregate (default), "*" every instance and the aggregate, or one instance.
intervalinteger (int32) or nullSampling period (20, 300, 1800, 7200, 86400); default 20 for hosts and VMs, 300 for datastores.
maxSamplesinteger (int32) or nullNewest N samples per series.
startstring or nullExclusive start (RFC 3339); default as far back as the interval keeps.

Responses

StatusDescriptionSchema
200OKMetricsQueryResponse
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody

Version 0.1.