K6 - lambda integration?

Hi,

I have requirement where I would like to use k6 to generate load by triggering lambda.

NOTE: Our lambda is triggered by kinesis stream and we don’t have an API gateway in between which we could call to generate load, neither we have an SQS?

Would like to know what would be the best approach to deal with such scenarios?

Thanks.

Hi @justin-thomas-cko-k6

Apologies for the delay in responding, and thanks for raising this question.

We just released in AWS jslib support for SQS (not documented yet though), as you probably saw, but can’t use.

We do have also a recent pull request, not sure if it came from your team, to support Kinesis . Would that be enough for your needs? If that’s the case let me know and I’ll find out what’s the status.

Cheers!

Thanks @eyeveebe for the your reply.

Since I raised my question, our approach has changed a bit in which we are now sending data to kinesis stream via HTTP and support Kinesis looks like something that would help us do exactly that. I’ll take a look into it and update if the solution worked for us.

Thanks again.

1 Like

Also @eyeveebe : would be great to know if there is any estimate on when support Kinesis would be merged?

Hi @justin-thomas-cko-k6

While I double-check if we have an estimation to release this, it might be a good idea to take it for a spin from your side. If you are not already on it.

@mstoykov suggested to replace ../build/kinesis.js in the kinesis.js example with the url of the build that is currently https://raw.githubusercontent.com/grafana/k6-jslib-aws/56d0d2a6ed4b87910475dac9413abb20705c8751/build/kinesis.js.

While also setting the AWS environment variables:

const awsConfig = new AWSConfig({
    region: __ENV.AWS_REGION,
    accessKeyId: __ENV.AWS_ACCESS_KEY_ID,
    secretAccessKey: __ENV.AWS_SECRET_ACCESS_KEY,
    sessionToken: __ENV.AWS_SESSION_TOKEN,
})

If anything does not work for you, we can look into it. And we’ll also understand if the support provided is sufficient for your case.

We’ll keep you posted.

Cheers!

Hi @justin-thomas-cko-k6

I discussed this with @oleiade and the contributor for that PR has been somewhat irresponsive recently. Currently Théo’s plan is to merge and refactor it in a couple of weeks time. We hope that works for you.

If you could check if the features you need are already in the PR (internal/kinesis.ts) that would be a tremendous help for us when planning. Let us know your feedback!

Cheers!

Hi @eyeveebe ,

I did try out the code from the PR (literally just took the minified files related to kinesis) and tried creating a kinesis client and was able to perform a putRecords successfully.

So far haven’t encountered any functional issues and all looks good in general.

1 Like

Awesome, thanks for checking this @justin-thomas-cko-k6 !