We’re running K6 tests via AWS Batch Jobs that execute in containers on ECS. We run a minimum of two, the goal is to load test our application. We are sending metrics to a statsd-exporter so the metrics end up in prometheus in the end. The connection is all set up, it works, no issues, we were able to create ~40k connections.
The problem we’re facing are metrics. There is no depth to the metrics and the containers send the same metrics, so if we receive
k6.data_received with a value, the next container will send the same but with the different value so it gets overwritten. We also don’t know how many VUs we have globally, we can only tell the last metric persisted from a random container.
We tried adding
K6_SYSTEM_TAGS env variable with
vu included, didn’t change the metrics. We tried adding custom tags with
--tag BATCHJOBID=$AWS_BATCH_JOB_ID --tag, this also did not work.
The best solution would be if we would have a unique identifier / k6 container for the metric received, ex.
b5930e29-46b7-468c-bb43-9f8b2226f504 is the container identifier inside ECS.
Any RTFM or suggestions welcome.