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

feat(pymongo): Send query description as valid JSON #3291

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

0Calories
Copy link
Member

@0Calories 0Calories commented Jul 12, 2024

MongoDB queries were being sent as invalid JSON, since the keys and values were surrounded by single quotes instead of double quotes. Relay cannot parse the queries unless they are sent as valid JSON. This PR converts MongoDB queries into a JSON string before sending it on the span, so that Relay may properly parse it and extract metrics.

Before

image

After

image

@0Calories 0Calories self-assigned this Jul 12, 2024
@0Calories 0Calories marked this pull request as ready for review July 12, 2024 21:07
Copy link

codecov bot commented Jul 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.41%. Comparing base (301c4b8) to head (8adea02).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3291   +/-   ##
=======================================
  Coverage   79.40%   79.41%           
=======================================
  Files         132      132           
  Lines       14281    14282    +1     
  Branches     2999     2999           
=======================================
+ Hits        11340    11342    +2     
  Misses       2094     2094           
+ Partials      847      846    -1     
Files Coverage Δ
sentry_sdk/integrations/pymongo.py 84.16% <100.00%> (+0.13%) ⬆️

... and 1 file with indirect coverage changes

@antonpirker antonpirker merged commit 84a2afc into master Jul 15, 2024
122 checks passed
@antonpirker antonpirker deleted the ashanand/pymongo/query-string-as-json branch July 15, 2024 06:58
arjennienhuis pushed a commit to arjennienhuis/sentry-python that referenced this pull request Sep 30, 2024
MongoDB queries were being sent as invalid JSON, since the keys and values were surrounded by single quotes instead of double quotes. Relay cannot parse the queries unless they are sent as valid JSON. This PR converts MongoDB queries into a JSON string before sending it on the span, so that Relay may properly parse it and extract metrics.
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.

2 participants