-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(samples/cloudwatch-applicationsignals-mcp): add docker .net aspnetcore app #1746
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1746 +/- ##
=======================================
Coverage 90.27% 90.27%
=======================================
Files 784 784
Lines 60059 60059
Branches 9733 9733
=======================================
Hits 54218 54218
Misses 3649 3649
Partials 2192 2192 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new .NET ASP.NET Core Docker application to test AWS Application Signals enablement via the get_enablement_guide MCP tool. The application runs as a containerized service on EC2 with REST API endpoints for health checks and S3 bucket listing.
Key changes:
- Added complete .NET ASP.NET Core application with Dockerfile, REST API endpoints, AWS S3 integration, and traffic generation script
- Added CDK infrastructure configuration for EC2 deployment
- Updated documentation with build/deploy instructions
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet-aspnetcore.json | CDK configuration defining app name, health check path, Docker image, language, and port settings |
| generate-traffic.sh | Bash script for continuous traffic generation to health and API endpoints |
| Program.cs | ASP.NET Core application with endpoints for health checks and S3 bucket listing |
| Dockerfile | Multi-stage Docker build using .NET SDK 9.0 with health checks and security hardening |
| AspNetCoreApp.csproj | .NET 9.0 project file with AWS S3 SDK dependencies |
| README.md | Updated documentation with dotnet-aspnetcore build/deploy instructions |
Comments suppressed due to low confidence (1)
samples/cloudwatch-applicationsignals-mcp/get-enablement-guide-samples/docker-apps/dotnet/aspnetcore/Program.cs:25
- This assignment to awsRegion is useless, since its value is never read.
var awsRegion = Environment.GetEnvironmentVariable("AWS_REGION") ?? "us-east-1";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var awsRegion = Environment.GetEnvironmentVariable("AWS_REGION") ?? "us-east-1"; | ||
|
|
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The awsRegion variable is declared but never used. It should either be removed or utilized in the S3 client configuration. Other applications in the repository (python-flask, nodejs-express) use the AWS_REGION environment variable to configure their S3 clients, but the .NET application relies on the default AWS SDK configuration via AddAWSService<IAmazonS3>() which doesn't accept explicit region configuration in this form.
| var awsRegion = Environment.GetEnvironmentVariable("AWS_REGION") ?? "us-east-1"; |
...ignals-mcp/get-enablement-guide-samples/infrastructure/ec2/cdk/config/dotnet-aspnetcore.json
Outdated
Show resolved
Hide resolved
| catch (Exception ex) | ||
| { | ||
| logger.LogError(ex, "S3 client error: {ErrorMessage}", ex.Message); |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic catch clause.
| catch (Exception ex) | |
| { | |
| logger.LogError(ex, "S3 client error: {ErrorMessage}", ex.Message); | |
| catch (AmazonS3Exception s3Ex) | |
| { | |
| logger.LogError(s3Ex, "AmazonS3Exception: {ErrorMessage}", s3Ex.Message); | |
| return Results.Json(new { error = "AWS S3 error occurred while retrieving buckets" }, statusCode: 500); | |
| } | |
| catch (Exception ex) | |
| { | |
| logger.LogError(ex, "Unexpected error: {ErrorMessage}", ex.Message); |
| | python-flask | docker-apps/python/flask | python-flask | | ||
| | java-springboot | docker-apps/java/spring-boot | java-springboot | | ||
| | nodejs-express | docker-apps/nodejs/express | nodejs-express | | ||
| | dotnet-aspnetcore | docker-apps/dotnet/aspnetcore| dotnet-aspnetcore| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
| | dotnet-aspnetcore | docker-apps/dotnet/aspnetcore| dotnet-aspnetcore| | |
| | python-flask | docker-apps/python/flask | python-flask | | |
| | java-springboot | docker-apps/java/spring-boot | java-springboot | | |
| | nodejs-express | docker-apps/nodejs/express | nodejs-express | | |
| | dotnet-aspnetcore | docker-apps/dotnet/aspnetcore | dotnet-aspnetcore | |
| | python-flask | PythonFlaskCdkStack | | ||
| | java-springboot | JavaSpringBootCdkStack | | ||
| | nodejs-express | NodejsExpressCdkStack | | ||
| | dotnet-aspnetcore | DotnetAspnetcoreCdkStack| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sanity check: did you run deployment with existing ec2 cdk infra and verify things are working?
|
This pull request is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon. If you wish to exclude this issue from being marked as stale, add the "backlog" label. |
Fixes
Summary
Adding Docker .NET Asp.NET Core app to our enablement tool testing infra.
Changes
This PR adds a new .NET ASP.NET Core baseline application for testing AWS Application Signals enablement via the
get_enablement_guideMCP tool. The application is designed to run as a Docker container on EC2.New files added
docker-apps/dotnet/aspnetcore/- Complete ASP.NET Core application with:/,/health, and/api/bucketsinfrastructure/ec2/cdk/config/dotnet-aspnetcore.json- CDK configuration for deploymentDocumentation updates:
README.mdwith .NET ASP.NET Core app build/deploy instructionsdotnet-aspnetcoreto ECR repository tableDotnetAspnetcoreCdkStackto CDK stack deployment tableUser experience
N/A
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change? (Y/N) N
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.