Is there a Gatling equivalent to the JMeter CSV log file (.JTL)

3.14.3
Gatling flavor: [X ] java kotlin scala javascript typescript
Gatling build tool: [ X] maven gradle sbt bundle npm

I am likely to be using Gatling for an upcoming project. I had used JMeter in the prior project at this client.

The prior project and the new one are both focused on testing microservices via the AWS APIGW. In JMeter, I had implemented logic to add custom fields into the CSV transaction log (.JTL file). I included the response headers from AWS providing the unique APIGW request id, and also the X-Ray trace id.

That allowed me to fully correlate each request to the associated backend AWS logs and then determine how much added latency was occurring at each layer in the application.

Is there something similar to this log in Gatling? Obviously, I could write custom Java code to capture the response information and log it, but I don’t want to needlessly reinvent the wheel.

Plus, if I wrote my own logging code, I would need to be very careful about not blocking the Gatling threads and thus ruining the load test scalability.

The Gatling simulation.log seems like it might be akin to the JTL file, but it is a proprietary internal Gatling format - the FAQ says we are not supposed to try to parse it on our own.

Thanks in advance for your support!

JMeter user.properties file
sample_variables=traceid,apigwReqid

JSR223 PostProcessor for JMeter AWS enhanced logging:

String respHdrs =  prev.getResponseHeaders()
// x-amzn-RequestId: 8143c118-b21e-427d-9a0f-f8bbaba2c130
// X-Amzn-Trace-Id: Root=1-667491a5-d17d7e2b37a3f20371113561

if (respHdrs) {
    def matches = (respHdrs =~ /X-Amzn-Trace-Id: Root=(.*)/)
    if (matches.size() > 0) {
        traceid = matches[0][1]
        vars.put('traceid', "${traceid}" )
    }
    else {
        vars.put('traceid', "NONE" )
        }
    def matchesReqid = (respHdrs =~ /x-amzn-RequestId: (.*)/)
    if (matchesReqid.size() > 0) {
        def apigwReqid = matchesReqid[0][1]
        vars.put('apigwReqid', "${apigwReqid}" )
    }
    else {
        vars.put('apigwReqid', "NONE" )
        }    
}

Is there a Gatling equivalent to the JMeter CSV log file (.JTL)

No, there isn’t.

Then, I’m wondering if Open Telemetry tracing would solve this. Maybe something we’ll consider for Gatling Enterprise.

1 Like