Closed
Description
What were you trying to accomplish? Traces not appearing when processing multiple records
This is documented here: aws/aws-xray-sdk-python#201
Expected Behavior
Use sqs batch utility
with 10 records and Tracer at the same time without losing traces.
Current Behavior
@pcolazurdo discovered an issue when using Batch processing utility when you have multiple exceptions or multiple records, where X-Ray fails silently and doesn't send the trace data via UDP as expected.
Possible Solution
Send segments as they're complete instead of batching all of them: https://github.com/srprash/aws-xray-sdk-python/blob/9b2704dd534419b3dc2ae6e9b1793e1fc8a405c9/tests/test_recorder.py#L65
Need to experiment whether that has any negative perf impact when enabled
Steps to Reproduce (for bugs)
- Initialize a new project
sam init --location https://github.com/aws-samples/cookiecutter-aws-sam-python
- Convert to SQS event source
- Bring SQS Batch processing utility
- Either add long responses (100 dict keys) or raise an exception for all 10 records
Environment
- Powertools version used: 1.10.1
- Packaging format (Layers, PyPi): PyPi
- AWS Lambda function runtime: Python 3.8
- Debugging logs
The error only appears when debugging is enabled.
[ERROR] 2021-02-03T10:39:10.193Z 2851698b-0b0e-5ccd-9cc7-311f747567f2 failed to send data to X-Ray daemon.
Traceback (most recent call last):
File "/var/task/aws_xray_sdk/core/emitters/udp_emitter.py", line 62, in _send_data
self._socket.sendto(data.encode('utf-8'), (self._ip,
OSError: [Errno 90] Message too long
# paste logs here
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Triage