Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a result field to each Terraform execution metadata record (mapped to a result dynamic-type column in the terraform_metadata_main table) and fixes a gap where elapsed time was not recorded when a Terraform action failed mid-run. The fallback mechanism scrapes Still creating/destroying... log lines to capture the last known elapsed time when no completion line is found.
Changes:
- Added
COMPLETE_PATTERN(renamed fromPATTERN),START_PATTERN, andELAPSED_PATTERNregex constants to classify Terraform log lines. - Extracted record-building into a
build_result()helper that includes the newresult: { success: bool }field. - Modified
process_terraform_logsto track in-progress state and emit a failure record (withsuccess: false) when no completion line is found.
modules/python/terraform/extract_terraform_operation_metadata.py
Outdated
Show resolved
Hide resolved
modules/python/terraform/extract_terraform_operation_metadata.py
Outdated
Show resolved
Hide resolved
e8dae1a to
7eec062
Compare
7eec062 to
48bafbb
Compare
liyu-ma
commented
Mar 11, 2026
48bafbb to
a0a3dd1
Compare
wonderyl
reviewed
Mar 11, 2026
9e6d413 to
b3c2e03
Compare
wonderyl
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Context
We want to record terraform action success/failure or timeout error for stats purpose. Add logic to scan terraform logs to capture those info.
Change
resultto terraform execution metadata record two flags"success": true/falseand"timed_out": true/false }See

resultfield appended: