Skip to main content

postgresql_metrics

Creates, updates, deletes, gets or lists a postgresql_metrics resource.

Overview​

Namepostgresql_metrics
TypeResource
Idovh.public_cloud_database.postgresql_metrics

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
namestringName of the metric
metricsarrayMetric values for each host in the cluster
unitstringUnit of the metric values (BYTES, BYTES_PER_SECOND, GIGABYTES, GIGABYTES_PER_HOUR, MEGABYTES, MEGABYTES_PER_SECOND, MILLISECONDS, PERCENT, SCALAR, SCALAR_PER_SECOND, SECONDS, UNKNOWN)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectmetric_name, service_id, project_idperiodReturns the values of a metric for each node of the service, over the requested period. (Beta version)
listselectservice_id, project_idx_pagination_cursor, x_pagination_size, extendedReturns the metrics available for the service. Set extended to true to include engine-specific metrics. (Beta version)

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
metric_namestringMetric name (wire: metricName)
project_idstringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
service_idstring (uuid)Service ID (wire: serviceId)
extendedbooleanDisplay engine-specific metrics
periodstringTime period over which to retrieve metric values
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

Returns the values of a metric for each node of the service, over the requested period. (Beta version)

SELECT
name,
metrics,
unit
FROM ovh.public_cloud_database.postgresql_metrics
WHERE metric_name = '{{ metric_name }}' -- required
AND service_id = '{{ service_id }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND period = '{{ period }}'
;