Proposal: SELECT any FROM ... WHERE ...
Created by: szarsti
This is a proposal to add 'any' keyword as a selector. It will mean that selector would pick all metrics that have tag data matching WHERE clauses.
We can replace 'any' with 'all', or SQL like '*' if you think that would be reasonable.
I think we can easily implement with current indexer database schema.
Please note that it is slightly different to #71 (closed). This dose not involve metric path wild-card expansion. It just allows for flexible metric selection driven by WHERE clause.
I think it can be very useful for many people that are getting metrics from various collectors where they have limited control how individual metrics are called. It would be also very useful mechanism to help people transit from path based selectors to meta-data based selectors. I imagine that when people start using meta-data they will decorate metrics first with extra data, without changing paths. In this intermediate stage being able to query by tags across many metrics would be very beneficial.
Also it could be a way to build a workaround for #71 (closed). In that case we could provide backward compatibility by mapping wild-card queries, for example:
SELECT base.cpu.*.iowait FROM x
, to someting like this:
SELECT any FROM x WHERE ddb:name_1 = base AND ddb:name_2 = cpu AND ddb:name_4 = iowait
If you accept this proposal, I am very happy to prepare pull-request implementing it.