All Projects → run-as-root → magento2-prometheus-exporter

run-as-root / magento2-prometheus-exporter

Licence: MIT license
Simple Magento 2 Prometheus Exporter.

Programming Languages

PHP
23972 projects - #3 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to magento2-prometheus-exporter

module-lazyload
magefan.com/magento-2-image-lazy-load-extension
Stars: ✭ 47 (+17.5%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
module-catalog
Fixes for some known Magento 2 issues in Catalog
Stars: ✭ 23 (-42.5%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
module-blog-m22
Fixes for Blog on Magento 2.2.x
Stars: ✭ 21 (-47.5%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
module-blog-sample-data
Sample data for Magento 2 blog extension
Stars: ✭ 15 (-62.5%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
module-geoip
Detect Country by IP in Magento 2
Stars: ✭ 51 (+27.5%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
module-dsu-client
No description or website provided.
Stars: ✭ 17 (-57.5%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
module-notifications
Notify the Magento 2 admin user about disabled caches or new customer reviews.
Stars: ✭ 20 (-50%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
module-dsu
No description or website provided.
Stars: ✭ 18 (-55%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
module-blog-comments-recaptcha
module-blog-comments-recaptcha
Stars: ✭ 17 (-57.5%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
module-login-as-customer
Allows admin to login as a customer (enter to customer account).
Stars: ✭ 104 (+160%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
module-translation
magefan.com/magento-2-translation-extension
Stars: ✭ 35 (-12.5%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
module-wysiwyg-advanced
Extend TinyMCE 4 & 5 tools in Magento 2
Stars: ✭ 60 (+50%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
magento-grid-colors
Magento 2 Grid Colors module for colorizing admin grids. Supports saving of states with the help of grid's bookmarks.
Stars: ✭ 54 (+35%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
Magento-Quickorder
Magento Quickorder module, enables bulk order creation by inputting SKUs & quantities.
Stars: ✭ 30 (-25%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
module-conflict-detector
magefan.com/magento2-conflict-detector
Stars: ✭ 40 (+0%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
magento-ngrok
Magento 2 module for ngrok.io service support
Stars: ✭ 45 (+12.5%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module, magento-module
magento2-catalog-lazy-load
Improve the load time of your Magento 2 categories pages by loading your images on demand with our Lazy Load Extension
Stars: ✭ 56 (+40%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module
magento2-guest-to-customer
Guest to Customer for Magento2 - Quickly and easily convert existing guest checkout customers to registered customers.
Stars: ✭ 66 (+65%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module
magento2
For any issues or questions please get in touch with us via [email protected]
Stars: ✭ 15 (-62.5%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module
Brazilian-Solutions
Este repositório permite a discussão da comunidade brasileira Magento sobre módulos e soluções para o mercado brasileiro.
Stars: ✭ 19 (-52.5%)
Mutual labels:  magento, magento2, magento-extension, magento2-extension, magento2-module

Magento 2 Prometheus Exporter

Branch stable codecov pipeline status

This Magento 2 Module exposes a new route under /metrics with Magento 2 specific metrics in the format of prometheus. The different metrics are grouped into modules and can be enabled/disabled via the Magento Backend.

Installation

Install the Module via composer by running:

composer require run-as-root/magento2-prometheus-exporter
php bin/magento setup:upgrade

Module Configuration

The modules system configuration is located under Stores -> Configuration -> Prometheus -> Metric Configuration. You can enable or disable specific metrics by using the multiselect.

Prometheus Configuration

After installing the Magento Module, your Prometheus needs to get pointed to your Magento Metrics endpoint. To do so, add the following lines to your prometheus.yml under scrape_configs:

- job_name: 'Magento 2 Exporter'
  scrape_interval: 5m
  scrape_timeout: 60s
  metrics_path: /metrics
  static_configs:
  - targets: 
    - your-magento-url

Module functionality

The module registers a cron job that runs every minute. The cronjob is responsible for aggregating the metric data. The aggregated data is stored in the table run_as_root_prometheus_metrics. The added controller collects the data stored in the table and renders the correct response for prometheus.

Metrics

The following metrics will be collected:

Metric Labels TYPE Help
magento_orders_count_total status, store_code gauge All Magento Orders
magento_orders_amount_total status, store_code gauge Total amount of all Magento Orders
magento_order_items_count_total status, store_code gauge Total count of orderitems
magento_cms_block_count_total store_code gauge Total count of available cms blocks
magento_cms_page_count_total store_code gauge Total count of available cms pages
magento_customer_count_total store_code gauge Total count of available customer
magento_cronjob_broken_count_total gauge Broken CronJobs occur when when status is pending but execution_time is set.
magento_cronjob_count_total status, job_code gauge Total count of available CronJob Count.
magento_indexer_backlog_count_total isValid, title, status gauge Total count of backlog item in indexer.
magento_shipments_count_total source, store_code counter Count of Shipments created by store and source.
magento_catalog_category_count_total status, menu_status, store_code gauge Count of Categories by store, status and menu status.
magento_store_count_total status gauge Total count of Stores by status.
magento_website_count_total gauge Total count websites.

Add you own Metric

To add a new metric, you need to implement the \RunAsRoot\PrometheusExporter\Api\MetricAggregatorInterface. The metric aggregator object is responsible for collecting the necessary information for the specific metric from magento and then add a new metric record. New records can be easily added via \RunAsRoot\PrometheusExporter\Service\UpdateMetricService.

In addition to the implementation of the MetricAggregatorInterface, you have to add your specific Aggregator to the MetricAggregatorPool defined in the di.xml. For example:

<type name="RunAsRoot\PrometheusExporter\Metric\MetricAggregatorPool">
        <arguments>
            <argument name="items" xsi:type="array">
                <item name="OrderAmountAggregator" xsi:type="object">RunAsRoot\PrometheusExporter\Aggregator\Order\OrderAmountAggregator</item>
                <item name="OrderCountAggregator" xsi:type="object">RunAsRoot\PrometheusExporter\Aggregator\Order\OrderCountAggregator</item>
                <item name="OrderItemAmountAggregator" xsi:type="object">RunAsRoot\PrometheusExporter\Aggregator\Order\OrderItemAmountAggregator</item>
                <item name="OrderItemCountAggregator" xsi:type="object">RunAsRoot\PrometheusExporter\Aggregator\Order\OrderItemCountAggregator</item>
            </argument>
        </arguments>
    </type>

Contribution

If you have something to contribute, weither it's a feature, a feature request, an issue or something else, feel free to. There are no contribution guidelines.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].