Coder Social home page Coder Social logo

maxfrerichs / typo3-prometheus Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 46 KB

This extension generates Prometheus-readable metrics from system status informations (more info on "How it works") and exposes them on an endpoint.

License: GNU General Public License v2.0

PHP 100.00%
monitoring-plugin prometheus-client typo3-cms-extension

typo3-prometheus's Introduction

TYPO3 Extension 'typo3-prometheus'

About this extension:

This extension generates Prometheus-readable metrics from system status informations (more info on "How it works") and exposes them on an endpoint.

Requirements

  • TYPO3 11.5 or higher
  • PHP 8.0 or higher

How it works

  • TYPO3 has a system extension called "cms-reports" that provides information about your TYPO3 system and the enviroment. While system reports are displayed in a backend module, reports are not exported in any way.
  • "cms-reports" provides an API that can be used to register status providers in your installation. Every status provider can provide one or multiple status reports.
  • Every status report consists of title, severity, message and value.
  • severity is a numeric value ranging from -1 (info) to 2 (error) that can be used to generate gauge metrics. "Gauge" is one of the core metric types offered by the Prometheus client library.

How to use:

  • Install extension with composer req maxfrerichs/typo3-prometheus in your favourite TYPO3 distribution
  • Configure your web server to serve your TYPO3 on a non-HTTP port, default is 9090. Be advised: Do not expose this port to the web, this extension provides no built-in authentication mechanism to limit access from public. You should implement your own security means if you want to expose the endpoint to the web.
  • Install and configure prometheus on the same web server. Please refer to the Prometheus documentation for more information regarding this topic

Known issues

  • Using the StatusRegistry class directly via Dependency Injection causes Extbase frontend plugins to break, as ConfigurationManager is invoked at some point without $GLOBALS['TYPO3_REQUEST'] being set, causing it to fallback to BackendConfigurationManager, while we are in frontend. This prevents us from automatically aggregating all registered Status reports as Prometheus metrics and some status reports relying on Extbase functionality cannot be used.

API

Registration of custom StatusProvider classes is possible by creating event listeners listening to the RegisterStatusProviderEvent and call $event->injectStatusProvider() in your event listener. Note: When using TYPO3 11.5, you may need to make classes implementing StatusProviderInterface public in your Configuration/Service.yaml file.

TODO:

  • Add support for other metric types (optional).
  • Add support for older TYPO3 versions.
  • Add more metrics

Contribution:

Just do it. Open an issue, tell me your ideas, request a specific feature, report bugs and so on. You can also write an e-mail to "[email protected]" :-)

typo3-prometheus's People

Contributors

maxfrerichs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.