Back to Collection Items
var
http: TChilkatHttp;
success: Integer;
sbResponseBody: TChilkatStringBuilder;
begin
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http := TChilkatHttp.Create(Self);
http.SetRequestHeader('x-api-secret','{{logApiSecret}}');
http.SetRequestHeader('x-api-key','{{logApiKey}}');
sbResponseBody := TChilkatStringBuilder.Create(Self);
success := http.QuickGetSb('https://<tenant-name>.forgeblocks.com/monitoring/prometheus/idm',sbResponseBody.ControlInterface);
if (success = 0) then
begin
Memo1.Lines.Add(http.LastErrorText);
Exit;
end;
Memo1.Lines.Add('Response status code = ' + IntToStr(http.LastStatus));
Memo1.Lines.Add(sbResponseBody.GetAsString());
Curl Command
curl -X GET
-H "x-api-key: {{logApiKey}}"
-H "x-api-secret: {{logApiSecret}}"
https://<tenant-name>.forgeblocks.com/monitoring/prometheus/idm
Postman Collection Item JSON
{
"name": "Get Prometheus Metrics (IDM)",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200.\", () => {",
" pm.expect(pm.response.code).to.eql(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [
{
"key": "x-api-key",
"type": "text",
"value": "{{logApiKey}}"
},
{
"key": "x-api-secret",
"type": "text",
"value": "{{logApiSecret}}"
}
],
"url": {
"raw": "{{platformUrl}}/monitoring/prometheus/idm",
"host": [
"{{platformUrl}}"
],
"path": [
"monitoring",
"prometheus",
"idm"
]
},
"description": "AM prometheus metrics"
},
"response": [
{
"name": "Prometheus metrics for all AM pods",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/metrics/prometheus/am",
"host": [
"{{baseUrl}}"
],
"path": [
"metrics",
"prometheus",
"am"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": "# HELP am_cts_task_queue_size number of operations waiting in a CTS queue\n# TYPE am_cts_task_queue_size gauge\nam_cts_task_queue_size{kubernetes_pod_name=\"am-568cc4fbb6-cjnpg\",} 0.0"
}
]
}