File tree Expand file tree Collapse file tree 5 files changed +8
-5
lines changed
snowflake-telemetry-test-utils Expand file tree Collapse file tree 5 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
package :
2
2
name : snowflake-telemetry-python
3
- version : " 0.7.0 "
3
+ version : " 0.7.1.dev "
4
4
5
5
source :
6
6
path : {{ environ.get('SNOWFLAKE_TELEMETRY_DIR') }}
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ def get_severity_text(py_level_name):
75
75
76
76
def format (self , record : logging .LogRecord ) -> str :
77
77
log_items = {
78
+ "scope" : record .name ,
78
79
"body" : record .getMessage (),
79
80
"severity_text" : self .get_severity_text (record .levelname ),
80
81
"code.lineno" : record .lineno ,
Original file line number Diff line number Diff line change 4
4
#
5
5
6
6
"""Update this for the versions."""
7
- VERSION = "0.7.0 "
7
+ VERSION = "0.7.1.dev "
Original file line number Diff line number Diff line change 17
17
install_requires = [
18
18
"opentelemetry-exporter-otlp-proto-common == 1.26.0" ,
19
19
"pytest >= 7.0.0" ,
20
- "snowflake-telemetry-python == 0.7.0 " ,
20
+ "snowflake-telemetry-python == 0.7.1.dev " ,
21
21
"Jinja2 == 3.1.4" ,
22
22
"grpcio-tools >= 1.62.3" ,
23
23
"black >= 24.1.0" ,
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ def test_normal_log(self):
20
20
""" Does the logger produce the correct output? """
21
21
self .root_logger .warning ('foo' , extra = {"test" : 123 , "code.lineno" : 35 })
22
22
expected_log_message = {
23
+ "scope" : "test" ,
23
24
"body" : "foo" ,
24
25
"severity_text" : "WARN" ,
25
26
"code.lineno" : 21 ,
@@ -39,17 +40,18 @@ def test_exception_log(self):
39
40
self .root_logger .exception ("\" test exception\" " )
40
41
41
42
expected_log_message = {
43
+ "scope" : "test" ,
42
44
"body" : "\" test exception\" " ,
43
45
"severity_text" : "ERROR" ,
44
- "code.lineno" : 39 ,
46
+ "code.lineno" : 40 ,
45
47
"code.function" : "test_exception_log" ,
46
48
"exception.type" : "ZeroDivisionError" ,
47
49
"exception.message" : "division by zero" ,
48
50
}
49
51
actual_log_message = json .loads (self .stream .getvalue (), strict = False )
50
52
actual_log_message .pop ("code.filepath" )
51
53
actual_stacktrace = actual_log_message .pop ("exception.stacktrace" )
52
- self .assertIn ("line 37 , in test_exception_log\n " , actual_stacktrace )
54
+ self .assertIn ("line 38 , in test_exception_log\n " , actual_stacktrace )
53
55
self .assertIn ("ZeroDivisionError: division by zero\n " , actual_stacktrace )
54
56
self .assertEqual (expected_log_message , actual_log_message )
55
57
You can’t perform that action at this time.
0 commit comments