Metric view
Metric views provide time series data from ingested metrics suitable for inclusion in rendered charts. A single view may contain multiple related series.
Part of the API reference collection
This page is part of the Crunchy Bridge API reference, and primarily meant to act as an exhaustive guide for technical integrations which are already in progress. To understand the basics of using the API, see API concepts and getting started.
Get metric view
Get a metric view.
GET /metric-views/{name}
Request
Path parameters
name
: Identifying name of the metric view.
Query parameters
Name | Required | Type | Description |
---|---|---|---|
begin | string | Begin time of the window with which to return metric results over. Should be a timestamp formatted as RFC3339.
A window must be at least one minute. | |
cluster_id | ✔ | string | The ID of the cluster to retrieve metrics for. |
end | string | End time of the window with which to return metric results over. Should be a timestamp formatted as RFC3339. Must be greater than
| |
period | string | Specifies the duration of a window of time to return, starting from the present time and going backwards in time. For example, a value Enum | |
resolution_multiplier | integer | A resolution multipler to apply so that more points are returned as part of each series. Each period gets a default "resolution", which is a number of points that are returned with it, and which fit evenly into its total duration. The default resolution multipler is 1, but a larger one can be specified to get more points returned. This may be useful for when a chart is being expanded to be displayed on a larger screen for example. Available resolutions are a coarse "order of magnitude" sequence, so only values of 1, 2, 4, and 8 are currently supported. Enum |
cURL example
curl -X GET https://api.crunchybridge.com/metric-views/{name}
-H "Authorization: Bearer $CRUNCHY_API_KEY"
Response
Status: 200
Response containing a metric view.
Content type: application/json
Name | Nullable | Type | Description |
---|---|---|---|
name | enum string | Identifying name of the metric view. Enum | |
series | array of array | Time series data included in this view. Views may have one or more series depending on the view. Each series has a name a number of associated data points. If there are multiple series, they'll always have the same number of data points at the same timestamps. |
Example
{
"events": [
{
"created_at": "2021-07-11T01:03:03Z",
"kind": "cluster.failover_started"
},
{
"created_at": "2021-07-11T01:05:03Z",
"kind": "cluster.failover_finished"
}
],
"name": "postgres-connections",
"series": [
{
"is_empty": false,
"max": null,
"min": null,
"name": "postgres-connections",
"points": [
{
"period_begin": "2021-07-11T01:02:03Z",
"period_end": "2021-07-11T01:03:03Z",
"time": "2021-07-11T01:02:03Z",
"value": 100
},
{
"period_begin": "2021-07-11T01:03:03Z",
"period_end": "2021-07-11T01:04:03Z",
"time": "2021-07-11T01:03:03Z",
"value": 105
},
{
"period_begin": "2021-07-11T01:04:03Z",
"period_end": "2021-07-11T01:05:03Z",
"time": "2021-07-11T01:04:03Z",
"value": 110
},
{
"period_begin": "2021-07-11T01:05:03Z",
"period_end": "2021-07-11T01:06:03Z",
"time": "2021-07-11T01:05:03Z",
"value": 115
},
{
"period_begin": "2021-07-11T01:06:03Z",
"period_end": "2021-07-11T01:07:03Z",
"time": "2021-07-11T01:06:03Z",
"value": 120
}
],
"title": "Number of connected Postgres clients",
"unit": null
}
]
}