Regexp in complex query¶
Currently some instance or network related service have extra identifier in resource_id. Example is disk.device.* metrics. They have resource_id with format - <instance_id>-<disk-id>. We can’t make query for getting all samples from these meters with specified instance_id because disks have different ids. This behavior not easy for end users and adds troubles for someone who wants know more information about cluster work.
To support complex queries described above we should add new regex operator with corresponding “=~” designation.
Implementation depends on backend:
1) MongoDB and DB2. These dbs has $regex query support. It provides regular expression capabilities for pattern matching strings in queries. MongoDB and DB2 use Perl compatible regular expressions (i.e. “PCRE” ) version 8.30 with UTF-8 support. For correct work we map “=~” from filter query to “$regex” in pymongo request.
SQLAlchemy. This backend supports “regexp” MySQL operator, also it’s mapped
HBase supports regexp queries with RegexStringComparator.
Add extra information to resource metadata
Data model impact¶
REST API impact¶
Add new simple operator “=~” in complex queries.
Other end user impact¶
You may make regex request in complex query.
Will affect performance for large regular expressions, api service may be affected.
Other deployer impact¶
- Primary assignee:
- Ongoing maintainer:
add “=~” to simple operators list in controller
add regexp operator processing to backends
extend storage scenarios testing to include regexp operator
update complex query notes to include new operator