If I collect a metric and have done so for some time, but now decide I want to add an additional label to samples going forward, what would be the intended way to do so?
As far as I can tell, the Collector throws an exception if the label count doesn't match, but that practically never happens as the labels aren't loaded when a new process tries to update a sample with different labels, leading to undefined behavior.
With main1.php (bootstrapping excluded for brevity):
$ php main1.php
# HELP test_some_counter it increases
# TYPE test_some_counter counter
test_some_counter{shape="square"} 3
$ php main2.php
PHP Warning: array_combine(): Both parameters should have an equal number of elements in <snip>/vendor/endclothing/prometheus_client_php/src/Prometheus/RenderTextFormat.php on line 43
PHP Warning: Invalid argument supplied for foreach() in <snip>/vendor/endclothing/prometheus_client_php/src/Prometheus/RenderTextFormat.php on line 44
# HELP test_some_counter it increases still
# TYPE test_some_counter counter
test_some_counter{} 3
test_some_counter{shape="square",color="blue"} 3
Imo, I should be able to add new dimensions to my samples as my application grows.
Hi, I've got a quick question.
If I collect a metric and have done so for some time, but now decide I want to add an additional label to samples going forward, what would be the intended way to do so? As far as I can tell, the Collector throws an exception if the label count doesn't match, but that practically never happens as the labels aren't loaded when a new process tries to update a sample with different labels, leading to undefined behavior.
With
main1.php
(bootstrapping excluded for brevity):and
main2.php
:it renders as follows:
Imo, I should be able to add new dimensions to my samples as my application grows.