run_as_root / magento2-prometheus-exporter
Magento2 Prometheus Exporter
Magento 2 Prometheus Exporter
A comprehensive Magento 2 module that exposes essential Magento metrics in Prometheus format, enabling powerful monitoring and observability for your e-commerce platform.
🚀 Features
- 📊 Rich Metrics Collection: Monitors orders, products, customers, CMS content, cron jobs, indexers, and more
- 🔧 Configurable Metrics: Enable/disable specific metrics through Magento admin interface
- 🔐 Secure by Default: The metrics endpoint requires a Bearer token unless you explicitly opt out
- ⚡ Performance Optimized: Efficient cron-based data aggregation to minimize performance impact
- 🎯 Prometheus Ready: Native Prometheus format output for seamless integration
- 🔌 Extensible Architecture: Easy to add custom metrics with clean interfaces
📋 Table of Contents
- Installation
- Configuration
- Prometheus Setup
- Available Metrics
- Security
- Custom Metrics
- CLI Commands
- Architecture
- Troubleshooting
- Contributing
- License
📦 Installation
Requirements
- Magento 2.3.x or higher
- PHP 8.2 or higher
- Composer
Install via Composer
composer require run-as-root/magento2-prometheus-exporter
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
Verify Installation
After installation, your metrics endpoint will be available at:
https://your-magento-store.com/metrics
It answers 401 You are not allowed to see these metrics. until you have generated a token, see Security.
⚙️ Configuration
Admin Configuration
Navigate to Stores → Configuration → run_as_root → Prometheus Metric Configuration to:
- Enable/disable specific metric collectors
- Configure authentication settings
- Set collection intervals
- Manage metric labels and groupings
Cron Configuration
The module automatically registers a cron job that runs every minute to aggregate metrics. The job uses a dedicated cron group: run_as_root_prometheus_metrics_aggregator.
The four order aggregators (magento_orders_amount_total, magento_orders_count_total, magento_orders_items_amount_total, magento_orders_items_count_total) each run a full scan of sales_order / sales_order_item, which is too expensive to repeat every minute on a large store. They are therefore throttled to once every 5 minutes. Their values stay constant between runs, which is correct for a gauge. All other aggregators still run on every cron tick.
The throttle remembers the last successful run in the Magento cache without a cache tag, so bin/magento cache:clean leaves it in place and only bin/magento cache:flush clears it. To force one metric to recompute right away, use bin/magento run_as_root:metric:collect --only=<metric_code>, which ignores the throttle.
🎯 Prometheus Setup
Basic Configuration
Token authorization is enabled by default, so the scrape configuration in your prometheus.yml needs the token you generated in the module configuration (see Security):
scrape_configs:
- job_name: 'magento-2'
scrape_interval: 5m
scrape_timeout: 60s
metrics_path: /metrics
scheme: https
authorization:
type: 'Bearer'
credentials: 'your-bearer-token-here'
static_configs:
- targets:
- 'your-magento-store.com'
Without Authentication
Only if you have switched token authorization off on purpose and restricted access to /metrics by other means (see Disabling Token Authorization):
scrape_configs:
- job_name: 'magento-2'
scrape_interval: 5m
scrape_timeout: 60s
metrics_path: /metrics
scheme: https
static_configs:
- targets:
- 'your-magento-store.com'
Advanced Configuration with Labels
scrape_configs:
- job_name: 'magento-2'
scrape_interval: 5m
scrape_timeout: 60s
metrics_path: /metrics
scheme: https
authorization:
type: 'Bearer'
credentials: 'your-bearer-token-here'
static_configs:
- targets:
- 'your-magento-store.com'
relabel_configs:
- source_labels: [__address__]
target_label: instance
replacement: 'magento-production'
📊 Available Metrics
Order Metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
magento_orders_count_total |
gauge | status, store_code |
Total count of orders by status and store |
magento_orders_amount_total |
gauge | status, store_code |
Total revenue by order status and store |
magento_order_items_count_total |
gauge | status, store_code |
Total count of order items |
Product & Catalog Metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
magento_products_by_type_count_total |
gauge | product_type |
Count of products by type (simple, configurable, etc.) |
magento_catalog_category_count_total |
gauge | status, menu_status, store_code |
Count of categories by status |
magento_complex_product_variations_above_recommended_level |
gauge | - | Count of configurable products with more than 50 variations (performance risk) |
magento_products_with_bad_reviews_count_total |
gauge | store_code |
Count of products whose rating_summary is below 60 (≈ 3 of 5 stars) |
EAV & Attribute Metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
magento_eav_attribute_count_total |
gauge | - | Total count of EAV attributes |
magento_eav_attribute_options_above_recommended_level_total |
gauge | - | Count of attributes with more than 100 options (performance risk) |
Customer Metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
magento_customer_count_total |
gauge | store_code |
Total count of registered customers |
Content Metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
magento_cms_block_count_total |
gauge | store_code |
Count of CMS blocks |
magento_cms_page_count_total |
gauge | store_code |
Count of CMS pages |
System Health Metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
magento_cronjob_count_total |
gauge | status, job_code |
Count of cron jobs by status |
magento_cronjob_broken_count_total |
gauge | - | Count of broken cron jobs |
magento_indexer_backlog_count_total |
gauge | title |
Count of items in indexer backlog |
magento_cache_flush_count_total |
counter | - | Cumulative count of bin/magento cache:flush / admin flush-storage invocations |
Infrastructure Metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
magento_store_count_total |
gauge | status |
Count of stores by status |
magento_website_count_total |
gauge | - | Total count of websites |
magento_shipments_count_total |
counter | source, store_code |
Count of shipments created |
magento_quotes_over_item_limit_count_total |
gauge | store_code |
Count of active carts with more than 100 items (performance risk) |
🔐 Security
/metrics is a storefront route, so it is reachable by everybody who can reach your shop. It exposes business figures (revenue and order counts per store and order state, customer and admin user counts) as well as operational details (cron, indexer and module state). Treat it like any other internal API.
Authentication Setup
Token authorization is enabled by default: /metrics rejects every request with 401 until a token has been saved, and afterwards answers only requests that carry it.
- Open the Module Configuration: Navigate to Magento Admin → Stores → Configuration → run_as_root → Prometheus Metric Configuration → Security Settings for the Prometheus Scrape Config
- Generate a Token: Leave "Enable token authorization" on "Yes", click Generate and save the configuration
- Configure Prometheus: Use the token as
authorization.credentialsin your scrape configuration
The token is the one from the module configuration. An access token from System → Integrations does not work.
To set the token from the command line instead, e.g. in a deployment:
bin/magento config:set metric_configuration/security/token "$(openssl rand -hex 32)"
Verify the result:
curl -i https://your-magento-store.com/metrics # 401
curl -i -H 'Authorization: Bearer <token>' https://your-magento-store.com/metrics # 200
Disabling Token Authorization
Setting "Enable token authorization" to "No" makes /metrics readable for everybody who can reach your storefront. Only do this if access is restricted elsewhere, for example with the IP allow-list below.
Upgrading from 4.3.0 or Older
Up to 4.3.0 the endpoint was open unless token authorization had been switched on. Version 4.4.0 closes it on every installation, so Prometheus receives 401 after the update until it sends a token.
What the update does:
- Token authorization is enabled by default.
bin/magento setup:upgraderemoves every stored "Enable token authorization: No", in all scopes, exactly once. The old configuration form did not say that "No" makes the metrics public, and saving the section for any other reason stored that "No" as well, so a stored value could not be taken as a decision. The removal is logged as a warning invar/log/system.log.- A stored "Yes" and an existing token are kept. If you already scrape with a token, nothing changes for you.
What you have to do:
- Generate a token as described in Authentication Setup and add it to your scrape configuration.
- Or, if access to
/metricsis restricted by other means and you want it to stay anonymous, set "Enable token authorization" to "No" again after the update. That choice is kept from then on, later updates do not touch it.
Then check every store domain. Without a token the endpoint has to answer 401:
curl -i https://your-magento-store.com/metrics
The reset only covers values stored in the database. A value pinned in app/etc/config.php or app/etc/env.php, or set through a CONFIG__ environment variable, is a deployment decision and stays as it is. If the check answers 200 although you did not opt out, look there. The following command prints 0 when token authorization is switched off for the default scope, no matter where that value comes from, and an empty line when the default applies. Add --scope and --scope-code to check a website or store view:
bin/magento config:show metric_configuration/security/enable_token
Best Practices
- Always use HTTPS for metrics endpoints in production
- Regularly rotate authentication tokens
- Restrict access to metrics endpoint via firewall rules
- Monitor access logs for unusual activity
IP Whitelisting
Consider restricting access to your Prometheus server IPs:
location /metrics {
allow 10.0.0.0/8; # Your Prometheus server
allow 172.16.0.0/12; # Internal network
deny all;
try_files $uri $uri/ /index.php?$args;
}
🔧 Custom Metrics
Creating a Custom Metric Aggregator
- Implement the Interface:
<?php
namespace YourNamespace\YourModule\Aggregator;
use RunAsRoot\PrometheusExporter\Api\MetricAggregatorInterface;
use RunAsRoot\PrometheusExporter\Service\UpdateMetricService;
class CustomMetricAggregator implements MetricAggregatorInterface
{
private UpdateMetricService $updateMetricService;
public function __construct(UpdateMetricService $updateMetricService)
{
$this->updateMetricService = $updateMetricService;
}
public function aggregate(): void
{
// Your metric collection logic here
$value = $this->calculateCustomMetric();
$this->updateMetricService->update(
'your_custom_metric_total',
(string) $value,
'gauge',
'Description of your custom metric',
['label1' => 'value1', 'label2' => 'value2']
);
}
private function calculateCustomMetric(): int
{
// Implement your metric calculation
return 42;
}
}
- Register in DI Configuration (
etc/di.xml):
<type name="RunAsRoot\PrometheusExporter\Metric\MetricAggregatorPool">
<arguments>
<argument name="items" xsi:type="array">
<item name="YourCustomAggregator" xsi:type="object">YourNamespace\YourModule\Aggregator\CustomMetricAggregator</item>
</argument>
</arguments>
</type>
Example: Product Rating Aggregator
<?php
namespace YourNamespace\YourModule\Aggregator;
use Magento\Review\Model\ResourceModel\Review\CollectionFactory;
use RunAsRoot\PrometheusExporter\Api\MetricAggregatorInterface;
use RunAsRoot\PrometheusExporter\Service\UpdateMetricService;
class ProductRatingAggregator implements MetricAggregatorInterface
{
private CollectionFactory $reviewCollectionFactory;
private UpdateMetricService $updateMetricService;
public function __construct(
CollectionFactory $reviewCollectionFactory,
UpdateMetricService $updateMetricService
) {
$this->reviewCollectionFactory = $reviewCollectionFactory;
$this->updateMetricService = $updateMetricService;
}
public function aggregate(): void
{
$collection = $this->reviewCollectionFactory->create()
->addStatusFilter(\Magento\Review\Model\Review::STATUS_APPROVED);
$averageRating = $collection->getConnection()
->fetchOne('SELECT AVG(rating_value) FROM rating_option_vote');
$this->updateMetricService->update(
'magento_product_average_rating',
(string) round($averageRating, 2),
'gauge',
'Average product rating across all approved reviews'
);
}
}
💻 CLI Commands
Collect Metrics Manually
php bin/magento run_as_root:metrics:collect
View Current Metrics
php bin/magento run_as_root:metrics:show
Clear Metrics Data
php bin/magento run_as_root:metrics:clear
🏗️ Architecture
Data Flow
- Cron Execution: Every minute, the
run_as_root_prometheus_metrics_aggregatorcron group executes - Metric Aggregation: Each enabled aggregator collects and processes data
- Data Storage: Aggregated metrics are stored in
run_as_root_prometheus_metricstable - Endpoint Response:
/metricscontroller serves data in Prometheus format
Key Components
- MetricAggregatorInterface: Contract for all metric collectors
- MetricAggregatorPool: Registry of all available aggregators
- UpdateMetricService: Service for storing metric data
- PrometheusController: HTTP endpoint for serving metrics
Database Schema
The module creates a dedicated table run_as_root_prometheus_metrics with the following structure:
metric_id: Primary keymetric_code: Unique metric identifiermetric_value: Numeric valuemetric_type: Type (gauge, counter, histogram)metric_help: Description textmetric_labels: JSON-encoded labelsupdated_at: Last update timestamp
🔍 Troubleshooting
Common Issues
Metrics Not Updating
# Check cron status
php bin/magento cron:status
# Run metrics collection manually
php bin/magento run_as_root:metrics:collect
# Check system logs
tail -f var/log/system.log | grep prometheus
401 on /metrics
Token authorization is enabled by default. /metrics answers 401 You are not allowed to see these metrics. until a token has been generated, and whenever a request does not carry it as Authorization: Bearer <token>. See Security.
Permission Denied on /metrics
- Verify web server has read access to Magento files
- Check Magento file permissions:
find . -type f -exec chmod 644 {} \; - Ensure proper ownership:
chown -R www-data:www-data .
High Memory Usage
- Reduce collection frequency in cron configuration
- Disable unused metric aggregators in admin configuration
- Consider implementing metric data retention policies
Debug Mode
Enable debug logging by adding to app/etc/env.php:
'system' => [
'default' => [
'prometheus_exporter' => [
'debug' => '1'
]
]
]
Performance Monitoring
Monitor the impact of metric collection:
# Check metric collection execution time
grep "prometheus.*aggregator" var/log/system.log
# Monitor database table size
SELECT COUNT(*) as total_metrics,
MAX(updated_at) as last_update
FROM run_as_root_prometheus_metrics;
🤝 Contributing
We welcome contributions! Here's how you can help:
Development Setup
- Fork the repository
- Clone your fork:
git clone https://gitlab.com/your-username/magento2-prometheus-exporter.git - Install dependencies:
composer install - Create a feature branch:
git checkout -b feature/your-feature-name
Code Standards
- Follow Magento 2 coding standards
- Write unit tests for new features
- Update documentation for new metrics or features
- Use meaningful commit messages
Pull Request Process
- Ensure all tests pass:
vendor/bin/phpunit - Update the CHANGELOG.md
- Submit a pull request with a clear description
- Respond to code review feedback
Reporting Issues
Please include:
- Magento version
- PHP version
- Module version
- Detailed error messages
- Steps to reproduce
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- run_as_root GmbH - Original development and maintenance
- Prometheus Community - For the excellent monitoring toolkit
- Magento Community - For feedback and contributions
📞 Support
- Email: [email protected]
- GitLab Issues: Report a bug
- Documentation: Wiki
Made with ❤️ by run_as_root
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to
Semantic Versioning.
[4.4.2] - 2026-11-25
Fixed
- Installations with a database table prefix (#48): 19 aggregators asked the DB adapter for their table names (
$connection->getTableName()). The adapter only shortens over-long names; the table prefix is applied byMagento\Framework\App\ResourceConnection::getTableName()alone. With a prefix their queries failed with "Base table or view not found" on every run, and these metrics were missing from/metrics: admin users, categories, customers (count, addresses, groups), EAV attributes and attribute options, orders and order items (count and amount), products (count, by type, complex variations), products with bad reviews, quotes over the item limit, shipments, indexer changelog size and indexer last call. All of them now resolve table names throughResourceConnection. - This covers the order count and order amount metrics from #71 as well. That change replaced the hard-coded
sales_orderandstoretable names, but still took the names from the adapter, so both metrics kept failing with a prefix. Thanks to Łukasz Bajsarowicz for bringing the problem up.
Upgrade notes
- Nothing to do. Without a table prefix the queries address the same tables as before.
- There is no installable 4.4.1. That tag exists on GitHub, but its
composer.jsonstill declares version 4.4.0, so Packagist does not offer it. 4.4.2 contains its changes.
[4.4.0] - 2026-11-25
Security
/metricsno longer answers anonymous requests by default (CWE-1188, insecure default). Token authorization (metric_configuration/security/enable_token) was opt-in and had no default, so a freshly installed module served every metric - revenue and order figures per store and order state, customer and admin user counts, cron and indexer state - to anybody who could reach the storefront. It now defaults to enabled insrc/etc/config.xml. Thanks to Łukasz Bajsarowicz for the report.- A stored "Enable token authorization: No" is removed once during
setup:upgrade, in every scope (ResetDisabledTokenAuthorizationDataPatch). The old configuration form did not say that "No" makes the metrics public, and saving the section for any other reason stored that "No" as well, so without the reset those installations would have stayed open after the update. - The endpoint fails closed while no token is saved. "Token authorization enabled, token empty" used to compare the
Authorizationheader withBearerfollowed by an empty string, which matches if the web server passes a trailing space on to PHP. Now every request is rejected until a token has been generated. - The token is compared with
hash_equals()(constant time) instead of!==. Controller\Adminhtml\Prometheus\GenerateToken, the action behind the "Generate" button in the configuration, now extendsMagento\Backend\App\Actionand requires theRunAsRoot_PrometheusExporter::config_runasroot_prometheusexporterACL resource. As a plain framework action it was not covered by Magento's admin authentication and returned a random token string to requests without an admin session. Nothing was stored or disclosed by that, but an admin route must not be reachable without a login.
Changed
- Admin configuration: "Enable token authorization" has a "Use system value" checkbox and explains what switching it off means; the token field states that
/metricsrejects every request until a token is saved. - README: the Security section described creating an access token under System → Integrations, which the module has never read. It now documents the module's own token, the opt-out and the upgrade path, and the scrape configuration examples use the token and
scheme: https.
Upgrade notes
- Action required unless Prometheus already scrapes with a token: after the update
/metricsanswers401 You are not allowed to see these metrics.on every installation. Generate a token under Stores → Configuration → run_as_root → Prometheus Metric Configuration → Security Settings and add it to your scrape configuration asauthorization.credentials. From the command line:bin/magento config:set metric_configuration/security/token "$(openssl rand -hex 32)". - If you had switched token authorization off on purpose, because
/metricsis restricted by a firewall or web server allow-list:setup:upgraderemoves that stored "No" once and logs it as a warning invar/log/system.log. Set "Enable token authorization" to "No" again after the update. That choice is kept from then on. - The reset only covers values stored in the database. Values pinned in
app/etc/config.php,app/etc/env.phpor aCONFIG__environment variable stay as they are. Verify withcurl -i https://your-magento-store.com/metricson every store domain: without a token it has to answer401. GenerateTokennow takes aMagento\Backend\App\Action\Context, so runbin/magento setup:di:compileafter updating.
[4.3.0] - 2026-08-04
Added
IntervalAwareMetricAggregatorInterface: an optional interface an aggregator can implement to declare a minimum number of seconds between runs.AggregateMetricsCronskips such an aggregator until that interval has passed, using the Magento cache to remember the last successful run. Aggregators that do not implement it keep their existing per-cron-tick behaviour, so this is additive for third-party aggregators.
Fixed
OrderAmountAggregator,OrderCountAggregator,OrderItemAmountAggregator,OrderItemCountAggregator: all four still run an unbounded full-table scan oversales_order/sales_order_itemon every cron tick even after the N+1 fix in 4.2.1, and are the largest contributors to the DB load reported in #69. They now implementIntervalAwareMetricAggregatorInterfaceand are throttled to once every 5 minutes instead of every minute, while every other (cheap) aggregator keeps its existing per-minute schedule.AggregateMetricsCron: a cache-backend exception while checking/marking an interval-throttled aggregator's last run no longer aborts the rest of that cron tick's aggregator loop, and an aggregator whoseaggregate()returnsfalse(a soft failure) is no longer falsely marked as a successful run - it retries on the next tick instead of being suppressed for 5 minutes.
Upgrade notes
AggregateMetricsCrongained aMagento\Framework\App\CacheInterfaceconstructor argument and is injected as a proxy insrc/etc/di.xml, so runbin/magento setup:di:compileafter updating.- The throttle marker is stored in the Magento cache without tags.
bin/magento cache:cleandoes not clear it;bin/magento cache:flushdoes. To force a throttled metric to recompute immediately, usebin/magento run_as_root:metric:collect --only=<metric_code>, which ignores the throttle by design.
[4.2.2] - 2026-07-09
Fixed
IndexerBacklogCountAggregator/IndexerChangelogCountAggregator: skip indexers that are not in Update by Schedule mode, since those never have a*_clchangelog table and were erroring on every cron run.IndexerBacklogCountAggregatoralso catchesChangelogTableNotExistsExceptionper indexer and logs it instead of aborting the whole aggregation, so one missing table can no longer stop the backlog metric from updating for every other indexer.
[4.2.1] - 2026-07-09
Fixed
OrderItemCountAggregator/OrderItemAmountAggregator: replaced the per-order N+1 collection loading (fullsales_orderscan plus one order-item collection load per order, every cron minute) with a single streamed query oversales_order_item. Item status is derived from the qty columns mirroringMagento\Sales\Model\Order\Item::getStatusId(), including children-inherited backorder; emitted series and labels are unchanged. The aggregators no longer unserializeproduct_options, so a corrupt row cannot abort the whole metric anymore.
[4.1.0] - 2026-05-28
Changed
symfony/consoleconstraint widened to^5.4.46|^6.0|^7.0for Magento 2.4.9 compatibility. (#65)- Test suite modernised: removed
getMockForAbstractClass()usage (deprecated in PHPUnit 10+), replacedreturnCallback()pattern to resolve deprecation notices, and completed mock method definitions. (#65)
[4.0.0] - 2026-04-20
Added
- GitHub Actions CI via
graycoreio/github-actions-magento2against the Mage-OSsupported-versionmatrix (Magento 2.4.6-p14 / 2.4.7-p9 / 2.4.8-p4). Unit tests, DI compile, Magento coding standard, and integration tests all run on every push and PR. (#60) phpcs.xml.distwith the Magento2 coding standard and project-specific exclusions.magento_complex_product_variations_above_recommended_level(gauge) — count of configurable products with more than 50 variations. (#25)magento_quotes_over_item_limit_count_total(gauge,store_codelabel) — count of active carts with more than 100 items. (#32)magento_products_with_bad_reviews_count_total(gauge,store_codelabel) — count of products withrating_summary < 60. Guarded byMagento_Reviewmodule-enabled check. (#26)magento_cache_flush_count_total(counter) — incremented on everyMagento\Framework\App\Cache\Manager::flush()invocation via a plugin. (#29)UpdateMetricServiceInterface::increment(string $code, array $labels = []): boolfor counter semantics.
Changed
- BREAKING: minimum PHP requirement is now 8.2 (was 7.4).
- BREAKING:
UpdateMetricServiceInterfacegained theincrement()method — downstream implementers must add it. magento/module-quoteis now a runtime dependency (added tocomposer.jsonrequire andmodule.xmlsequence).magento/module-reviewis now suggested; the bad-reviews aggregator no-ops if the module isn't installed.- Test suite migrated from phpunit 9.x patterns (
withConsecutive,at(),onConsecutiveCalls) towillReturnCallbackso it runs green on phpunit 9/10/12. composer.jsondeclaresrepositories.mage-os(public Mage-OS mirror) andconfig.allow-pluginsfor the Magento composer plugins graycore's coding-standard job pulls in.
Fixed
Test/Integration/Controller/IndexControllerTestnow supplies themetric_configuration/security/enable_tokenfixture so the test actually exercises the token validation code path.- Several unit tests had stale constructor mocks and mock-expectation drift versus current production signatures; all updated.
src/view/adminhtml/templates/system/config/tokenGeneratorButton.phtml: switched from deprecated$block->escape*to$escaper->escape*and fixed an unescaped-output XSS sniff.
Removed
- BREAKING: deleted
build/tools/(legacy GitLab-CI tooling). Closes GHSA-r39x-jcww-82v6 (symfony/process MSYS2 arg escaping).
[2.0.2] - 2021-06-11
Fixed
- Reset order count/amount metric before setting them
[2.0.1] - 2021-05-31
Fixed
- Fix order count reset
[2.0.0] - 2020-05-15
Added
- Added new CLI Command:
run_as_root:metrics:collect. - Added
CronJobCountAggregatorto collect metricmagento_cronjob_count_total. - Added
BrokenCronJobCountAggregatorto collect metricmagento_cronjob_broken_count_total. - Added
IndexerBacklogCountAggregatorto collect metricmagento_indexer_backlog_count_total. - Introduced custom cron group
run_as_root_prometheus_metrics_aggregator.
Changed
- Added some Interfaces instead of hard file links.
- Changed CLI namespace to
run_as_root. - Made all Test Cases final.
- Restructured module directories.
- Updated Readme.
Removed
- Removed Licenses from PHP Files.
[1.0.0] - 2019-06-14
Added
- Basic Module structure
- Metric Collector via Cron
- Console Command to view current metrics
- Cms Aggregator
- Order Aggregator
- Some basic readme
- Prometheus example configuration
- Basic Test Coverage
- StyleCi Integration
[1.0.1] - 2019-06-14
Changed
- Fixed composer.json
[1.0.2] - 2019-06-14
Removed
- Removed version from composer.json
[1.1.0] - 2019-06-18
Added
- CodeCov
- Customer Aggregator
- Additional Unit Tests
- Config wil be evaluated
- Updated Readme
Changed
- Fixed Metric Format
- Configuration is now Multiselect
[1.2.0] - 2019-07-10
Changed
- Interpret all metric aggregators as enabled when config value is NULL
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 4.4.2 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2026-11-25 12:39:16 |
| 4.4.0 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2026-11-25 10:56:46 |
| 4.3.0 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2026-08-04 18:24:22 |
| 4.2.2 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2026-07-09 16:57:47 |
| 4.2.1 | stable | Not tested | Not yet tested Details | 2026-07-09 16:16:37 |
| 4.1.0 | stable | Fail | Magento 2.4.7-2.4.8 Details | 2026-05-28 14:32:16 |
| 4.0.0 | stable | Not tested | Not yet tested Details | 2026-04-20 13:44:03 |
| 3.2.6 | stable | Not tested | Not yet tested Details | 2025-12-28 12:14:51 |
| 3.2.5 | stable | Not tested | Not yet tested Details | 2025-12-19 14:19:30 |
| 3.2.4 | stable | Not tested | Not yet tested Details | 2025-08-29 12:52:00 |
| 3.2.3 | stable | Not tested | Not yet tested Details | 2025-06-03 06:47:10 |
| 3.2.2 | stable | Not tested | Not yet tested Details | 2024-11-12 11:42:28 |
| 3.2.1 | stable | Not tested | Not yet tested Details | 2024-11-07 10:27:50 |
| 3.2.0 | stable | Not tested | Not yet tested Details | 2024-11-07 10:27:01 |
| 3.1.6 | stable | Not tested | Not yet tested Details | 2023-11-22 08:05:19 |
| 3.1.5 | stable | Not tested | Not yet tested Details | 2023-08-21 15:17:58 |
| 3.1.4 | stable | Not tested | Not yet tested Details | 2023-07-07 09:18:46 |
| 3.1.3 | stable | Not tested | Not yet tested Details | 2023-07-07 09:08:32 |
| 3.1.2 | stable | Not tested | Not yet tested Details | 2023-07-07 08:48:58 |
| 3.1.1 | stable | Not tested | Not yet tested Details | 2023-06-26 07:11:38 |
| 3.1.0 | stable | Not tested | Not yet tested Details | 2023-06-23 14:55:53 |
| 3.0.1 | stable | Not tested | Not yet tested Details | 2021-12-06 08:27:49 |
| 2.0.2 | stable | Not tested | Not yet tested Details | 2021-06-14 10:56:49 |
| 2.0.1 | stable | Not tested | Not yet tested Details | 2021-06-01 08:39:32 |
| 2.0.0 | stable | Not tested | Not yet tested Details | 2021-06-01 08:37:53 |
| 1.2.0 | stable | Not tested | Not yet tested Details | 2019-07-10 09:13:15 |
| 1.1.0 | stable | Not tested | Not yet tested Details | 2019-06-18 09:11:40 |
| 1.0.2 | stable | Not tested | Not yet tested Details | 2019-06-14 15:42:05 |
| 1.0.1 | stable | Not tested | Not yet tested Details | 2019-06-14 15:37:50 |
Requires 20
| Package | Constraint |
|---|---|
| guzzlehttp/guzzle | ^7.4.5 |
| laminas/laminas-http | ^2.15.0 |
| magento/framework | * |
| magento/module-backend | * |
| magento/module-catalog | * |
| magento/module-cms | * |
| magento/module-config | * |
| magento/module-cron | * |
| magento/module-eav | * |
| magento/module-indexer | * |
| magento/module-payment | * |
| magento/module-quote | * |
| magento/module-sales | * |
| magento/module-shipping | * |
| magento/module-store | * |
| magento/zend-db | * |
| monolog/monolog | ^2.9.0|^3.0 |
| php | ^8.2 |
| psr/log | ^1.1|^2.0|^3.0 |
| symfony/console | ^5.4.46|^6.0|^7.0 |
Requires-dev 1
| Package | Constraint |
|---|---|
| phpunit/phpunit | ^9.5|^10.0 |
Conflicts 4
| Package | Constraint |
|---|---|
| guzzlehttp/guzzle | <7.4.5 |
| monolog/monolog | <2.9.0 |
| symfony/console | <5.4.46 |
| symfony/process | <5.4.46 |
Suggests 1
| Package | Reason |
|---|---|
| magento/module-review | Enables the magento_products_with_bad_reviews_count_total metric |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. A phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Fail | 333 | 36 errors, 297 warnings (ruleset: Magento2), 28 auto-fixable with phpcbf |
| PHPMD | Warning | 15 | 15 rule violations (MissingImport:9, UnusedFormalParameter:3, ExcessiveMethodLength:1, TooManyPublicMethods:1, UnusedLocalVariable:1) |
| Cpd | Warning | 6 | 6 duplicated chunks spanning 231 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 15 | valid; 15 advisory notes (composer validate --strict) |
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
More from run_as_root
View vendorTurn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.