3

I have just started working with AWS Xray and I am using it with AWS Lambda. The thing is I notice duplication of AWS Xray Nodes on service map. For example SNS is categorised as AWS::SNS and Remote call. Where as they are just both the same thing, have exact same traces and avg response time. Just displayed as two different nodes. Does anyone have any idea how to reduce this noise?

I am using patch_all() function to patch all services. Here are the images : Image 1 Image 2

Here are the images and gist for traces. Image SNS,Image Remote,Image Remote (details),Image SNS(Details),Gist

Update:

  • I have added the images as asked by @Rohit
  • The problem was solved using

Using following replacement

from aws_xray_sdk.core import patch_all
patch_all()

//replaced by 

from aws_xray_sdk.core import patch
patch('boto3') //etc etc
NoorJafri
  • 1,787
  • 16
  • 27
  • 1
    Can you please post sample trace that contains the duplicate SNS segments? Also if you can post output of GetServiceGraph API then it will be useful to debug the issue. https://docs.aws.amazon.com/xray/latest/api/API_GetServiceGraph.html Please mask any sensitive information you may have in your service graph. – Rohit Banga Mar 17 '18 at 08:52
  • 1
    Alright, I’ll do that as first thing in the morning but I was about to update as well. I solved the issue but just couldnt find the exact spot on SDK repo itself, where the issue occurs. So as I mentioned I was using patch_all() but somehow when I used a simple something like patch(“boto3”,”...”) etc it stopped duplicating the nodes but yep ill update he post with screenshots and the output. – NoorJafri Mar 18 '18 at 09:30
  • 1
    @RohitBanga I have added the images. For the GetServiceGraph have to re-setup the branch and test it again. – NoorJafri Mar 19 '18 at 09:31

1 Answers1

1

The node you see comes from this PR https://github.com/aws/aws-xray-sdk-python/pull/19 for adding support to httplib. If you use patch_all httplib operations will also be captured. In your case the dependency tree is boto3 -> botocore -> vendored requests -> httplib. So your AWS subsegment will have children subsegments that representing operations executed by httplib.

The service graph however will render a "remote" subsegment as a node which is what you see. The recommended way is to explicit patch the library you want to capture to avoid unexpected behavior.

haotian465
  • 679
  • 3
  • 4
  • I could just see something is happening :D but I didn't know the reason. Well I am accepting yours as a correct and comprehensive answer. :D – NoorJafri Apr 09 '18 at 08:00