If an incorrect regex is sent to clickhouse, graphite-clickhouse will return 500: Storage error which is not very informative. This PR adds validation before that can happen to avoid making unnecessary requests to clickhouse and makes graphite-clickhouse return an error that explains the reason why.
For plain metrics: check if all brackets are closed correctly within each node of the path.
Example: a.b.c{d,e}}.f would now return 400: query has unmatched brackets
For tagged metrics: parse regex error from clickhouse.
Example: seriesByTag('name=myMetric', 'tag=*abc*') would now return 400: Incorrect regex syntax
If an incorrect regex is sent to clickhouse, graphite-clickhouse will return
500: Storage error
which is not very informative. This PR adds validation before that can happen to avoid making unnecessary requests to clickhouse and makes graphite-clickhouse return an error that explains the reason why.For plain metrics: check if all brackets are closed correctly within each node of the path. Example:
a.b.c{d,e}}.f
would now return400: query has unmatched brackets
For tagged metrics: parse regex error from clickhouse. Example:
seriesByTag('name=myMetric', 'tag=*abc*')
would now return400: Incorrect regex syntax