Skip to content

Commit

Permalink
Add high security mode test for global custom logging attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed Oct 22, 2024
1 parent 0686d18 commit d632f19
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/agent_features/test_log_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,3 +475,17 @@ def test_global_custom_attribute_forwarding():
common = session.get_log_events_common_block()
# Both attrs should appear, and the 2nd attr should be truncated to the max user attribute length
assert common == {"custom_attr_1": "value", "custom_attr_2": "a" * 255}


@override_application_settings({
"high_security": True,
"application_logging.forwarding.custom_attributes": [("custom_attr_1", "value"), ("custom_attr_2", "a" * 256)],
})
@background_task()
def test_global_custom_attribute_forwarding_high_security_enabled():
txn = current_transaction()
session = list(txn.application._agent._applications.values())[0]._active_session

common = session.get_log_events_common_block()
# No custom attrs should be attached with high security enabled
assert common == {}

0 comments on commit d632f19

Please sign in to comment.