Skip to content

Commit

Permalink
Disable browser monitoring with aiobotocore
Browse files Browse the repository at this point in the history
  • Loading branch information
lrafeei committed May 14, 2024
1 parent da6b566 commit bb75e16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions newrelic/hooks/external_aiobotocore.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ async def wrap_endpoint_make_request(wrapped, instance, args, kwargs):

with ExternalTrace(library="aiobotocore", url=url, method=method, source=wrapped) as trace:
try:
# Because AIOBotocore's proxy functionality uses aiohttp
# and urllib3 under the hood, New Relic has portions that
# are classified as Web Transactions. This means that
# browser monitoring will now be true. However, this will
# inject unwanted JS Agent Header Fragments into SQS responses.
trace.settings.browser_monitoring.enabled = False
trace._add_agent_attribute("aws.operation", operation_model.name)
except:
pass
Expand Down
1 change: 0 additions & 1 deletion tests/external_aiobotocore/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"transaction_tracer.stack_trace_threshold": 0.0,
"debug.log_data_collector_payloads": True,
"debug.record_transaction_failure": True,
"browser_monitoring.enabled": False,
}
collector_agent_registration = collector_agent_registration_fixture(
app_name="Python Agent Test (external_aiobotocore)",
Expand Down

0 comments on commit bb75e16

Please sign in to comment.