Skip to content
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

[SERF-498] Fix passing data using context in Gorm #69

Merged
merged 2 commits into from Feb 22, 2023
Merged

Conversation

laynax
Copy link
Contributor

@laynax laynax commented Feb 22, 2023

Description

There was an issue in instrumentation package when passing the data within context and the result was that there were no metrics (or basically no metrics in database context) as is seen here for example.
The fix was to use db.Statement.Context instead of db.Set() as it's suggestion in the new version of gorm documentation.
There is also new unit test to cover the issue for future references.

Testing considerations

The work was tested in document-search development and the result trace can be seen here.

Checklist

  • Prefixed the PR title with the JIRA ticket code
  • Performed simple, atomic commits with good commit messages
  • Verified that the commit history is linear and commits are squashed as necessary
  • Thoroughly tested the changes in development and/or staging
  • Updated the README.md as necessary

Related links

@laynax laynax marked this pull request as ready for review February 22, 2023 10:19
@laynax laynax requested a review from a team as a code owner February 22, 2023 10:19
Neurostep
Neurostep previously approved these changes Feb 22, 2023
Copy link
Contributor

@Neurostep Neurostep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

Copy link
Contributor

@Neurostep Neurostep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@laynax laynax merged commit 5ac7bc0 into main Feb 22, 2023
@laynax laynax deleted the laynax/fix-gorm branch February 22, 2023 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants