The EuroCMS Metrics
This will allow monitoring tools to query ECMS metrics
- Register an URL with the Routes module
- Let core.metrics.php handle it.
- Include and load the queries
When registering a module with metrics, have the component type and name, which creates the path to the metrics
The OpenMetrics will be used, to generate the output
UTF-8 MUST be used. Byte order markers (BOMs) MUST NOT be used. As an important reminder for implementers, byte 0 is valid UTF-8 while, for example, byte 255 is not.
The content type MUST be: application/openmetrics-text; version=1.0.0; charset=utf-8
Line endings MUST be signalled with line feed (\n) and MUST NOT contain carriage returns (\r). Expositions MUST end with EOF and SHOULD end with 'EOF\n'. - https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#overall-structure
Example output
# The Core EuroCMS metrics
ecms_core_total: 12
ecms_libraries_total: 34
ecms_modules_total: 56
ecms_themes_total: 78
ecms_widgets_total: 90
# The Modules EuroCMS metrics
# Users
ecms_modules_Users_total: 50
ecms_modules_Users_activated: 25
ecms_modules_Users_registered: 50
ecms_modules_Users_inactivated: 25
# Files
ecms_modules_Files_total: 50
ecms_modules_Files_image_png: 25
ecms_modules_Files_image_png: 25
# Domains
ecms_modules_Domains_website: 2
ecms_modules_Domains_total: 5
ecms_modules_Domains_redirect: 2
ecms_modules_Domains_module: 2
# Analytics
ecms_modules_analytics_browsers_firefox: 2
ecms_modules_analytics_unique_visitors: 2
Links
- https://openmetrics.io/
- https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md
- https://github.com/OpenObservability/OpenMetrics/blob/main/proto/openmetrics_data_model.proto
- https://grafana.com/blog/2020/09/01/kubecon--cloudnativecon-eu-recap-what-you-need-to-know-about-openmetrics/