Back to Collection Items
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
Boolean iSuccess
Variant vSbResponseBody
Handle hoSbResponseBody
String sTemp1
Integer iTemp1
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
Send ComSetRequestHeader To hoHttp "x-api-secret" "{{logApiSecret}}"
Send ComSetRequestHeader To hoHttp "x-api-key" "{{logApiKey}}"
Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
Send CreateComObject of hoSbResponseBody
End
Get pvComObject of hoSbResponseBody to vSbResponseBody
Get ComQuickGetSb Of hoHttp "https://<tenant-name>.forgeblocks.com/monitoring/prometheus/am" vSbResponseBody To iSuccess
If (iSuccess = False) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComLastStatus Of hoHttp To iTemp1
Showln "Response status code = " iTemp1
Get ComGetAsString Of hoSbResponseBody To sTemp1
Showln sTemp1
End_Procedure
Curl Command
curl -X GET
-H "x-api-key: {{logApiKey}}"
-H "x-api-secret: {{logApiSecret}}"
https://<tenant-name>.forgeblocks.com/monitoring/prometheus/am
Postman Collection Item JSON
{
"name": "Get Prometheus Metrics (AM)",
"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",
"value": "{{logApiKey}}",
"type": "text"
},
{
"key": "x-api-secret",
"value": "{{logApiSecret}}",
"type": "text"
}
],
"url": {
"raw": "{{platformUrl}}/monitoring/prometheus/am",
"host": [
"{{platformUrl}}"
],
"path": [
"monitoring",
"prometheus",
"am"
]
},
"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"
}
]
}