Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Prometheus
Convertion from statsd to prometheus breaks when we have clusters with dots.
Example:
statsd:
prometheus
There were several ways to fix it.
._.
suffix to clusters so you can skip extra part on Statsd and then build proper regex for Prometheus..
in cluster name with_
.We picked second solution since it's less error prone. So the metric with this fix looks like following:
statsd:
prometheus
StatsD
We also have to sanitize metrics for StatsD as
:
and|
chars are illegal.Official func to sanitize metrics looks like this https://github.com/statsd/statsd/blob/master/stats.js#L167
I slightly modified it changing the illegal characters always to
_
.Example files
fix_configdump.txt
fix_prometheus.txt
fix_statsd.txt
For the cluster name. Instead of changing the name in every place I leveraged
alt_stat_name
field. I think this is less error prone since we reference cluster names in many places in the config.