Skip to content

Commit 79ce99a

Browse files
committed
fix: re-enabled skipping over native logrecord attributes again that aren't covered by a semantic convention and ran black
1 parent 0552590 commit 79ce99a

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
_DEFAULT_OTEL_ATTRIBUTE_COUNT_LIMIT = 128
5858
_ENV_VALUE_UNSET = ""
5959
_EXCLUDED_ATTRIBUTES = {
60-
# pseudo-private log-record attributes, they just get dropped
60+
# pseudo-private log-record attributes, they should always be dropped
6161
"args",
6262
"msg",
6363
"message",
@@ -71,6 +71,19 @@
7171
"lineno",
7272
"thread",
7373
"threadName",
74+
# attributes that are omitted because no semantic convention exists for them yet
75+
"asctime",
76+
"created",
77+
"filename",
78+
"levelname",
79+
"levelno",
80+
"module",
81+
"msecs",
82+
"name",
83+
"process",
84+
"processName",
85+
"relativeCreated",
86+
"taskName",
7487
}
7588

7689

opentelemetry-sdk/tests/logs/test_handler.py

+2-12
Original file line numberDiff line numberDiff line change
@@ -255,20 +255,10 @@ def test_log_record_args_are_translated(self):
255255
self.assertEqual(
256256
set(log_record.attributes),
257257
{
258+
"thread.id",
258259
"code.filepath",
259-
"code.function",
260260
"code.lineno",
261-
"created",
262-
"filename",
263-
"levelname",
264-
"levelno",
265-
"module",
266-
"msecs",
267-
"name",
268-
"process",
269-
"processName",
270-
"relativeCreated",
271-
"thread.id",
261+
"code.function",
272262
"thread.name",
273263
},
274264
)

0 commit comments

Comments
 (0)