This series adds an option to read the relabel config from file.
Most of Scylla's metrics are reported per-shard, some times they are also reported per scheduling
groups or per tables. With modern hardware, this can quickly grow to a large number of metrics that
overload Scylla and the collecting server.
One of the main issues around metrics reduction is that many of the metrics are only
helpful in certain situations.
For example, Scylla monitoring only looks at a subset of the metrics. So in large deployments
it would be helpful to scrap only those.
An option to do that, would be to mark all dashboards related metrics with a label value, and then Prometheus
will request only metrics with that label value.
There are two main limitations to scrap by label values:
1. some of the metrics we want to report are in seastar, so we'll need to label them somehow (we cannot just add random labels to seastar metrics)
2. things change, new metrics are introduce and we may want them, it's not practicall to re-compile and wait
for a new release whenever we want to change a label just for monitoring.
It will be best to have the option to add metrics freely and choose at runtime what to report.
This series make use of Seastar API to perform metrics manipulation dynamically. It includes adding, removing, and changing labels and also enable and disable metrics, and enable and disable the skip_when_empty option.
After this series the configuration could be used with:
```--relabel-config-file conf.yaml```
The general logic and format follows Prometheus metrics_relabel_config configuration.
Where the configuration file looks like:
```
$ cat conf.yaml
relabel_configs:
- source_labels: [shard]
action: drop
target_label: shard
regex: (2)
- source_labels: [shard]
action: replace
target_label: level
replacement: $1
regex: (.*3)
```
Closes#12687
* github.com:scylladb/scylladb:
main: Load metrics relabel config from a file if it exists
Add relabel from file support.