awslabs/aws-xray-dotnet-webapp

Name: aws-xray-dotnet-webapp

Owner: Amazon Web Services - Labs

Owner: AWS Samples

Description: An ASP.NET Web API application that has been instrumented for AWS X-Ray

Created: 2016-11-29 23:20:33.0

Updated: 2017-05-17 15:40:37.0

Pushed: 2017-04-19 16:52:04.0

Homepage: null

Size: 23

Language: C#

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

aws-xray-dotnet-webapp

An ASP.NET Web API application that has been instrumented for AWS X-Ray.

This application is written to be deployed with Elastic Beanstalk. It uses .ebextensions to setup AWS resources and configuration, which includes:

  1. Create a DynamoDB table
  2. Set an application confige DDB_TABLE_NAME with the create DynamoDB table name
  3. Install AWS X-Ray daemon as a Windows service
How to Run The App
  1. Create a RDS SQL Server DB instance. Steps

  2. Construct the connection string for SQL Server and fill it into web.config key “RDS_CONNECTION_STRING”.

  3. “Data Source=(RDS endpoint),(port number);User ID=(your user name);Password=(your password);”

  4. Deploy the application to Elastic Beanstalk. Steps.

  5. Make sure you attached an IAM role to your EC2 instance with the following policy

    
    sion": "2012-10-17",
    tement": [
    {
        "Action": [
            "sns:Publish",
            "xray:PutTelemetryRecords",
            "xray:PutTraceSegments",
            "dynamodb:PutItem",
            "dynamodb:GetItem",
            "dynamodb:DescribeTable"
        ],
        "Resource": [
            "*"
        ],
        "Effect": "Allow"
    }
    
    
    
  6. Access the application using EB environment URL.

FAQ
  1. What to do if I get an “Error: Internal Server Error”?
  2. You can use AWS X-Ray to debug this. Go to AWS X-Ray console and find the failed trace, and look for Exception. Probably because you EC2 instance don't have the enough permission to access DynamoDB or RDS DB instance.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.