-
Notifications
You must be signed in to change notification settings - Fork 557
Stop recording spans for internal web requests to Sentry #2297
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
Merged
szokeasaurusrex
merged 6 commits into
master
from
szokeasaurusrex/dont-record-sentry-spans
Aug 8, 2023
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
23d8bf1
Stop logging spans for internal requests to Sentry
szokeasaurusrex 147e74b
Add tests for client is_sentry_url
szokeasaurusrex 7fb124f
Merge branch 'master' into szokeasaurusrex/dont-record-sentry-spans
szokeasaurusrex 50291ce
Fixed mypy errors
szokeasaurusrex 879f2b1
Fixed test failures
szokeasaurusrex a099598
Test parameter cleanup
szokeasaurusrex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1136,3 +1136,31 @@ def test_max_value_length_option( | |
capture_message("a" * 2000) | ||
|
||
assert len(events[0]["message"]) == expected_data_length | ||
|
||
|
||
def test_is_sentry_url_true(): | ||
client = Client(dsn="https://[email protected]/123456789") | ||
test_url = "abcd1234.ingest.sentry.io" | ||
|
||
is_sentry_url = client.is_sentry_url(test_url) | ||
|
||
assert is_sentry_url | ||
|
||
|
||
def test_is_sentry_url_false(): | ||
client = Client(dsn="https://[email protected]/123456789") | ||
test_url = "abcd1234.mywebsite.com" | ||
|
||
is_sentry_url = client.is_sentry_url(test_url) | ||
|
||
assert not is_sentry_url | ||
|
||
|
||
def test_is_sentry_url_no_transport(): | ||
client = Client() | ||
client.transport = None | ||
test_url = "abcd1234.mywebsite.com" | ||
|
||
is_sentry_url = client.is_sentry_url(test_url) | ||
|
||
assert not is_sentry_url |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -305,6 +305,10 @@ def test_should_propagate_trace( | |
): | ||
hub = MagicMock() | ||
hub.client = MagicMock() | ||
|
||
# This test assumes the urls are not Sentry URLs. Use test_should_propogate_trace_to_sentry for sentry URLs. | ||
hub.is_sentry_url = lambda _: False | ||
|
||
hub.client.options = {"trace_propagation_targets": trace_propagation_targets} | ||
hub.client.transport = MagicMock() | ||
hub.client.transport.parsed_dsn = Dsn("https://[email protected]/12312012") | ||
|
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.
Uh oh!
There was an error while loading. Please reload this page.