mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
### **PR Type**
Enhancement
___
### **Description**
- Add `query-optimiser` subcommand with required flags
- Dispatch to `query_optimiser` handler in CLI
- Introduce `query_optimiser` module with enterprise logic
- Fallback stub when enterprise feature disabled
___
### Diagram Walkthrough
```mermaid
flowchart LR
CLIApp["CLI Application"] --> Dispatch["Subcommand Dispatch"]
Dispatch -- "query-optimiser" --> QueryOpt["query_optimiser Module"]
QueryOpt -- "feature enterprise" --> GetRec["get_recommendations API"]
QueryOpt -- "no enterprise" --> Fallback["Unsupported Handler"]
```
<details> <summary><h3> File Walkthrough</h3></summary>
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>cli.rs</strong><dd><code>Add query-optimiser command
handling</code>
</dd></summary>
<hr>
src/cli/basic/cli.rs
<ul><li>Added <code>query-optimiser</code> command definition<br> <li>
Defined arguments: url, token, duration, etc.<br> <li> Implemented match
branch for dispatch</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7748/files#diff-cb1eb3e74723d891353ccf1e2e5e0d246d2e78a5e69dbe4c73006ea8412d65e0">+70/-0</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>query_optimiser.rs</strong><dd><code>Implement
query_optimiser functionality</code>
</dd></summary>
<hr>
src/cli/basic/query_optimiser.rs
<ul><li>Created <code>query_optimiser</code> module file<br> <li>
Enterprise feature calls <code>get_recommendations</code><br> <li>
Fallback prints unsupported message</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7748/files#diff-69a90f896bb4c373e3f710b55453404c9cfd1d4b17a8d57a835e2b07de9a85fe">+64/-0</a>
</td>
</tr>
</table></td></tr><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>mod.rs</strong><dd><code>Register query_optimiser
module</code>
</dd></summary>
<hr>
src/cli/basic/mod.rs
- Registered new `query_optimiser` module
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7748/files#diff-8820944bd26c070b4d7d80c21d699937e32f8f8d0f3dad496edf580bd83aa321">+1/-0</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
</details>
___