@@ -12,6 +12,8 @@ def app_config():
1212 config = MagicMock (spec = AppConfig )
1313 config .get .side_effect = {
1414 "TA_TELEMETRY_ENABLED" : "true" ,
15+ "TA_METRICS_ENABLED" : "true" ,
16+ "TA_LOGGING_ENABLED" : "true" ,
1517 "TA_OTEL_ENDPOINT" : "http://localhost:4317" ,
1618 "TA_OTEL_METRICS_ENDPOINT" : "http://localhost:4317" ,
1719 "TA_LOG_LEVEL" : "info" ,
@@ -30,6 +32,8 @@ def test_telemetry_initialization_info(app_config):
3032def test_telemetry_initialization_debug (app_config ):
3133 app_config .get .side_effect = {
3234 "TA_TELEMETRY_ENABLED" : "false" ,
35+ "TA_METRICS_ENABLED" : "false" ,
36+ "TA_LOGGING_ENABLED" : "false" ,
3337 "TA_OTEL_ENDPOINT" : None ,
3438 "TA_LOG_LEVEL" : "debug" ,
3539 }.get
@@ -40,6 +44,8 @@ def test_telemetry_initialization_debug(app_config):
4044def test_telemetry_initialization_warning (app_config ):
4145 app_config .get .side_effect = {
4246 "TA_TELEMETRY_ENABLED" : "false" ,
47+ "TA_METRICS_ENABLED" : "false" ,
48+ "TA_LOGGING_ENABLED" : "false" ,
4349 "TA_OTEL_ENDPOINT" : None ,
4450 "TA_LOG_LEVEL" : "warning" ,
4551 }.get
@@ -50,6 +56,8 @@ def test_telemetry_initialization_warning(app_config):
5056def test_telemetry_initialization_error (app_config ):
5157 app_config .get .side_effect = {
5258 "TA_TELEMETRY_ENABLED" : "false" ,
59+ "TA_METRICS_ENABLED" : "false" ,
60+ "TA_LOGGING_ENABLED" : "false" ,
5361 "TA_OTEL_ENDPOINT" : None ,
5462 "TA_LOG_LEVEL" : "error" ,
5563 }.get
@@ -60,6 +68,8 @@ def test_telemetry_initialization_error(app_config):
6068def test_telemetry_initialization_critical (app_config ):
6169 app_config .get .side_effect = {
6270 "TA_TELEMETRY_ENABLED" : "false" ,
71+ "TA_METRICS_ENABLED" : "false" ,
72+ "TA_LOGGING_ENABLED" : "false" ,
6373 "TA_OTEL_ENDPOINT" : None ,
6474 "TA_LOG_LEVEL" : "critical" ,
6575 }.get
@@ -70,6 +80,8 @@ def test_telemetry_initialization_critical(app_config):
7080def test_telemetry_disabled (app_config ):
7181 app_config .get .side_effect = {
7282 "TA_TELEMETRY_ENABLED" : "false" ,
83+ "TA_METRICS_ENABLED" : "false" ,
84+ "TA_LOGGING_ENABLED" : "false" ,
7385 "TA_OTEL_ENDPOINT" : None ,
7486 "TA_LOG_LEVEL" : "info" ,
7587 }.get
@@ -88,6 +100,8 @@ def test_get_tracer_enabled(app_config):
88100def test_get_tracer_disabled (app_config ):
89101 app_config .get .side_effect = {
90102 "TA_TELEMETRY_ENABLED" : "false" ,
103+ "TA_METRICS_ENABLED" : "false" ,
104+ "TA_LOGGING_ENABLED" : "false" ,
91105 "TA_OTEL_ENDPOINT" : None ,
92106 "TA_LOG_LEVEL" : "info" ,
93107 }.get
@@ -114,6 +128,8 @@ def test_enable_tracing(app_config):
114128def test_enable_tracing_without_endpoint (app_config ):
115129 app_config .get .side_effect = {
116130 "TA_TELEMETRY_ENABLED" : "true" ,
131+ "TA_METRICS_ENABLED" : "true" ,
132+ "TA_LOGGING_ENABLED" : "true" ,
117133 "TA_OTEL_ENDPOINT" : None ,
118134 "TA_LOG_LEVEL" : "info" ,
119135 }.get
@@ -140,6 +156,8 @@ def test_get_logger(app_config):
140156def test_get_logger_telemetry_disabled (app_config ):
141157 app_config .get .side_effect = {
142158 "TA_TELEMETRY_ENABLED" : "false" ,
159+ "TA_METRICS_ENABLED" : "false" ,
160+ "TA_LOGGING_ENABLED" : "false" ,
143161 "TA_OTEL_ENDPOINT" : None ,
144162 "TA_LOG_LEVEL" : "info" ,
145163 }.get
0 commit comments