mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
- `is_ui_histogram` query param for search api, the backend will convert the sql to histogram query and respond accordingly - `search_type` for search partition query, and if search type is `ui` only then we generate partitions with mini partition that is aligned with histogram interval ### **PR Type** Enhancement, Bug fix, Tests, Documentation ___ ### **Description** - Add UI histogram query conversion and flag - Align partitions to histogram with mini - Stream empty metadata+hints consistently - Expose histogram eligibility and interval ___ ### Diagram Walkthrough ```mermaid flowchart LR FE["Web UI logs & services"] -- "is_ui_histogram, searchType" --> HTTP["HTTP search endpoints"] HTTP -- "convert to histogram SQL\n(resolve streams, eligibility)" --> SQL["Histogram SQL converter"] HTTP -- "pass search_type, flags" --> SVC["Search service"] SVC -- "is_eligible, gen interval" --> PART["PartitionGenerator"] PART -- "aligned partitions\n(+mini optional)" --> STREAM["Streaming execution"] STREAM -- "SearchResponse + metadata\n(empty hits emitted)" --> FE SVC -- "Response: histogram_interval, is_histogram_eligible, converted_query" --> FE ``` <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><details><summary>16 files</summary><table> <tr> <td><strong>partition.rs</strong><dd><code>Histogram-aligned partitions with optional mini support</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-348fa23375d0cea3e5fb039cc6b381d79aa1d5121e6b9792acc048d3fd02e37c">+798/-269</a></td> </tr> <tr> <td><strong>execution.rs</strong><dd><code>Always emit responses; accumulate and metadata tweaks</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-75d432351865224f0b00d7cc819554c2ad5fa1f777e9c645d91a3fd5c1113bc0">+148/-152</a></td> </tr> <tr> <td><strong>search_stream.rs</strong><dd><code>HTTP2 stream: UI histogram conversion and interval handling</code></dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-642de43ff6b19ae41087a9f1efc02d8b0b873809e0c92cbddfac1a30ef3f1184">+149/-69</a></td> </tr> <tr> <td><strong>mod.rs</strong><dd><code>Partition API: histogram eligibility, interval, UI paths</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-c3b85ea662a885fbd39797968928b291cb59a58f53a03f7b7dfd7ba8b6a7985a">+71/-5</a> </td> </tr> <tr> <td><strong>histogram.rs</strong><dd><code>Convert original SQL to histogram-safe query</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-a5fc4cd11b3ec569b4cedf278ef0b14f540504abfbb23e29eb896d5b2a6cc2b2">+140/-0</a> </td> </tr> <tr> <td><strong>mod.rs</strong><dd><code>HTTP search: UI histogram conversion and response enrichment</code></dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-96630a0dbb6dd7b2b0248fa325c7c7041ce31340c32826675a4a70772e9d29f6">+38/-3</a> </td> </tr> <tr> <td><strong>search.rs</strong><dd><code>Response/request fields for histogram meta and streaming chunks</code></dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-373e83a31e5bbc82fba05d7ae274b0dbd624ed748272232cf7eb8b8c3b2f3afc">+45/-0</a> </td> </tr> <tr> <td><strong>mod.rs</strong><dd><code>New error: SearchHistogramNotAvailable</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-90c725d0e77a6e7d4bcc130cf5783848a5cf0efdb304b351cd63cacf8775fc36">+7/-0</a> </td> </tr> <tr> <td><strong>multi_streams.rs</strong><dd><code>Multi-stream partition search accepts search_type</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-c3233cdf1e68cb2455f91457719b9c2f477e735ee16546fdfe111e76768bd054">+16/-4</a> </td> </tr> <tr> <td><strong>sql.rs</strong><dd><code>Detect histogram-eligible queries and subqueries</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-a0a09c66a20d878ec7683ae222c919fbe092b8001871ade7f455b89573ce0911">+27/-0</a> </td> </tr> <tr> <td><strong>http.rs</strong><dd><code>Add query flag parser for is_ui_histogram</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-3b50a69c1ec2f63f8eebb5f9880e17826463a586768aed3e3e15242833609d6b">+8/-0</a> </td> </tr> <tr> <td><strong>Index.vue</strong><dd><code>UI: histogram streaming flow, timeouts cleanup</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-0323c3da69b369843c5d72bf4df5b00ca6b5147192a213baf331659ecf92af62">+45/-12</a> </td> </tr> <tr> <td><strong>IndexList.vue</strong><dd><code>Pass searchType=ui to partition API</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-08f058f883b659e713e606991a7ea37ae1ff016b7cccef970489ab5840dc3d09">+1/-0</a> </td> </tr> <tr> <td><strong>search.ts</strong><dd><code>API: support is_ui_histogram, searchType plumbed</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-885ab872dbc6e7b20264df815e3ef4727f0abc86ce90d2fb47e4aff572814c75">+7/-2</a> </td> </tr> <tr> <td><strong>useStreamingSearch.ts</strong><dd><code>Include is_ui_histogram in streaming URL</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-8fce3e25a161cd458e734bd9b1f98aadefe3482da7b6529a5b1f4fa20ec115e2">+1/-0</a> </td> </tr> <tr> <td><strong>usePanelDataLoader.ts</strong><dd><code>Dashboard partition calls pass searchType</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-5a42e9493a7bcd722b88e61fd38883c4f61001bc9cafa399f65f8eafda3aace9">+2/-0</a> </td> </tr> </table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>3 files</summary><table> <tr> <td><strong>cacher.rs</strong><dd><code>Adjust tests for new response fields</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-8c387b22b2c0a282600ee41ca702b3db60f5a284d507c0feb7418608ff062c6c">+6/-0</a> </td> </tr> <tr> <td><strong>SearchResult.spec.ts</strong><dd><code>Skip flaky resetPlotChart unit test</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-8ff7d14fc3cdac80eeec5550ecd89a77f015b4ebe928da9d4a76a9585d64d788">+1/-1</a> </td> </tr> <tr> <td><strong>useLogs.spec.ts</strong><dd><code>Skip failing query partitions test</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-842307ae8db03aa51891ddde98cfdbbabc712db1e1614c9eee99a59add395f70">+1/-1</a> </td> </tr> </table></details></td></tr><tr><td><strong>Error handling</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>error_utils.rs</strong><dd><code>Map histogram unavailability to 400 with code</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-d4de63bc9275a19c868f6967de0f7835bd2d7bda74ff55ce97b8fb3f9af54da9">+3/-0</a> </td> </tr> </table></details></td></tr><tr><td><strong>Miscellaneous</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>mod.rs</strong><dd><code>Export histogram SQL module</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-dc0ab53d0ff551cf3cd12027c73d0da5e66680c0bf2d1830778639a33bac3464">+1/-0</a> </td> </tr> </table></details></td></tr><tr><td><strong>Bug fix</strong></td><td><details><summary>2 files</summary><table> <tr> <td><strong>SearchResult.vue</strong><dd><code>UI: robust empty-histogram handling and reset watcher</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-5e65533aa4754bb6d0074fda18ffc1ecacded3b9ca6bc28a161c3f6b12f20195">+17/-15</a> </td> </tr> <tr> <td><strong>SearchBar.vue</strong><dd><code>Cancel running query before applying saved view</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-81893de4edf186b0556f610acb280c87baa2ffe67d3b48a60a866094c7635baf">+2/-1</a> </td> </tr> </table></details></td></tr><tr><td><strong>Documentation</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>query.ts</strong><dd><code>Types: histogram interval and eligibility fields</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-12dd5b3bb9741bbeaa348c0efbbd745d0a582899678738159c6927d34a35191d">+2/-0</a> </td> </tr> </table></details></td></tr><tr><td><strong>Additional files</strong></td><td><details><summary>2 files</summary><table> <tr> <td><strong>fga.rs</strong></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-e7c99f37f3abbb5e0507d2760bbf67df010d9218704b38dce84c5477acecd22e">+0/-2</a> </td> </tr> <tr> <td><strong>useLogs.ts</strong></td> <td><a href="https://github.com/openobserve/openobserve/pull/7909/files#diff-1040f61354f92711e0e77ed4e9bfa15586d45a94c7e2ab06cc37372068030e7b">+154/-168</a></td> </tr> </table></details></td></tr></tr></tbody></table> </details> ___ --------- Co-authored-by: sai nikhil kethe <nikhil@openobserve.ai>