-
Notifications
You must be signed in to change notification settings - Fork 22
Fix for https://github.com/Nordstrom/artillery-plugin-aws-sigv4/issues/13 #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
You would need to satisfy the linter but copying artillery implementation into this tool doesn't seem like the right solution here. @hassy has a set of issues that his breaking changes have caused. I have escalated that issue out of the deprecated |
@erikerikson agreed that if this can be fixed on artillery-core this would be the more ideal fix (beforeTemplate callback?). Fixed the linter issues, will keep this PR open until artillery-core has been patched. |
Thank you very much for offering this contribution. It is much appreciated! Sorry for the state of things. |
hello! |
@kenshih I've not had the time myself to look at this specific issue, but perhaps the changes in version 0.4.0 might resolve this as there was a move from |
@galvinhsiu I tried using your PR for my below template(where template vars are within the json section. Note: The issue happens for template vars within json, body or url sections) and it works only for 3 requests out of 60 that got fired. So, I guess the only way to properly fix this issue is to do the pre-processing in config:
plugins:
aws-sigv4:
serviceName: sagemaker
cloudwatch:
namespace: "sagemaker-map-example-loadtest"
target: https://runtime.sagemaker.us-west-2.amazonaws.com
phases:
- duration: 10
arrivalRate: 2
rampTo: 6
name: Warmup
- duration: 10
arrivalRate: 6
rampTo: 8
name: Max Load
scenarios:
- name: Invoke Sagemaker endpoint with random args
flow:
- post:
beforeRequest: addAmazonSignatureV4
headers:
content-type: application/json
url: /endpoints/Endpoint-fKDldNe2mm4J/invocations
json:
hotel_cluster_id: "{{ $randomNumber(1, 20) }}"
top_n: 5 My repo with your PR changes: @gwsii Do you know when the pre-processing logic would be included in the public version of |
Just found that |
Added the afterTemplateVarsSubstitution feature in https://github.com/vadivelselvaraj/artillery. If anyone's looking out to try that out, feel free to add An example script would be the below. config:
plugins:
aws-sigv4:
serviceName: sagemaker
cloudwatch:
namespace: "sagemaker-map-example-loadtest"
target: https://runtime.sagemaker.us-west-2.amazonaws.com
phases:
- duration: 10
arrivalRate: 2
rampTo: 6
name: Warmup
- duration: 10
arrivalRate: 6
rampTo: 8
name: Max Load
scenarios:
- name: Invoke Sagemaker endpoint with random args
flow:
- post:
afterTemplateVarsSubstitution: addAmazonSignatureV4
headers:
content-type: application/json
url: /endpoints/Endpoint-fKDldNe2mm4J/invocations
json:
hotel_cluster_id: "{{ $randomNumber(1, 20) }}"
top_n: 5 |
Hi, Did you have to have the instance aws profile creds to run the above. I have instance profile creds but getting an error "Missing Authentication Token" |
Closing this MR as there is another one which fixes #13 |
I was unable to get anything to work until using @vadivelselvaraj fork of artillery. It seems like the related PR's have been closed without merging. I assume it's an issue with artillery itself since I was able to use the regular latest (v0.0.5) of this plugin. |
Due to changes in artillery in the linked issue above, templating needs to be run prior to the calculation of the AWS V4 signature. The current newest stable branch of artillery triggers beforeRequest prior to template / variable substitution.
Took the changes from the artillery core (engine_util) and moved over the relevant functions to make it work. Ran through tests again execute-api and confirmed that the generated signatures are correct.