Implémentation complète de la stack d'observabilité pour le monitoring de la plateforme multi-tenant Classeo. ## Error Tracking (GlitchTip) - Intégration Sentry SDK avec GlitchTip auto-hébergé - Scrubber PII avant envoi (RGPD: emails, tokens JWT, NIR français) - Contexte enrichi: tenant_id, user_id, correlation_id - Configuration backend (sentry.yaml) et frontend (sentry.ts) ## Metrics (Prometheus) - Endpoint /metrics avec restriction IP en production - Métriques HTTP: requests_total, request_duration_seconds (histogramme) - Métriques sécurité: login_failures_total par tenant - Métriques santé: health_check_status (postgres, redis, rabbitmq) - Storage Redis pour persistance entre requêtes ## Logs (Loki) - Processors Monolog: CorrelationIdLogProcessor, PiiScrubberLogProcessor - Détection PII: emails, téléphones FR, tokens JWT, NIR français - Labels structurés: tenant_id, correlation_id, level ## Dashboards (Grafana) - Dashboard principal: latence P50/P95/P99, error rate, RPS - Dashboard par tenant: métriques isolées par sous-domaine - Dashboard infrastructure: santé postgres/redis/rabbitmq - Datasources avec UIDs fixes pour portabilité ## Alertes (Alertmanager) - HighApiLatencyP95/P99: SLA monitoring (200ms/500ms) - HighErrorRate: error rate > 1% pendant 2 min - ExcessiveLoginFailures: détection brute force - ApplicationUnhealthy: health check failures ## Infrastructure - InfrastructureHealthChecker: service partagé (DRY) - HealthCheckController: endpoint /health pour load balancers - Pre-push hook: make ci && make e2e avant push
122 lines
3.8 KiB
JSON
122 lines
3.8 KiB
JSON
{
|
|
"name": "classeo/backend",
|
|
"description": "Classeo - Backend API (Symfony 8 + API Platform)",
|
|
"type": "project",
|
|
"license": "proprietary",
|
|
"minimum-stability": "dev",
|
|
"prefer-stable": true,
|
|
"require": {
|
|
"php": ">=8.5",
|
|
"ext-ctype": "*",
|
|
"ext-iconv": "*",
|
|
"ext-intl": "*",
|
|
"api-platform/core": "^4.0",
|
|
"doctrine/dbal": "^4.0",
|
|
"doctrine/doctrine-bundle": "^2.13 || ^3.0@dev",
|
|
"doctrine/doctrine-migrations-bundle": "^3.4",
|
|
"doctrine/orm": "^3.3",
|
|
"lexik/jwt-authentication-bundle": "^3.2",
|
|
"nelmio/cors-bundle": "^2.6",
|
|
"promphp/prometheus_client_php": "^2.14",
|
|
"ramsey/uuid": "^4.7",
|
|
"sentry/sentry-symfony": "^5.8",
|
|
"symfony/amqp-messenger": "^8.0",
|
|
"symfony/asset": "^8.0",
|
|
"symfony/console": "^8.0",
|
|
"symfony/doctrine-messenger": "^8.0",
|
|
"symfony/dotenv": "^8.0",
|
|
"symfony/flex": "^2",
|
|
"symfony/framework-bundle": "^8.0",
|
|
"symfony/http-client": "8.0.*",
|
|
"symfony/lock": "8.0.*",
|
|
"symfony/mailer": "8.0.*",
|
|
"symfony/messenger": "^8.0",
|
|
"symfony/monolog-bundle": "^4.0",
|
|
"symfony/property-access": "^8.0",
|
|
"symfony/property-info": "^8.0",
|
|
"symfony/rate-limiter": "8.0.*",
|
|
"symfony/runtime": "^8.0",
|
|
"symfony/security-bundle": "^8.0",
|
|
"symfony/serializer": "^8.0",
|
|
"symfony/twig-bundle": "^8.0",
|
|
"symfony/uid": "^8.0",
|
|
"symfony/validator": "^8.0",
|
|
"symfony/yaml": "^8.0"
|
|
},
|
|
"require-dev": {
|
|
"doctrine/doctrine-fixtures-bundle": "^4.0",
|
|
"friendsofphp/php-cs-fixer": "^3.65",
|
|
"phpat/phpat": "*",
|
|
"phpstan/phpstan": "^2.0",
|
|
"phpstan/phpstan-doctrine": "^2.0",
|
|
"phpstan/phpstan-symfony": "^2.0",
|
|
"phpunit/phpunit": "^11.0",
|
|
"symfony/browser-kit": "^8.0",
|
|
"symfony/css-selector": "^8.0",
|
|
"symfony/debug-bundle": "^8.0",
|
|
"symfony/maker-bundle": "^1.62",
|
|
"symfony/phpunit-bridge": "^8.0",
|
|
"symfony/stopwatch": "^8.0",
|
|
"symfony/web-profiler-bundle": "^8.0"
|
|
},
|
|
"config": {
|
|
"allow-plugins": {
|
|
"php-http/discovery": true,
|
|
"symfony/flex": true,
|
|
"symfony/runtime": true
|
|
},
|
|
"sort-packages": true,
|
|
"process-timeout": 600
|
|
},
|
|
"autoload": {
|
|
"psr-4": {
|
|
"App\\": "src/"
|
|
}
|
|
},
|
|
"autoload-dev": {
|
|
"psr-4": {
|
|
"App\\Tests\\": "tests/"
|
|
}
|
|
},
|
|
"replace": {
|
|
"symfony/polyfill-ctype": "*",
|
|
"symfony/polyfill-iconv": "*",
|
|
"symfony/polyfill-php72": "*",
|
|
"symfony/polyfill-php73": "*",
|
|
"symfony/polyfill-php74": "*",
|
|
"symfony/polyfill-php80": "*",
|
|
"symfony/polyfill-php81": "*",
|
|
"symfony/polyfill-php82": "*",
|
|
"symfony/polyfill-php83": "*",
|
|
"symfony/polyfill-php84": "*"
|
|
},
|
|
"scripts": {
|
|
"auto-scripts": {
|
|
"cache:clear": "symfony-cmd",
|
|
"cache:warmup": "symfony-cmd",
|
|
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
|
},
|
|
"post-install-cmd": [
|
|
"@auto-scripts"
|
|
],
|
|
"post-update-cmd": [
|
|
"@auto-scripts"
|
|
],
|
|
"test": "phpunit",
|
|
"phpstan": "phpstan analyse --memory-limit=512M",
|
|
"arch": "phpstan analyse tests/Architecture --configuration=phpstan.neon --level=1",
|
|
"cs-fix": "php-cs-fixer fix",
|
|
"cs-check": "php-cs-fixer fix --dry-run --diff",
|
|
"warmup": "bin/console cache:warmup"
|
|
},
|
|
"conflict": {
|
|
"symfony/symfony": "*"
|
|
},
|
|
"extra": {
|
|
"symfony": {
|
|
"allow-contrib": false,
|
|
"require": "8.0.*"
|
|
}
|
|
}
|
|
}
|