The Docker container ships with prometheus_client 0.13, which appears to be less stringent about its inputs; however, installing the exporter alongside a current 0.4.2 version of prometheus results in many metrics not being returned at all.
By adding a try-except block around lines lines 141-151 in hypervisor_stats.py (https://github.com/att-comdev/prometheus-openstack-exporter/blob/master/exporter/hypervisor_stats.py#L141-L151), I was able to identify that prometheus_client is throwing a Duplicated timeseries in CollectorRegistry exception when assembling the metrics for delivery.
I suspect that the older version of prometheus_client was simply silently overwriting duplicate timeseries. I believe the same issue may affect all of the collector modules. Exception handling should be added around calls to the prometheus_client methods, and input should be sanitized ahead of those calls to ensure no duplicate timeseries are propagated. I'd be happy to help develop a PR to address some of this, if I can get some guidance from the project maintainers on how they'd like to see that implemented.
The Docker container ships with prometheus_client 0.13, which appears to be less stringent about its inputs; however, installing the exporter alongside a current 0.4.2 version of prometheus results in many metrics not being returned at all.
By adding a try-except block around lines lines 141-151 in hypervisor_stats.py (https://github.com/att-comdev/prometheus-openstack-exporter/blob/master/exporter/hypervisor_stats.py#L141-L151), I was able to identify that prometheus_client is throwing a
Duplicated timeseries in CollectorRegistryexception when assembling the metrics for delivery.I suspect that the older version of prometheus_client was simply silently overwriting duplicate timeseries. I believe the same issue may affect all of the collector modules. Exception handling should be added around calls to the prometheus_client methods, and input should be sanitized ahead of those calls to ensure no duplicate timeseries are propagated. I'd be happy to help develop a PR to address some of this, if I can get some guidance from the project maintainers on how they'd like to see that implemented.