Skip to content

Small performance improvements to %s formatted strings. #459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions datadog_lambda/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@ def get_dd_trace_context_obj():
xray_context = _get_xray_trace_context() # xray (sub)segment
except Exception as e:
logger.debug(
"get_dd_trace_context couldn't read from segment from x-ray, with error %s"
% e
"get_dd_trace_context couldn't read from segment from x-ray, with error %s",
e,
)
if not xray_context:
return None
Expand Down Expand Up @@ -1051,7 +1051,7 @@ def create_inferred_span_from_sqs_event(event, context):

except Exception as e:
logger.debug(
"Unable to create upstream span from SQS message, with error %s" % e
"Unable to create upstream span from SQS message, with error %s", e
)
pass

Expand Down
4 changes: 2 additions & 2 deletions datadog_lambda/xray.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ def send(host_port_tuple, payload):
sock.connect(host_port_tuple)
sock.send(payload.encode("utf-8"))
except Exception as e_send:
logger.error("Error occurred submitting to xray daemon: %s", str(e_send))
logger.error("Error occurred submitting to xray daemon: %s", e_send)
try:
sock.close()
except Exception as e_close:
logger.error("Error while closing the socket: %s", str(e_close))
logger.error("Error while closing the socket: %s", e_close)


def build_segment_payload(payload):
Expand Down