Skip to content

utils.extractDuration: improved json detection #276

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adambezecny
Copy link

the fact that log string checked by extractDuration function starts with curly bracket character does not mean this string is valid json. Because of this it is better to test via new function isValidJSON introduced in this PR.

The motivation behind this pull request is that we have seen executor lambda failures while testing our lambda. When investigating what is going on we found out the log captured by extractDurationFromJSON i not valid json that could be processed by current logic. See my comments and sample log data on issue 261.

using new json validation in this case enforces parsing by extractDurationFromText, not by extractDurationFromJSON which works in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant