Skip to content

Commit f0ebea2

Browse files
committed
linting fix
1 parent 77c700c commit f0ebea2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

aws-opentelemetry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/logs/aws_batch_log_record_processor.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,19 +175,17 @@ def _estimate_log_size(self, log: LogData, depth: int = 3) -> int: # pylint: di
175175
if next_val is None:
176176
continue
177177

178-
if isinstance(next_val, bool):
179-
size += 4 if next_val else 5
180-
continue
181-
182178
if isinstance(next_val, (str, bytes)):
183179
size += len(next_val)
184180
continue
185181

186-
if isinstance(next_val, (float, int)):
182+
if isinstance(next_val, (float, int, bool)):
187183
size += len(str(next_val))
188184
continue
189185

190-
# next_val must be Sequence["AnyValue"] or Mapping[str, "AnyValue"],
186+
# next_val must be Sequence["AnyValue"] or Mapping[str, "AnyValue"]
187+
# See: https://github.com/open-telemetry/opentelemetry-python/blob/\
188+
# 9426d6da834cfb4df7daedd4426bba0aa83165b5/opentelemetry-api/src/opentelemetry/util/types.py#L20
191189
if current_depth <= depth:
192190
obj_id = id(
193191
next_val

0 commit comments

Comments
 (0)