I am using Datadog. I have some questions.
I am sending only 2 requests in default function: create and read. Both requests are contained in a separate group so I can segregate measurements over groups.
Here is the list of custom metrics I am using in the script:
let createFailRate = new Rate(‘Create failed requests’);
let readFailRate = new Rate(‘Read failed requests’);
let createDurationTrend = new Trend(‘Create requests duration’);
let readDurationTrend = new Trend(‘Read requests duration’);
let createWaitingTrend = new Trend(‘Create requests waiting’);
let readWaitingTrend = new Trend(‘Read requests waiting’);
let createBlockedTrend = new Trend(‘Create requests blocked’);
let readBlockedTrend = new Trend(‘Read requests blocked’);
let allErrors = new Counter(‘error_counter’);
Here is how I am using allErrors and other metrics:
createResult = http.post(‘URL’, requestBody, headers);
check(createResult, {
‘Create Asset Instance: is status 201’: (r) => r.status == 202,
});
if (createResult.status != 202) {
console.log(`create asset instance status: ${res.status}`);
if (createResult.status == 404) {
console.log(`status 404`);
allErrors.add(1, { errorType: '404 Error : Entry Not Found' });
}
else if (createResult.status == 500) {
console.log(`status 500`);
allErrors.add(1, { errorType: '500 Error : Internal server error' });
}
else if (createResult.status == 502) {
console.log(`status 502`);
allErrors.add(1, { errorType: '502 Error : Bad Gateway Error' });
}
else if (createResult.status == 503) {
console.log(`status 503`);
allErrors.add(1, { errorType: '503 Error : Service Unavailable Error' });
}
}
createFailRate.add(createResult.status != 202);
createDurationTrend.add(createResult.timings.duration);
createWaitingTrend.add(createResult.timings.waiting);
createBlockedTrend.add(createResult.timings.blocked);
I have some questions on how or maybe what metrics are sent, How to get what I want.
Q1: In Datadog I see k6. Read_requests_duration.95percentile metric and similar other 95 percentile metrics when I am configuring timeseries graph. How to get 75p, 90p, 99p for the trend metrics?
Q2: How do I get information regarding error occurred during script execution. I already have failed request trends for both requests types. I can’t get to see the error types in Datadog. I am not sure if this is a DD graph configuration issue or something I can do in the script or simple K6 is not sending the measurement. My objective is to get/see error count for each request type and error type. I am using heatmap to achieve this but I am only getting the count.