Open Bogdaan opened 3 years ago
As a developer, I want to send correct label values to prometheus.
Example:
metric name : engine_cpu label: instance = n1 label: size = "10 inches" increment: 1
How can I send this metric:
\Prometheus\CollectorRegistry::getDefault() ->getOrRegisterCounter('factory', 'engine_cpu', 'factory engine state', ['instance' => 'n1', 'size' => '10 inches']); ->inc();
But, I got an error:
Invalid label name: '10 inches'
Because assertValidLabel function validates label values, not label names https://github.com/PromPHP/prometheus_client_php/blob/bca39eb7cbdbeeed9896aa077c18ab55372eee55/src/Prometheus/Collector.php#L114
assertValidLabel
Agenda
As a developer, I want to send correct label values to prometheus.
Example:
How can I send this metric:
But, I got an error:
Because
assertValidLabel
function validates label values, not label names https://github.com/PromPHP/prometheus_client_php/blob/bca39eb7cbdbeeed9896aa077c18ab55372eee55/src/Prometheus/Collector.php#L114Proposal