Skip to content

Commit 4de44ee

Browse files
Add deprecation warning to WSGI environ dict settings (#1496)
* WSGI environ dict deprecation warning * Megalinter fixes * Megalinter fixes * Change name of deprecated WSGI settings list * Megalinter fixes --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent fdf34c0 commit 4de44ee

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

newrelic/api/web_transaction.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,27 @@ def _parse_time_stamp(time_stamp):
7171
TRUE_VALUES = {"on", "true", "1"}
7272
FALSE_VALUES = {"off", "false", "0"}
7373

74+
DEPRECATED_ENVIRON_SETTINGS = (
75+
"newrelic.set_background_task",
76+
"newrelic.suppress_apdex_metric",
77+
"newrelic.suppress_transaction_trace",
78+
"newrelic.capture_request_params",
79+
"newrelic.disable_browser_autorum",
80+
)
81+
7482

7583
def _lookup_environ_setting(environ, name, default=False):
7684
if name not in environ:
7785
return default
7886

87+
# Check for deprecated WSGI environ dictionary setting
88+
if name in DEPRECATED_ENVIRON_SETTINGS:
89+
warnings.warn(
90+
f"Environ setting '{name}' is deprecated and will be removed in a future release.",
91+
DeprecationWarning,
92+
stacklevel=2,
93+
)
94+
7995
flag = environ[name]
8096

8197
if isinstance(flag, str):

0 commit comments

Comments
 (0)