I have 5 hosts starting with <host1->. Each host has 2 metrics “<agent>:Certificate.*". My getAgentRegex is below. I want to test with only one host.
function getAgentRegex() {
return "SuperDomain|<host1>\|ClusterPerformanceMonitor\|Prometheus Agent\|(.*)";
}
If my getMetricRegex is below, I get 2 metrics. Correct.
function getMetricRegex() {
return "<Host>\\|Clusters\\|<host1>\\|Health\\<agent>:Certificate.*";
}
If my getMetricRegex is below, is it normal that I get 10 metrics? 8 metrics are not related to <host1>.
function getMetricRegex() {
return "<host>\\|Clusters\\|<host1>\\|Health\\|<agent>:Certificate.*";
- Array declaration made using square brackets.
- Updated Regular Expression for getAgentRegEx() to specify host, process, and agent.Specified the Prometheus Agent to narrow the search criteria.
- getMetricRegEx() did not need updating. The requests and success metrics are being collected. Also hardcoded agent name