added regex support and improved retrying #192
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added standard Java regex support to the trace templates we use for validation. Benefit is that for auto-generated strings like Lambda functions created with SAM, we can match partially for the deterministic portion of the name and regex match the random part. This can also let us check for the mere presence of fields in the retrieved trace even if we don't know what their values would be, by including the field with a value of
*
in the template. The drawbacks are that regex characters (*, ?, .) will now need to be escaped if we want to match them literally, which I've done by adding\\
for all existing periods (.
) in the templates.I've also changed the retry logic so that there are 2 levels of retries - at the top level we have 2 retries to call the sample app and generate trace data to handle the Lambda case where the first invocation might be a cold start and have an undesired extra subsegment. Inside that we have 5 retries to get trace data from the X-Ray service to ensure all expected segments are able to be retrieved. I've verified this works with the Lambda cold start and X-Ray SDK trace validations.
Also a couple other minor bug fixes.