@@ -803,9 +803,9 @@ def default_otlp_host(host):
803803_settings .compressed_content_encoding = "gzip"
804804_settings .max_payload_size_in_bytes = 1000000
805805
806- _settings .attributes .enabled = True
807- _settings .attributes .exclude = []
808- _settings .attributes .include = []
806+ _settings .attributes .enabled = _environ_as_bool ( "NEW_RELIC_ATTRIBUTES_ENABLED" , default = True )
807+ _settings .attributes .exclude = _environ_as_set ( os . environ . get ( "NEW_RELIC_ATTRIBUTES_EXCLUDE" , "" ))
808+ _settings .attributes .include = _environ_as_set ( os . environ . get ( "NEW_RELIC_ATTRIBUTES_INCLUDE" , "" ))
809809
810810_settings .thread_profiler .enabled = True
811811_settings .cross_application_tracer .enabled = False
@@ -821,9 +821,15 @@ def default_otlp_host(host):
821821_settings .event_harvest_config .harvest_limits .analytic_event_data = _environ_as_int (
822822 "NEW_RELIC_ANALYTICS_EVENTS_MAX_SAMPLES_STORED" , default = DEFAULT_RESERVOIR_SIZE
823823)
824- _settings .transaction_events .attributes .enabled = True
825- _settings .transaction_events .attributes .exclude = []
826- _settings .transaction_events .attributes .include = []
824+ _settings .transaction_events .attributes .enabled = _environ_as_bool (
825+ "NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_ENABLED" , default = True
826+ )
827+ _settings .transaction_events .attributes .exclude = _environ_as_set (
828+ os .environ .get ("NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_EXCLUDE" , "" )
829+ )
830+ _settings .transaction_events .attributes .include = _environ_as_set (
831+ os .environ .get ("NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_INCLUDE" , "" )
832+ )
827833
828834_settings .custom_insights_events .enabled = True
829835_settings .event_harvest_config .harvest_limits .custom_event_data = _environ_as_int (
@@ -847,13 +853,23 @@ def default_otlp_host(host):
847853_settings .event_harvest_config .harvest_limits .span_event_data = _environ_as_int (
848854 "NEW_RELIC_SPAN_EVENTS_MAX_SAMPLES_STORED" , default = SPAN_EVENT_RESERVOIR_SIZE
849855)
850- _settings .span_events .attributes .enabled = True
851- _settings .span_events .attributes .exclude = []
852- _settings .span_events .attributes .include = []
856+ _settings .span_events .attributes .enabled = _environ_as_bool ("NEW_RELIC_SPAN_EVENTS_ATTRIBUTES_ENABLED" , default = True )
857+ _settings .span_events .attributes .exclude = _environ_as_set (
858+ os .environ .get ("NEW_RELIC_SPAN_EVENTS_ATTRIBUTES_EXCLUDE" , "" )
859+ )
860+ _settings .span_events .attributes .include = _environ_as_set (
861+ os .environ .get ("NEW_RELIC_SPAN_EVENTS_ATTRIBUTES_INCLUDE" , "" )
862+ )
853863
854- _settings .transaction_segments .attributes .enabled = True
855- _settings .transaction_segments .attributes .exclude = []
856- _settings .transaction_segments .attributes .include = []
864+ _settings .transaction_segments .attributes .enabled = _environ_as_bool (
865+ "NEW_RELIC_TRANSACTION_SEGMENTS_ATTRIBUTES_ENABLED" , default = True
866+ )
867+ _settings .transaction_segments .attributes .exclude = _environ_as_set (
868+ os .environ .get ("NEW_RELIC_TRANSACTION_SEGMENTS_ATTRIBUTES_EXCLUDE" , "" )
869+ )
870+ _settings .transaction_segments .attributes .include = _environ_as_set (
871+ os .environ .get ("NEW_RELIC_TRANSACTION_SEGMENTS_ATTRIBUTES_INCLUDE" , "" )
872+ )
857873
858874_settings .transaction_tracer .enabled = True
859875_settings .transaction_tracer .transaction_threshold = None
@@ -864,9 +880,15 @@ def default_otlp_host(host):
864880_settings .transaction_tracer .function_trace = []
865881_settings .transaction_tracer .generator_trace = []
866882_settings .transaction_tracer .top_n = 20
867- _settings .transaction_tracer .attributes .enabled = True
868- _settings .transaction_tracer .attributes .exclude = []
869- _settings .transaction_tracer .attributes .include = []
883+ _settings .transaction_tracer .attributes .enabled = _environ_as_bool (
884+ "NEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_ENABLED" , default = True
885+ )
886+ _settings .transaction_tracer .attributes .exclude = _environ_as_set (
887+ os .environ .get ("NEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_EXCLUDE" , "" )
888+ )
889+ _settings .transaction_tracer .attributes .include = _environ_as_set (
890+ os .environ .get ("NEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_INCLUDE" , "" )
891+ )
870892
871893_settings .error_collector .enabled = True
872894_settings .error_collector .capture_events = True
@@ -879,9 +901,15 @@ def default_otlp_host(host):
879901)
880902_settings .error_collector .expected_status_codes = set ()
881903_settings .error_collector ._error_group_callback = None
882- _settings .error_collector .attributes .enabled = True
883- _settings .error_collector .attributes .exclude = []
884- _settings .error_collector .attributes .include = []
904+ _settings .error_collector .attributes .enabled = _environ_as_bool (
905+ "NEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_ENABLED" , default = True
906+ )
907+ _settings .error_collector .attributes .exclude = _environ_as_set (
908+ os .environ .get ("NEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_EXCLUDE" , "" )
909+ )
910+ _settings .error_collector .attributes .include = _environ_as_set (
911+ os .environ .get ("NEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_INCLUDE" , "" )
912+ )
885913
886914_settings .browser_monitoring .enabled = True
887915_settings .browser_monitoring .auto_instrument = True
@@ -890,9 +918,15 @@ def default_otlp_host(host):
890918_settings .browser_monitoring .debug = False
891919_settings .browser_monitoring .ssl_for_http = None
892920_settings .browser_monitoring .content_type = ["text/html" ]
893- _settings .browser_monitoring .attributes .enabled = False
894- _settings .browser_monitoring .attributes .exclude = []
895- _settings .browser_monitoring .attributes .include = []
921+ _settings .browser_monitoring .attributes .enabled = _environ_as_bool (
922+ "NEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_ENABLED" , default = False
923+ )
924+ _settings .browser_monitoring .attributes .exclude = _environ_as_set (
925+ os .environ .get ("NEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_EXCLUDE" , "" )
926+ )
927+ _settings .browser_monitoring .attributes .include = _environ_as_set (
928+ os .environ .get ("NEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_INCLUDE" , "" )
929+ )
896930
897931_settings .transaction_name .limit = None
898932_settings .transaction_name .naming_scheme = os .environ .get ("NEW_RELIC_TRANSACTION_NAMING_SCHEME" )
0 commit comments