connect
connect copied to clipboard
Add ability to delete metrics
Preamble
This is still WIP, the functionality is only added for gauge metrics for the time being just to get an initial feel of whether this is a good approach or there is a better way to do this.
Problem statement
Benthos supports setting metrics using the metric processor. Once a metric is set it's only possible to change its value.
Sometimes, and for certain use cases, it is necessary for a metric to be deleted, as in not exported anymore.
This PR aims to add a new configuration(delete_metric) for the metric processor that when it evaluates to true the metric should not be exported anymore.
For the time being, and to re-iterate, this is only specific for prometheus and for gauge just to test the waters. If there's a chance of this being adopted then I will add the functionality to the other metric types (counter, counter_by...)