run-as-root / magento2-prometheus-exporter

Simple Magento 2 Prometheus Exporter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Metrics endpoint broken when "metric_configuration/metric/metric_status" is null

Serializator opened this issue · comments

When the "metric_configuration/metric/metric_status" path in the "core_config_data" table is NULL or simply isn't present, the "/metrics" endpoint will throw an exception.

Fatal error: Uncaught TypeError: explode() expects parameter 2 to be string, null given in /magento2-prometheus-exporter/src/Data/Config.php:29

When the module is installed, you have to save the config under "Stores > Configuration > Prometheus" before the "/metrics" endpoint works.

Thank you for reaching out. Bug seems valid. I'll check the PR asap.

fixed with PR #10