feat: Add persistent storage support for Redis and APCu (v0.4.0)
All checks were successful
Create Release Package / build-release (push) Successful in 56s

- Add StorageFactory class for storage adapter selection with fallback
- Support Redis storage for shared metrics across instances
- Support APCu storage for high-performance single-server deployments
- Add Storage tab in admin settings with configuration UI
- Add connection testing for Redis and APCu adapters
- Support environment variables for Docker/containerized deployments
- Update Collector to use StorageFactory instead of hardcoded InMemory
- Add all translations (English and German)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-02 16:15:53 +01:00
parent bad977bef0
commit 898af5e9d2
11 changed files with 1693 additions and 13 deletions

View File

@@ -8,9 +8,9 @@
namespace Magdev\WpPrometheus\Metrics;
use Prometheus\CollectorRegistry;
use Prometheus\Storage\InMemory;
use Prometheus\RenderTextFormat;
use Magdev\WpPrometheus\Metrics\CustomMetricBuilder;
use Magdev\WpPrometheus\Metrics\StorageFactory;
// Prevent direct file access.
if ( ! defined( 'ABSPATH' ) ) {
@@ -42,7 +42,7 @@ class Collector {
* Constructor.
*/
public function __construct() {
$this->registry = new CollectorRegistry( new InMemory() );
$this->registry = new CollectorRegistry( StorageFactory::get_adapter() );
}
/**