Refactor metric configurations for HTTP requests

- Restructured config to include 'http' with url and data fields for each metric. Added metrics 3 and 4 with specific data outputs.
This commit is contained in:
Jeroen De Meerleer 2024-06-03 19:48:39 +02:00
parent 51ab7bcde6
commit 48f121c759
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6

View File

@ -7,7 +7,24 @@ $config = [
],
'app_demo_metric2' => [
'help' => 'Help text for metric',
'httpurl' => 'http://example.com', // The url to get collected for the metric
'http' => [
'url' => 'http://example.com', // The url to get collected for the metric
'data' => 'responsebody' // The body is used as output
],
'jsonelem' => '0.metric',
],
'app_demo_metric3' => [
'help' => 'Help text for metric',
'http' => [
'url' => 'http://example.com', // The url to get collected for the metric
'data' => 'hasresponse' // If an error occured during request this will return 0, otherwise 1
],
],
'app_demo_metric4' => [
'help' => 'Help text for metric',
'http' => [
'url' => 'http://example.com', // The url to get collected for the metric
'data' => 'responsetime' // This will return the transfer time
],
],
];