PHPackages                             littlemanco/magento-prometheus - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. littlemanco/magento-prometheus

ActiveMagento-module[Logging &amp; Monitoring](/categories/logging)

littlemanco/magento-prometheus
==============================

Expose some service level Magento metrics on Prometheus

1.0.0(8y ago)5165[18 issues](https://github.com/littlemanco/magento-prometheus/issues)Apache-2.0PHP

Since Apr 28Pushed 8y ago3 watchersCompare

[ Source](https://github.com/littlemanco/magento-prometheus)[ Packagist](https://packagist.org/packages/littlemanco/magento-prometheus)[ Docs](https://github.com/sitewards/magento-prometheus/)[ RSS](/packages/littlemanco-magento-prometheus/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Project Outline
---------------

[](#project-outline)

### Project Goals

[](#project-goals)

1. Expose certain limited metrics about a store for use in diagnosing an issue
2. Provide a model to extend the metrics exposed to write arbitrary additional metrics to the endpoint

This project is intended to make it easier to introspect one, or several running Magento stores.

#### Scope

[](#scope)

All metrics should be collected on a per-instance basis, rather than for the health of a service overall. That should be calculated by querying the aggregate of all such collections.

### Similar Work

[](#similar-work)

The author understand that there is little other work of this type.

### Justification

[](#justification)

With more recent developments in infrastructure, such as Kubernetes, Docker, Prometheus et.al infrastructure is now clever enough to make changes to itself based on information supplied by the application. However, if the application does not supply that information, the infrastructure cannot make an informed decision.

### Limitations

[](#limitations)

### Summary

[](#summary)

LicenseCode StyleLocaleApache-2Zenden-AU [\[lang\]](#lang)### Compatibility

[](#compatibility)

Magento Compatibility

1.91.81.71.61.51.4Y?????Installation
------------

[](#installation)

### Requirements

[](#requirements)

- PHP
- PHP APCu

### Steps

[](#steps)

The recommended way of installing this extension is via Composer. If this is new to you, you can read more at the following URL:

This extension is available via Packagist. You can install it with composer by undertaking the following command:

```
$ composer require sitewards/magento-prometheus
```

Note: To use it, you will need to ensure that the composer autoloader is available to Magento. This package recommends the following extension to do this:

That's it! You're away.

Usage
-----

[](#usage)

This exposes a new endpoint at /metrics that exposes the metrics information about the store.

### But this information is private!

[](#but-this-information-is-private)

I agree. My suggestion would be block it in .htaccess; I don't think it's a good idea to stick it in admin, though. The endpoint should work almost no matter what.

### I have a URL that collides with /metrics

[](#i-have-a-url-that-collides-with-metrics)

That's no good! Create an issue, and I'll see about making it configurable.

Extending
---------

[](#extending)

You can add custom metrics to Prometheus from your own code. To do so, fire events using the Magento event API. Specify a suitable event name and, if necessary, add an additional data like an identification string.

```
Mage::dispatchEvent('namespace_extension_custom_event_name', ['name' => $this->sIdentificationString]);
```

Create an extension in your Magento project that will take care of the metrics being send to Prometheus. Define an observer listening to all the events you want to track. You can listen to native Magento events or define your own custom events:

```
// config.xml

                    Namespace_Extension_Model_Observer
                    pushMetric

```

In the observer class create a push-metric call utilizing the handy metric factory.

```
public function checkpointCache(Varien_Event_Observer $oEvent) {
   Mage::getModel('littlemanco_prometheus/metricFactory')
        ->getCounter(
            '',
            [
                'metric_namespace' => ','
                'metric_help' => '',
                'label_titles' => ['']
            ]
        )
        ->increment(1, [$oEvent->getType()]);
}
```

In the example above, replace ```` with a sensible name like ``'cache_flush_total'`` that describes what is counted. Replace ```` with a description that will help to understand the metric (e.g. 'The total number of times the cache has been flushed'). Change ```` to contain a sensible label for sorting in the prometheus data visualization.

Ongoing Support
---------------

[](#ongoing-support)

There will be none. Suggest that if this interests you, you fork and maintain it. Being brutally honest, my interest is fleeting, and unless there's professional sponsorship I won't carry this longer then my attention span holds out.

For me, this is a learning experience with Magento and Kubernetes.

Thanks
------

[](#thanks)

- Matthew Beane ()
- Winston Nolan

Contributing
------------

[](#contributing)

Contributions are always welcome! Nothing is too small, and the best place to start is to open an issue.

References
----------

[](#references)

[\[lang\]](#id1)Lingoes.net,. (2015). Language Code Table. Retrieved 4 June 2015, from \[FIG9\]GitHub, (2015). Proposed: security disclosure publication. Retrieved 15 May 2016, from

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3280d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29918b5ee494d49028d8e81311f328f626076e1d4d73bc080e632318e3fd0c50?d=identicon)[littlemanco](/maintainers/littlemanco)

---

Top Contributors

[![andrewhowdencom](https://avatars.githubusercontent.com/u/6720547?v=4)](https://github.com/andrewhowdencom "andrewhowdencom (42 commits)")

---

Tags

magento-extensionprometheus-exporter

### Embed Badge

![Health badge](/badges/littlemanco-magento-prometheus/health.svg)

```
[![Health](https://phpackages.com/badges/littlemanco-magento-prometheus/health.svg)](https://phpackages.com/packages/littlemanco-magento-prometheus)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
