Skip to content

"failed to send data to X-Ray daemon." -> "Message too long" #201

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

Closed
tobiasmcnulty opened this issue Jan 29, 2020 · 5 comments · Fixed by #205
Closed

"failed to send data to X-Ray daemon." -> "Message too long" #201

tobiasmcnulty opened this issue Jan 29, 2020 · 5 comments · Fixed by #205
Assignees
Labels

Comments

@tobiasmcnulty
Copy link

We've enabled the record_full_document parameter for the pymongo patch method (https://github.com/aws/aws-xray-sdk-python/blob/master/aws_xray_sdk/ext/pymongo/patch.py#L12-L14) and are seeing the below exception when attempting to record a large query/response from mongo.

Would it be possible to update the UDP emitter to truncate the data or split it up so we can see at least some of it in the console?

Many thanks!

failed to send data to X-Ray daemon.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aws_xray_sdk/core/emitters/udp_emitter.py", line 63, in _send_data
    self._port))
OSError: [Errno 90] Message too long
@tobiasmcnulty
Copy link
Author

tobiasmcnulty commented Jan 29, 2020

I should add, we're also seeing traces with no segments in the console, which is maybe related?

Screen Shot 2020-01-29 at 12 51 30 PM

(ID has been obfuscated.)

@awssandra
Copy link

awssandra commented Jan 30, 2020

Hi tobiasmcnulty,

I'd suggest using the streaming threshold in the recorder first. The idea is that subsegments can be batched and sent independently of their segment, as long as they're complete. This can help alleviate the UDP size limit when working with large segment documents.

Relevant Note
More Notes

We have similar logic on Lambda, where we force every subsegment to send when complete

So, I'd expect something like the following to work...

from aws_xray_sdk.core import xray_recorder

xray_recorder.configure(
    //... configs here
    streaming_threshold=0
    //Magic number here, default is 30. Setting to 0 will force a subsegment to send as soon as it's closed.
)

Let me know if this helps at all.

Thanks!
Sandra

@dpoirier
Copy link

dpoirier commented Feb 4, 2020

@awssandra It looks as if the streaming_threshold won't be used unless it's truthy:

if streaming_threshold:

So I wouldn't think setting it to 0 would have any effect. Would setting it to 1 or -1 be almost as good?

This might be a bug - maybe it should be checking if streaming_threshold is not None.

(I work with @tobiasmcnulty.)

@awssandra
Copy link

awssandra commented Feb 4, 2020

Hi dpoirier,

That looks like a bug to me - zero should be an acceptable value (I am most knowledgeable of the Node SDK so here is the setting logic there).

Setting to "1" should work in a very similar fashion.
Feel free to open a PR to correct this - but either way I'll try to get this prioritized on my end.

Sorry for the issue,
Sandra

@stale
Copy link

stale bot commented Jan 8, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in next 7 days. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants