-
Notifications
You must be signed in to change notification settings - Fork 421
Failed to send data to X-Ray daemon. OSError: [Errno 90] Message too long #476
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
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hey @ShengHow95 thanks for raising it! We indeed fixed it with that setting after X-Ray SDK fixed that piece -- I couldn't reproduce it :/ If you were to remove sensitive information, could you share the code you're using so we can try reproducing it? If you could also share what event source you're using that would be great -- we originally saw this happening with SQS before the fix. Thank you! |
I was thinking this over the weekend and one possibility is that the response returned by the handler or decorated function is bigger than 64K it reproduces this issue - that's because we automatically serialize and capture response and exceptions from decorated functions. If that's the case, could you try disabling this feature to see if that solves it? from aws_lambda_powertools import Tracer
@tracer.capture_method(capture_response=False)
def fetch_sensitive_information():
return "sensitive_information"
@tracer.capture_lambda_handler(capture_response=False)
def handler(event, context):
sensitive_information = fetch_sensitive_information() Thank you! |
@heitorlessa, I have just tried to include |
That's awesome to hear @ShengHow95! Your code will continue to be traced with this flag. What changes is that we will not capture the entire response as tracing metadata from your handler or method when this is set. I'm on mobile now, but if you open X-Ray, pick any trace ID, and you should see a Metadata tab -- capture_response=True (default) instructs Tracer to serialize the entire return of your function/method as metadata so you can troubleshoot that more easily, if you need. However, if your handler and/or method response is larger than 64K than this error can happen. You can still add tracing metadata anywhere in your code like parts of your response since it's big. I'll create a new issue to update the docs this week to add this error under FAQ to help others who might bump this in the future. |
Alright cool. Thanks alot for your assistance @heitorlessa! |
I am trying to use aws-lambda-powertools in my lambda function and when I run my lambda function, it came out with this error but my lambda function still able to run and complete. I suppose version 1.17.0 has already included
streaming_threshold=0
but I would still get the same error withMessage too long
.What were you trying to accomplish?
I would like to know if there is anyway to fix this issue without disabling x-ray tracing in my lambda function. What configuration or workaround I can have?
Environment
Logs
The text was updated successfully, but these errors were encountered: