getMetricRegex is not limited by getAgentRegex for Calculator in JS
search cancel

getMetricRegex is not limited by getAgentRegex for Calculator in JS

book

Article ID: 380614

calendar_today

Updated On:

Products

CA Application Performance Management SaaS

Issue/Introduction

 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.*";

Resolution

- 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