Skip to content
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

Support for SNS #1

Closed
tsibelman opened this issue Mar 1, 2018 · 5 comments
Closed

Support for SNS #1

tsibelman opened this issue Mar 1, 2018 · 5 comments

Comments

@tsibelman
Copy link

Great tool, we tried it and it looks like it working as advertised, we would love to have support for SNS as well.

@glicht
Copy link
Member

glicht commented Mar 1, 2018

Thanks for the feedback. Will take a look at what SNS requires. Can you share what x-ray sdks you are using (Java, JavaScript ...) so we can prioritize.

@tsibelman
Copy link
Author

We using .net but I was thinking that because you using traces you would be agnostic to runtime.

@glicht
Copy link
Member

glicht commented Mar 1, 2018

You are correct We are agnostic to the runtime. Thing is, that the x-ray sdks don't report accessed resources by default for all services (for example SNS is not yet supported). This is controlled via a whitelist file in the sdk. Will take a look to see what .net supports and if it can be configured.

glicht added a commit that referenced this issue Mar 12, 2018
@glicht
Copy link
Member

glicht commented Mar 12, 2018

Just did a commit and published a new version to npm with support for SNS. Note that the x-ray .net sdk doesn't support sending the topic arn as part of SNS segment traces. There is need to configure a parameter whitelist for SNS. I am providing here instructions based upon my experience with other sdks. I didn't get a chance to actually test this out yet on the .net sdk.

You will need to copy the file: https://github.com/aws/aws-xray-sdk-dotnet/blob/master/sdk/src/Handlers/AwsSdk/DefaultAWSWhitelist.json and then add to it the following json section under services:

"SimpleNotificationService": {
      "operations": {
        "AddPermission": {
          "request_parameters": [
            "TopicArn"
          ]
        },
        "ConfirmSubscription": {
          "request_parameters": [
            "TopicArn"
          ]
        },
        "CreatePlatformApplication": {
          "request_parameters": [
            "Name",
            "Platform"
          ]
        },
        "CreatePlatformEndpoint": {
          "request_parameters": [
            "PlatformApplicationArn"
          ]
        },
        "CreateTopic": {
          "request_parameters": [
            "Name"
          ]
        },
        "DeletePlatformApplication": {
          "request_parameters": [
            "PlatformApplicationArn"
          ]
        },
        "DeleteTopic": {
          "request_parameters": [
            "TopicArn"
          ]
        },
        "GetPlatformApplicationAttributes": {
          "request_parameters": [
            "PlatformApplicationArn"
          ]
        },
        "GetSubscriptionAttributes": {
          "request_parameters": [
            "SubscriptionArn"
          ]
        },
        "GetTopicAttributes": {
          "request_parameters": [
            "TopicArn"
          ]
        },
        "ListEndpointsByPlatformApplication": {
          "request_parameters": [
            "PlatformApplicationArn"
          ]
        },
        "ListSubscriptionsByTopic": {
          "request_parameters": [
            "TopicArn"
          ]
        },
        "Publish": {
          "request_parameters": [
            "TopicArn",
            "TargetArn"
          ]
        },
        "RemovePermission": {
          "request_parameters": [
            "TopicArn"
          ]
        },
        "SetPlatformApplicationAttributes": {
          "request_parameters": [
            "PlatformApplicationArn"
          ]
        },
        "SetSubscriptionAttributes": {
          "request_parameters": [
            "SubscriptionArn"
          ]
        },
        "SetTopicAttributes": {
          "request_parameters": [
            "TopicArn"
          ]
        },
        "Subscribe": {
          "request_parameters": [
            "TopicArn",
            "Protocol",
            "Endpoint"
          ]
        },
        "Unsubscribe": {
          "request_parameters": [
            "SubscriptionArn"
          ]
        }
      }
    }
  }

The configuration for SNS is copied from: https://github.com/functionalone/aws-xray-parameter-whitelist-node/blob/master/resources/sns_whitelist.json with the change to the service name and capitalization of the operation name. I can add a js script which can generate this if you think this is useful.

After you created the extended whitelist file configuration you will need to configure the x-ray sdk to use this file. This seems to be controlled via the configuration parameter: AwsServiceHandlerManifest. See: https://github.com/aws/aws-xray-sdk-dotnet/tree/master#configuration .

@glicht glicht closed this as completed Mar 12, 2018
@tsibelman
Copy link
Author

Wanted to say thank you for the feature.

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

No branches or pull requests

2 participants