feat(Production): Complete production deployment infrastructure

- Add comprehensive health check system with multiple endpoints
- Add Prometheus metrics endpoint
- Add production logging configurations (5 strategies)
- Add complete deployment documentation suite:
  * QUICKSTART.md - 30-minute deployment guide
  * DEPLOYMENT_CHECKLIST.md - Printable verification checklist
  * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle
  * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference
  * production-logging.md - Logging configuration guide
  * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation
  * README.md - Navigation hub
  * DEPLOYMENT_SUMMARY.md - Executive summary
- Add deployment scripts and automation
- Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment
- Update README with production-ready features

All production infrastructure is now complete and ready for deployment.
This commit is contained in:
2025-10-25 19:18:37 +02:00
parent caa85db796
commit fc3d7e6357
83016 changed files with 378904 additions and 20919 deletions

View File

@@ -11,11 +11,11 @@ final class OperationHandle
{
/**
* @param string $operationId ID of the operation
* @param UnifiedTelemetryService $telemetryService Telemetry service that created this handle
* @param TelemetryService $telemetryService Telemetry service that created this handle
*/
public function __construct(
private readonly string $operationId,
private readonly UnifiedTelemetryService $telemetryService
private readonly TelemetryService $telemetryService
) {
}

View File

@@ -0,0 +1,100 @@
<?php
declare(strict_types=1);
namespace App\Framework\Telemetry;
/**
* Telemetry Service Interface
*
* Defines core telemetry operations for tracing, metrics, and events.
* Implementations can vary from full-featured (UnifiedTelemetryService)
* to simplified test implementations.
*/
interface TelemetryService
{
/**
* Start a traced operation
*
* @param string $name Operation name (e.g., 'livecomponent.lifecycle.UserCard')
* @param string $type Operation type (e.g., 'livecomponent', 'http', 'database')
* @param array<string, mixed> $attributes Additional context attributes
* @return OperationHandle Handle to end operation later
*/
public function startOperation(
string $name,
string $type,
array $attributes = []
): OperationHandle;
/**
* Trace a callable with automatic operation lifecycle
*
* @template T
* @param string $name Operation name
* @param string $type Operation type
* @param callable(): T $callback Callback to trace
* @param array<string, mixed> $attributes Additional context
* @return T Result of callback
*/
public function trace(
string $name,
string $type,
callable $callback,
array $attributes = []
): mixed;
/**
* Record a metric value
*
* @param string $name Metric name
* @param float $value Metric value
* @param string $unit Unit of measurement (e.g., 'ms', 'MB', 'count')
* @param array<string, mixed> $attributes Additional context
*/
public function recordMetric(
string $name,
float $value,
string $unit = '',
array $attributes = []
): void;
/**
* Record an event
*
* @param string $name Event name
* @param array<string, mixed> $attributes Event data
* @param string $severity Event severity ('debug', 'info', 'warning', 'error')
*/
public function recordEvent(
string $name,
array $attributes = [],
string $severity = 'info'
): void;
/**
* End an operation
*
* @param string $operationId ID of the operation to end
* @param string|null $status Status of the operation (success, error)
* @param string|null $errorMessage Error message if the operation failed
*/
public function endOperation(
string $operationId,
?string $status = null,
?string $errorMessage = null
): void;
/**
* Add an attribute to an operation
*
* @param string $operationId ID of the operation
* @param string $key Attribute key
* @param mixed $value Attribute value
*/
public function addOperationAttribute(
string $operationId,
string $key,
mixed $value
): void;
}

View File

@@ -21,7 +21,7 @@ use Throwable;
* Unified telemetry service that provides a central point for collecting and exporting telemetry data
*/
#[Singleton]
final class UnifiedTelemetryService
final class UnifiedTelemetryService implements TelemetryService
{
/**
* @var array<TelemetryExporterInterface> Exporters for telemetry data