Validate metric names againts suggestion format
Background
During research work for new naming convention for database sourced metrics, we've decided to use underlying SQL as source for metric name. In order to help apply new naming convention onto metrics, we've decided that metrics names should be generated automatically.
PoC of metric names generator !54077 (closed)
Goal
Validate that names present in metrics YAML follow name suggestion provided by generator (implemented at #323193 (closed))
Example:
For metric collected via
"SELECT COUNT(\"project_auto_devops\".\"id\") FROM \"project_auto_devops\" WHERE \"project_auto_devops\".\"enabled\" = FALSE"
Metrics name generator should suggest name: count_<adjectives describing>_project_auto_devops
. Text enclosed in <>
serves as prompt to users, to encourage them translate SQL filters "project_auto_devops"."enabled" = FALSE"
into short human friendly description. We need to add automation that check if users took and action on prompt, and whats more if other parts of the name remained unchanged. In suggested scenario regular expression /count_([a-z]+_)*project_auto_devops/
should be sufficient. As a result of this issue, metric YAMLs should be validated with autogenerated regexes, like the one from example above.