stacknuts / magento-stackgauge-cloudflare-cache
Compatibility module: reports StackNuts_CloudflareCache's purge-queue status into a StackNuts_StackGauge fleet report. Contains only glue code - install it alongside both parent modules to enable the integration.
Package info
github.com/StackNuts/magento-stackgauge-cloudflare-cache
Type:magento2-module
pkg:composer/stacknuts/magento-stackgauge-cloudflare-cache
Requires
- php: ~8.1.0||~8.2.0||~8.3.0||~8.4.0
- magento/framework: >=103.0 <104
- stacknuts/magento-cloudflare-cache: >=2.0 <3.0
- stacknuts/magento-stackgauge: >=0.1 <1.0
Requires (Dev)
- phpunit/phpunit: ^10.5 || ^11.5 || ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A compatibility module: reports stacknuts/magento-cloudflare-cache's
purge-queue status into a stacknuts/magento-stackgauge
fleet report, via StackGauge's pluggable ReporterInterface.
Why a separate module
Both parent modules are independently useful, independently published, and shouldn't have to
know about each other. This module - not either of them - is the only place that depends on
both, following the same "compatibility module" pattern Magento core itself uses for optional
cross-module integrations (e.g. Magento_CatalogInventoryGraphQl, Magento_PaypalGraphQl):
a small module named after the pair it bridges, containing only glue code.
Install it and both are wired together automatically. Don't install it, and both modules
work exactly as if it didn't exist - no partial functionality, no missing classes, no
setup:di:compile risk on either parent module installed alone.
Installation
Requires both parent modules to already be installed.
composer require stacknuts/magento-stackgauge-cloudflare-cache bin/magento module:enable StackNuts_StackGaugeCloudflareCache bin/magento setup:upgrade
What it does
Registers Model/StackGaugeReporter.php against StackGauge's ReporterPool, contributing a
cloudflare block to every StackGauge full report:
{
"cloudflare": {
"schema_version": "1.0",
"label": "Cloudflare",
"description": "Whether Cloudflare is the active cache type, and the current delayed-purge-queue backlog.",
"sections": [
{
"kind": "facts",
"key": "general",
"label": "General",
"description": "Whether Cloudflare is the active cache type, and the current delayed-purge-queue backlog.",
"fields": {
"enabled": {"type": "bool", "label": "Enabled", "value": true},
"purge_queue_backlog": {"type": "number", "label": "Purge Queue Backlog", "value": 0, "metric_key": "cloudflare.purge_queue_backlog"},
"queue_oldest_pending_seconds": {"type": "number", "label": "Queue Oldest Pending (seconds)", "value": 0, "metric_key": "cloudflare.queue_oldest_pending_seconds"}
}
}
]
}
}
enabled: whether Cloudflare is currently the active Full Page Cache type (StackNuts\CloudflareCache\Model\Config::isActive()).purge_queue_backlog: pending tag count in the delayed purge queue (StackNuts\CloudflareCache\Model\ResourceModel\PurgeQueue::getPendingCount()) - naturally0whenever the delayed queue is disabled, since nothing is ever enqueued in that mode.queue_oldest_pending_seconds: age in seconds of the oldest tag still waiting in the queue (PurgeQueue::getOldestPendingAgeInSeconds()),0when the queue is empty. A sustained high value is a proxy for the drain cron having stopped running.
Both queue fields are declared as trackable metrics (MetricCatalogInterface), so a
StackGauge dashboard auto-creates an editable alert rule for each the first time it syncs this
module's config - "Purge Queue Backlog > 50" and "Oldest Pending Purge > 1800s", both over a
15-minute window by default. No configuration of its own beyond that - no admin UI, nothing to
disable independently - remove the module (or uninstall either parent) to turn the integration
off.
License
PolyForm Shield 1.0.0, same as
stacknuts/magento-stackgauge. See LICENSE.