A full-stack web application with .NET Web API backend and Angular frontend, featuring comprehensive observability with Grafana, Prometheus, Tempo, and Loki, plus fun Databricks integration for banana analytics! π
Built using enterprise architecture patterns including Clean Architecture, CQRS, and Repository Pattern for maintainability and scalability.
π Quick Start Guide - Get up and running in minutes!
ποΈ Enterprise Architecture Patterns - Clean Architecture, CQRS, Repository Pattern
π€ Copilot Best Practices - Guide for using GitHub Copilot with enterprise patterns
π Copilot Code Examples - Working code examples for all architecture patterns
π Architecture Visual Guide - Diagrams and visual documentation
π Databricks Integration - Banana analytics powered by Databricks
π Observability Guide - Complete monitoring and tracing documentation
ποΈ Governance Framework - Enterprise governance and compliance documentation
ποΈ Architecture Documentation - Technical architecture overview
π Architecture Decision Records - ADRs documenting key decisions
π CI/CD Workflows - Automated releases and container publishing
πΈ Screenshots - Visual documentation of the application
π Changelog - Release notes and version history
Grafana-banana/
βββ backend/
β βββ GrafanaBanana.Api/ # .NET 9 Web API with OpenTelemetry
βββ frontend/ # Angular application with web tracing
βββ observability/ # Complete Grafana stack configuration
β βββ grafana/ # Grafana dashboards and provisioning
β βββ prometheus/ # Metrics collection config
β βββ tempo/ # Distributed tracing config
β βββ loki/ # Log aggregation config
β βββ promtail/ # Log shipper config
βββ .devcontainer/ # Dev container configuration
βββ .github/workflows/ # GitHub Actions CI/CD
- Distributed Tracing with OpenTelemetry and Tempo
- Metrics Collection with Prometheus
- Log Aggregation with Loki and Promtail
- Unified Dashboards in Grafana
- Full-Stack Monitoring (Backend + Frontend)
- β OpenTelemetry instrumentation for ASP.NET Core
- β Custom business metrics (counters, histograms, gauges)
- β Structured logging with Serilog
- β Health check endpoints
- β
Prometheus metrics endpoint (
/metrics) - β Runtime and performance metrics
- β OpenTelemetry browser instrumentation
- β Automatic page load tracking
- β User interaction tracking
- β HTTP request tracing
- β Error tracking
- API: http://localhost:5000
- Frontend: http://localhost:4200
- Grafana: http://localhost:3000 (admin/admin)
- Prometheus: http://localhost:9090
- Tempo: http://localhost:3200
- Loki: http://localhost:3100
GET /weatherforecast- Weather forecast data with full tracingGET /metrics- Prometheus metrics endpointGET /health- Detailed health checkGET /health/ready- Readiness probeGET /health/live- Liveness probeGET /api/metrics/custom- Custom metrics infoGET /api/trace/test- Test distributed tracingGET /api/error/test- Test error trackingGET /api/databricks/banana-analytics- π Banana analytics from DatabricksGET /api/databricks/production/{year}- π Production data by yearGET /api/databricks/sales- π Sales data by region
Or use the provided devcontainer for a pre-configured development environment.
- Open this repository in Visual Studio Code
- Install the Dev Containers extension
- Click "Reopen in Container" when prompted (or use Command Palette:
Dev Containers: Reopen in Container) - The environment will be automatically configured with all necessary tools
# Navigate to the backend directory
cd backend/GrafanaBanana.Api
# Restore dependencies
dotnet restore
# Run the API
dotnet runThe API will be available at http://localhost:5000
# Navigate to the frontend directory
cd frontend
# Install dependencies
npm install
# Start development server
npm startThe frontend will be available at http://localhost:4200
Start the entire application with the full observability stack:
# Start all services (app + monitoring stack)
docker-compose up -d
# View logs
docker-compose logs -f
# Stop all services
docker-compose downThis starts:
- Backend API (port 5000)
- Frontend (port 4200)
- Grafana (port 3000)
- Prometheus (port 9090)
- Tempo (port 3200)
- Loki (port 3100)
cd backend/GrafanaBanana.Api
dotnet build --configuration Releasecd frontend
npm run buildThe production build will be in frontend/dist/
cd backend/GrafanaBanana.Api
dotnet testcd frontend
npm testThis project uses GitHub Actions for automated CI/CD with multiple workflows:
-
Continuous Integration (
ci.yml)- Runs on every push and PR to
main/develop - Builds and tests both backend and frontend
- Validates code quality with linting
- Runs on every push and PR to
-
Container Testing (
test-containers.yml)- Tests Docker builds on every PR
- Validates containers start correctly
- Runs smoke tests before merge
-
Automatic Releases (
publish-release.yml)- Triggered on push to
main - Builds and publishes Docker containers to GHCR
- Creates GitHub releases with semantic versioning
- Generates version based on conventional commits
- Triggered on push to
-
Manual Releases (
release.yml)- Supports manual version releases
- Can republish specific versions
Published Docker images are available at GitHub Container Registry:
# Pull latest backend
docker pull ghcr.io/markcoleman/grafana-banana/backend:latest
# Pull latest frontend
docker pull ghcr.io/markcoleman/grafana-banana/frontend:latest
# Use specific version
docker pull ghcr.io/markcoleman/grafana-banana/backend:1.0.0See CI/CD Workflows Documentation for complete details.
make help # Show all available commands
make install # Install all dependencies
make build # Build both backend and frontend
make test # Run all tests
make lint # Run linting
make clean # Clean build artifacts
make run-backend # Run the backend API
make run-frontend # Run the frontend appdotnet run- Run the API in development modedotnet build- Build the APIdotnet test- Run tests
npm start- Start development servernpm run build- Build for productionnpm test- Run testsnpm run lint- Run linter
Backend:
- .NET 9
- ASP.NET Core Web API
- Minimal APIs
- OpenTelemetry for tracing and metrics
- Serilog for structured logging
- Prometheus exporter
Frontend:
- Angular 20
- TypeScript
- OpenTelemetry for browser tracing
- CSS
Observability:
- Grafana - Visualization and dashboards
- Prometheus - Metrics collection
- Tempo - Distributed tracing
- Loki - Log aggregation
- Promtail - Log shipping
DevOps:
- GitHub Actions
- Dev Containers
- Docker & Docker Compose
- GitHub Container Registry (GHCR)
The application exposes comprehensive metrics at /metrics:
Application Metrics:
api_requests_total- Total API requestsapi_requests_active- Active requestsapi_request_duration_ms- Request duration histogramweather_forecast_requests- Weather endpoint requests
Runtime Metrics:
- .NET memory usage
- Garbage collection stats
- Thread pool metrics
- Exception counts
- CPU usage
Full distributed tracing from frontend to backend:
- Automatic HTTP request tracing
- Custom span creation
- Trace correlation across services
- Exception tracking in traces
All logs include:
- Timestamp and log level
- Source context
- Machine name and thread ID
- Request correlation
- Structured data for filtering
Grafana dashboards are automatically provisioned with:
- API request rate and latency
- Memory and CPU usage
- Active requests
- Error rates
- Real-time log streaming
- Start the stack:
docker-compose up -d - Open Grafana: http://localhost:3000 (admin/admin)
- View the dashboard: Navigate to "Grafana-banana API Observability"
- Generate some traffic: Call the API endpoints
- Explore traces: Click on any metric to see related traces
- View logs: Check the logs panel for detailed application logs
For detailed monitoring instructions, see observability/README.md
Pre-built Docker images are available on GitHub Container Registry for each release:
# Pull backend image
docker pull ghcr.io/markcoleman/grafana-banana/backend:latest
# Pull frontend image
docker pull ghcr.io/markcoleman/grafana-banana/frontend:latest
# Or pull a specific version
docker pull ghcr.io/markcoleman/grafana-banana/backend:0.1.0
docker pull ghcr.io/markcoleman/grafana-banana/frontend:0.1.0A pre-configured docker-compose file is available for using released images:
# Use pre-built images from GitHub Container Registry
docker-compose -f docker-compose.ghcr.yml up -dOr modify the main docker-compose.yml to use pre-built images:
services:
backend:
image: ghcr.io/markcoleman/grafana-banana/backend:latest
# Remove the 'build' section
frontend:
image: ghcr.io/markcoleman/grafana-banana/frontend:latest
# Remove the 'build' sectionReleases are managed through GitHub Releases. Each release:
- Automatically builds and publishes Docker images to GHCR
- Tags images with the version number and
latest - Includes release notes documenting changes
- See CHANGELOG.md for detailed version history
To create a new release, create a new tag and push it:
git tag -a v0.1.0 -m "Release version 0.1.0"
git push origin v0.1.0Or create a release through the GitHub UI, which will trigger the automated container publishing workflow.
This project follows enterprise-grade governance practices suitable for corporate environments:
- Governance Framework: Comprehensive governance policies and processes
- Architecture Decision Records (ADRs): Documented architectural decisions
- Technical Architecture: System architecture documentation
- Decision Making: Structured ADR process for architectural decisions
- Security Governance: Defense-in-depth security controls and policies
- Data Governance: Data classification, retention, and protection policies
- Change Management: Controlled change process with appropriate approvals
- Risk Management: Risk assessment and mitigation strategies
- Quality Assurance: Quality gates and standards for code and documentation
- Compliance: Adherence to industry standards (OWASP, CIS, NIST)
- Metrics & KPIs: Defined success metrics for development and operations
See the Governance Framework for complete documentation.
Visual documentation and screenshots of the application are available in the docs/screenshots directory:
- Frontend Screenshots - Angular application UI
- Backend Screenshots - Web API documentation
- Observability Screenshots - Grafana dashboards and monitoring
Want to contribute screenshots? See the Screenshots Contributing Guide!
This project is licensed under the MIT License - see the LICENSE file for details.