docs: add observability, creating modules guide, and unified migration plan

- Add observability framework documentation (health checks, metrics, Sentry)
- Add developer guide for creating modules
- Add comprehensive module migration plan with Celery task integration
- Update architecture overview with module system and observability sections
- Update module-system.md with links to new docs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-27 22:41:19 +01:00
parent e3cab29c1a
commit 7dbdbd4c7e
6 changed files with 1583 additions and 8 deletions

View File

@@ -76,7 +76,42 @@ Custom middleware handles:
**See:** [Authentication & RBAC](auth-rbac.md) for details
### 4. Request Flow
### 4. Module System
The platform uses a modular architecture with three-tier classification:
```
┌─────────────────────────────────────────────────────────────┐
│ FRAMEWORK LAYER │
│ (Infrastructure - always available, not modules) │
│ Config │ Database │ Auth │ Permissions │ Observability │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ MODULE LAYER │
│ │
│ CORE (Always Enabled) OPTIONAL (Per-Platform) │
│ ├── core ├── payments │
│ ├── tenancy ├── billing │
│ ├── cms ├── inventory │
│ └── customers ├── orders │
│ ├── marketplace │
│ INTERNAL (Admin-Only) ├── analytics │
│ ├── dev-tools └── messaging │
│ └── monitoring │
└─────────────────────────────────────────────────────────────┘
```
**Module Features:**
- Enable/disable modules per platform
- Module dependencies (billing requires payments)
- Health checks and lifecycle hooks
- Self-contained modules with own services, models, migrations
**See:** [Module System](module-system.md) for complete documentation
### 5. Request Flow
```mermaid
graph TB
@@ -252,7 +287,15 @@ project/
│ ├── api/ # API routes
│ ├── routes/ # Page routes (HTML)
│ ├── services/ # Business logic
│ ├── core/ # Core functionality
│ ├── core/ # Core functionality (config, db, observability)
│ ├── modules/ # Module definitions and self-contained modules
│ │ ├── base.py # ModuleDefinition class
│ │ ├── registry.py # Module registry (CORE, OPTIONAL, INTERNAL)
│ │ ├── service.py # Module enablement service
│ │ ├── events.py # Module event bus
│ │ ├── cms/ # Self-contained CMS module
│ │ ├── payments/ # Self-contained payments module
│ │ └── ... # Other modules
│ └── exceptions/ # Custom exceptions
├── middleware/ # Custom middleware
@@ -288,6 +331,27 @@ project/
## Monitoring & Observability
The platform includes a comprehensive observability framework:
### Health Checks
- Aggregated health endpoint (`/health`)
- Kubernetes probes (`/health/live`, `/health/ready`)
- Module health check integration
- External tool links (`/health/tools`)
### Metrics
- Prometheus metrics endpoint (`/metrics`)
- Request latency histograms
- Counter and gauge support
### Error Tracking
- Sentry integration for production
- Exception capture with context
- Environment-aware configuration
### Logging
- Structured logging with Python logging module
@@ -295,12 +359,7 @@ project/
- Error tracking with stack traces
- Audit logging for admin actions
### Performance Monitoring
- Request timing headers (`X-Process-Time`)
- Database query monitoring (SQLAlchemy echo)
- Slow query identification
- Memory usage tracking
**See:** [Observability](observability.md) for complete documentation
## Deployment Architecture
@@ -332,6 +391,9 @@ Internet ───────────│ Load Balancer│
## Related Documentation
- [Multi-Tenant System](multi-tenant.md) - Detailed multi-tenancy implementation
- [Module System](module-system.md) - Module architecture and classification
- [Menu Management](menu-management.md) - Sidebar and menu configuration
- [Observability](observability.md) - Health checks, metrics, error tracking
- [Middleware Stack](middleware.md) - Complete middleware documentation
- [Authentication & RBAC](auth-rbac.md) - Security and access control
- [Request Flow](request-flow.md) - Detailed request processing