Fixing broken instrumentation for sqlalchemy >= 1.4.0#289
Fixing broken instrumentation for sqlalchemy >= 1.4.0#289srprash merged 14 commits intoaws:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #289 +/- ##
===========================================
- Coverage 79.63% 31.98% -47.66%
===========================================
Files 83 83
Lines 3276 3286 +10
===========================================
- Hits 2609 1051 -1558
- Misses 667 2235 +1568
Continue to review full report at Codecov.
|
|
Looks like sqlalchemy 1.4.0 broke two functionalities in the x-ray SDK.
As mentioned in the |
|
One thing we can do is since wrapt.wrap_function_wrapper(
'sqlalchemy.orm.session',
'Session.execute',
_xray_traced_sqlalchemy_session
)This seem to work fine and record a subsegment for ATM, I can say that for ORM style statement execution, it is safest to use the SQLAlchemy integration rather than patching |
|
I believe the reason for such a massive drop in the coverage is due to the fact that every test is run with This makes the coverage report quite unreliable, and the solution is to generate different coverage report for each test run and aggregate them together in a codecov report. |
@anuraaga My suspicion is that the issue was always there and was sometimes encountered in PRs like this which saw decreased in coverage despite adding more tests. |
anuraaga
left a comment
There was a problem hiding this comment.
Cool in that case I don't think coverage issue blocks this PR, will be good to fix it separately at some point.
* Drop version pinning sqlalchemy and flask_sqlalchemy * Check obj type instead of callable for functions * testing * Adding patch for Session.execute. Removing session.add test * Remove unused variable * Adding 2.0 style test case. Some refactor. Unwrap session. * Splitting out tests * Typo fix * Refactored some tests files * minor renaming of function
Issue #, if available: #281
Description of changes:
For context, please read the following comments:
#281 (comment)
#289 (comment)
#289 (comment)
The changes being done in this PR are:
objis of type function.Session.executemethod to capture subsegments for 2.0 style execution introduced in sqlalchemy v1.4.0. And some refactoring of the patch code.tox.inifor the same.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.