Skip to content

Conversation

@ezhang6811
Copy link
Contributor

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_guide MCP 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:
    • Dockerfile using .NET SDK 9.0 with health checks
    • REST API with three endpoints: /, /health, and /api/buckets
    • AWS SDK S3 integration to list S3 buckets
    • Traffic generation script for continuous testing
    • .csproj file with .NET 9.0, AWS SDK S3, and AWS Extensions dependencies
  • infrastructure/ec2/cdk/config/dotnet-aspnetcore.json - CDK configuration for deployment

Documentation updates:

  • Updated README.md with .NET ASP.NET Core app build/deploy instructions
  • Added dotnet-aspnetcore to ECR repository table
  • Added DotnetAspnetcoreCdkStack to CDK stack deployment table

User experience

N/A

Checklist

If your change doesn't seem to apply, please leave them unchecked.

  • I have reviewed the contributing guidelines
  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented

Is this a breaking change? (Y/N) N

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

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.

@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.27%. Comparing base (bb62109) to head (d96005e).
⚠️ Report is 70 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-advanced-security
Copy link

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.

Copilot finished reviewing on behalf of ezhang6811 November 13, 2025 21:32
Copy link
Contributor

Copilot AI left a 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.

Comment on lines +25 to +26
var awsRegion = Environment.GetEnvironmentVariable("AWS_REGION") ?? "us-east-1";

Copy link

Copilot AI Nov 13, 2025

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.

Suggested change
var awsRegion = Environment.GetEnvironmentVariable("AWS_REGION") ?? "us-east-1";

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +49
catch (Exception ex)
{
logger.LogError(ex, "S3 client error: {ErrorMessage}", ex.Message);
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generic catch clause.

Suggested change
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);

Copilot uses AI. Check for mistakes.
| 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|
Copy link
Contributor

@yiyuan-he yiyuan-he Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
| 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|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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?

@scottschreckengaust scottschreckengaust added the hold-merging Signals to hold the PR from merging label Nov 14, 2025
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added stale These are items that have been around for a long time without progress and removed stale These are items that have been around for a long time without progress labels Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold-merging Signals to hold the PR from merging

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

3 participants