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

NameRequiredTypeDescription
cluster_idstring
endstring
periodenum string

Enum 12h, 15m, 1d, 1h, 24h, 3h, 60m, or 6h.

resolution_multiplierenum integer

Enum 1, 2, 4, or 8.

startstring

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

NameNullableTypeDescription
nameenum string

Identifying name of the metric view.

Enum cpu, disk-usage, iops, load-average, memory, or postgres-connections.

seriesarray 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

{
    "name": "postgres-connections",
    "series": [
        {
            "is_empty": false,
            "max": null,
            "min": null,
            "name": "postgres-connections",
            "points": [
                {
                    "time": "2021-07-11T01:02:03Z",
                    "value": 100
                },
                {
                    "time": "2021-07-11T01:04:03Z",
                    "value": 105
                },
                {
                    "time": "2021-07-11T01:05:03Z",
                    "value": 110
                },
                {
                    "time": "2021-07-11T01:06:03Z",
                    "value": 115
                },
                {
                    "time": "2021-07-11T01:07:03Z",
                    "value": 120
                }
            ],
            "title": "Number of connected Postgres clients",
            "unit": null
        }
    ]
}