-
Notifications
You must be signed in to change notification settings - Fork 57
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
Fix issue: Wrong duration for DB transaction event on ROR 7.1 #92 #96
Conversation
the latest macos-14 supports arm only. This PR using the previous version of macos image to unblock the release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The PR is to address DB subsegment timestamp issue in rails version larger than 7. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at my comments.
I believe you can check for rails version like:
if Rails::VERSION::MAJOR >= 7
# Do the new thing
else
# Do it the old way
end
…s only for rails 7.1 versions.
TY, can you update |
@jj22ee How do you suggest. should we do something like this subsegment.start_time = (::Rails::VERSION::MAJOR == 7 and ::Rails::VERSION::MINOR == 1) ? convert_time_in_seconds(transaction.time.to_f) : transaction.time.to_f or subsegment.start_time = (::Rails::VERSION::MAJOR == 7 and ::Rails::VERSION::MINOR == 1) ? transaction.time.to_f / 1000 : transaction.time.to_f |
I am in favour of the first one because the changes are being back ported to some rails 7.1 version so I think its not a good idea to just divide by 1000 without checking. Like has been back ported to 7-1-stable rails/rails#50493 (comment) https://api.rubyonrails.org/v5.1/classes/Rails/VERSION.html subsegment.start_time = (::Rails::VERSION::MAJOR == 7 and ::Rails::VERSION::MINOR == 1) ? convert_time_in_seconds(transaction.time.to_f) : transaction.time.to_f |
Can you provide some test results for Rails v7, v7.1, v7.2 for your change? |
We can see here that the fix is applied in 7.1-stable branch here |
@jj22ee . The issue is still there for the available versions of 7.1.x.y of rails . |
* Add ECS metadata allowing cloudwatch-logs to be linked with traces (aws#93) * First step * Add comment * Typo * Copy logic of EC2 plugin for ECS * Typo * Back to symbols * Copy paste all EC2 tests as starting point for ECS * Comments * Somewhat working ? * Backword compatible with prevous feature when not 1.4 * Add hint for fargate 1.4 in case of errors --------- Co-authored-by: Etienne Chabert <[email protected]> * release 0.15.0 (aws#94) * Update version for 0.15.0 release (aws#95) * Update continuous-build.yml (aws#97) the latest macos-14 supports arm only. This PR using the previous version of macos image to unblock the release. * Fix issue: Wrong duration for DB transaction event on ROR 7.1 aws#92 (aws#96) * Fix issue: Wrong duration for DB transaction event on ROR 7.1 aws#92 * Added unit tests and restructured the code * Fix unit tests * Update continuous-build.yml (aws#97) the latest macos-14 supports arm only. This PR using the previous version of macos image to unblock the release. * Worked on the jj22ee's comment and added logic that convert in seconds only for rails 7.1 versions. * Conditionally handle for ruby 7.1 --------- Co-authored-by: Lei Wang <[email protected]> * Release 0.16.0 (aws#98) --------- Co-authored-by: Chabert Etienne <[email protected]> Co-authored-by: Etienne Chabert <[email protected]> Co-authored-by: Prashant Srivastava <[email protected]> Co-authored-by: Lei Wang <[email protected]> Co-authored-by: Osama Bin Junaid <[email protected]> Co-authored-by: Min Xia <[email protected]>
Issue #, if available:
Description of changes:
X-Ray SDK expects time in seconds with up to nanosecond precision.
This change make sure that the time is passed in seconds to the X-Ray for DB transactions.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.