I have a switch statement that selects one of about 20 APIs, can I configure a threshold with a variable and then the tag on the request parms to send a value for the threshold http_req_duration. metric
eg something like this in the init
page:auth is always called first
page:${pageTag} could be on of 20 different APIs, only one ever runs at a time
thresholds: {
'http_req_duration{page:auth}': ['p(95)<200'],
`http_req_duration{page:${pageTag}}`: ['p(95)<100']
}
Then in my PUT on each event assign a value to a variable then return tag page as that variable
var event = 'event_type'
const headers = {
'Content-Type': 'application/json', 'Authorization': `auth here`}
let response = http.put(`unique api call goes here/`,
JSON.stringify(eventList), {
headers,
tags: {
page: event
},
});
Is this possible so that my threshold config only needs one event duration output and the 20 events logic controls what to show?
Hopefully this makes sense, please ask questions if it does not.