Provide config and diagnostic details in API
Goal
Be able to discover important (or all non-secret) configuration options and other valuable details.
TODO / How to implement
-
Uptime (time from control container start) - /status
-
Current file system (aka thin clone manager) - /status
-
Compression ratio (in addition to disk size/usage) - /status
-
Clone size (in list) - /status
-
Snapshot size (in list) - /snapshots
-
Total size of clones - /status
-
Total size of snapshots - /status
-
Docker image (used for clones, see the global config) - /status
Return "N/A" if data cannot be provided, e.g. files-related details on LVM.
Use both physical and logical sizes (Used
and LogicalReferenced
) for clones and snapshots.
See also: https://gitlab.com/postgres-ai/platform/-/issues/156#data-thats-being-used
Example
{
"status": {
"code": "OK",
"message": "Instance is ready"
},
"fileSystem": {
"mode": "zfs",
"sizeHR": "192 MiB",
"freeHR": "164 MiB",
"usedHR": "28 MiB",
"dataSizeHR": "121 MiB",
"usedBySnapshotsHR": "183 KiB",
"compressRatio": 4.53
},
"expectedCloningTime": 0,
"numClones": 0,
"clones": [],
"pools": [
{
"name": "oldest5",
"mode": "zfs",
"dataStateAt": "",
"status": "active",
"cloneList": [],
"disk": {
"size": 201278976,
"free": 171785728,
"used": 29493248,
"usedBySnapshots": 187392,
"usedByChildren": 244224,
"dataSize": 127020544,
"compressRatio": 4.53
}
}
],
"retrieving": {
"mode": "",
"status": "finished",
"nextRefresh": "2021-08-26T12:15:00Z",
"alerts": {
"refresh_skipped": {
"level": "warning",
"message": "Pool to perform full refresh not found. Skip refreshing",
"lastSeen": "2021-08-26T12:10:00.001036446Z",
"count": 1
}
}
},
"provisioner": {
"dockerImage": "postgresai/extended-postgres:11",
"containerConfig": {
"shm-size": "256MB"
}
},
"startedAt": "2021-08-26T12:09:50Z"
}