@@ -19,35 +19,49 @@ def __getattr__(name):
19
19
"pyramid" ,
20
20
"requests" ,
21
21
"sqlalchemy" ,
22
- "tornado" ,
23
22
"wsgi" ,
24
23
"trace_utils" ,
25
24
"internal" ,
26
25
):
27
- # following attributes are not deprecated
28
- pass
29
- elif name in ("flask_login" , "trace_utils_async" , "redis_utils" , "trace_utils_redis" ):
30
- # folowing integrations/utils have unique deprecation messages
26
+ # following packages/modules are not deprecated and will not be removed in 3.0
31
27
pass
32
28
elif name in ("trace_handlers" , "func_name" , "module_name" , "require_modules" ):
29
+ # the following attributes are exposed in ddtrace.contrib.__init__ and should be
30
+ # removed in v3.0
33
31
deprecate (
34
- ("%s. %s is deprecated" % ( __name__ , name ) ),
32
+ ("ddtrace.contrib. %s is deprecated" % name ),
35
33
category = DDTraceDeprecationWarning ,
36
34
removal_version = "3.0.0" ,
37
35
)
38
36
elif name in ("aiobotocore" , "httplib" , "kombu" , "snowflake" , "sqlalchemy" , "tornado" , "urllib3" ):
39
- # following integrations are not enabled by default and require a unique message
37
+ # following integrations are not enabled by default and require a unique deprecation message
40
38
deprecate (
41
- f"{ name } is deprecated" ,
39
+ f"ddtrace.contrib. { name } is deprecated" ,
42
40
message = "Avoid using this package directly. "
43
41
f"Set DD_TRACE_{ name .upper ()} _ENABLED=true and use ``ddtrace.auto`` or the "
44
42
"``ddtrace-run`` command to enable and configure this integration." ,
45
43
category = DDTraceDeprecationWarning ,
46
44
removal_version = "3.0.0" ,
47
45
)
46
+ elif name in ("redis_utils" , "trace_utils_redis" , "trace_utils_async" ):
47
+ deprecate (
48
+ f"The ddtrace.contrib.{ name } module is deprecated" ,
49
+ message = "Import from ``ddtrace.contrib.trace_utils`` instead." ,
50
+ category = DDTraceDeprecationWarning ,
51
+ removal_version = "3.0.0" ,
52
+ )
53
+ elif name == "flask_login" :
54
+ deprecate (
55
+ """The flask_login integration is deprecated and will be deleted.
56
+ We recommend customers to switch to manual instrumentation.
57
+ https://docs.datadoghq.com/security/application_security/threats/add-user-info/?tab=loginsuccess&code-lang=python#adding-business-logic-information-login-success-login-failure-any-business-logic-to-traces
58
+ """ ,
59
+ message = "" ,
60
+ category = DDTraceDeprecationWarning ,
61
+ )
48
62
else :
49
63
deprecate (
50
- f"{ name } is deprecated" ,
64
+ f"ddtrace.contrib. { name } is deprecated" ,
51
65
message = "Avoid using this package directly. "
52
66
f"Use ``import ddtrace.auto`` or the ``ddtrace-run`` command to enable and configure { name } ." ,
53
67
category = DDTraceDeprecationWarning ,
0 commit comments