I’m new to K6 and javascript.
I need to get some ‘Amazon CloudWatch’ Metrics in my K6 performance test suite.
Followed the steps given in HTTP Authentication, but it doesn’t work.
Is there any other way to send AWS request using AWS Signature in K6
Which k6 version are you using? (Output of k6 version)
AFAIK that’s the only way to authenticate with v4 in k6.
When you say “it doesn’t work”, what exactly doesn’t work? What steps did you take, what errors did you receive, etc.? It’s difficult to help you without being able to reproduce the issue.
I wish to share the good news with u. This sample code is working fine with the execute-api service. Hope it can get released as part of the k6 jslib soon.
However, this is some change to handle if no using serviceSubdomain with different target (or host) in the code signWithHeaders function
I did not understand what you meant, but neither serviceSubdomain nor target are required parameters (as far as I remember, I haven’t had time to look at that code in some time)
Do you mean that you want to make the request against not the domain that AWS is usually at? I haven’t considered this option and likely we will need even more arguments to the function to support that - please write it in the PR and I am welcoming contributions