mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-06 08:09:24 +00:00
### **PR Type** Enhancement, Tests ___ ### **Description** - Introduce alert deduplication feature - Persist dedup state and migration - API/UI support for dedup config - Scheduled cleanup job added ___ ### Diagram Walkthrough ```mermaid flowchart LR Config["Config: DeduplicationConfig + grouping"] -- "exposed in Alert" --> API["HTTP Models: Alert.deduplication"] API -- "persist/read" --> Infra["Infra: alerts table cols + dedup_state table"] Infra -- "migration + entity" --> DB["DB Schema v11"] Scheduler["Scheduler handlers"] -- "apply_deduplication()" --> Service["Service: alerts/deduplication"] Service -- "fingerprint + state" --> Infra Job["Background job"] -- "cleanup_expired_state" --> Service UI["Web UI: form + i18n"] -- "bind Alert.deduplication" --> API ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Configuration changes</strong></td><td><details><summary>3 files</summary><table> <tr> <td><strong>config.rs</strong><dd><code>Bump DB schema version to 11</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-9aeee4a74c0520daa40f9b81c7016f5b6b3254375b968dd7598e745630980d62">+1/-1</a> </td> </tr> <tr> <td><strong>mod.rs</strong><dd><code>Wire enterprise-only dedup migration</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-7ee42a714d3d56c663da0412d15514613222055aebb5b50dafbc051a656a36f6">+7/-0</a> </td> </tr> <tr> <td><strong>mod.rs</strong><dd><code>Gate deduplication module behind enterprise feature</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-ba9b65130898444f7815fd6068bdb0dc590612f74cc893f79d91b0afc44cc851">+2/-0</a> </td> </tr> </table></details></td></tr><tr><td><strong>Enhancement</strong></td><td><details><summary>15 files</summary><table> <tr> <td><strong>alert.rs</strong><dd><code>Add optional deduplication to Alert model</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-45c7eaf1a764ab52f3e014fe0555c03dc59d77c5ce974684cdee4ed90463a234">+4/-1</a> </td> </tr> <tr> <td><strong>mod.rs</strong><dd><code>Export deduplication module</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-308ddd8764236c9a75da9ba7742843ee096f34a126306a58a1e695c1ee148fe5">+1/-0</a> </td> </tr> <tr> <td><strong>mod.rs</strong><dd><code>Expose deduplication in HTTP Alert model mappings</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-7937de550cb8784a6c3beca0689c8a88508c4b93ecf441280f47e08f988d2a5a">+7/-1</a> </td> </tr> <tr> <td><strong>mod.rs</strong><dd><code>Map dedup fields to DB and serialize config</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-238b8087501b1743c3c4608469596d431869f021e9bb30e9a058d1294229ee67">+29/-0</a> </td> </tr> <tr> <td><strong>alert_dedup_state.rs</strong><dd><code>New entity for deduplication state</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-f6ea59e731cb65769f76f5e3a092331e433d73cfb55589861c7cd4fc415744dc">+85/-0</a> </td> </tr> <tr> <td><strong>alerts.rs</strong><dd><code>Add dedup columns to alerts entity</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-a3e9c7993f95c9f2414e5da12d12f5f60422ac927c105f32141e4854f0e7179a">+3/-0</a> </td> </tr> <tr> <td><strong>mod.rs</strong><dd><code>Register alert_dedup_state entity</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-c539d7557d1425986d5c09849d8dbca42d1b309c2bc33d49db641d6a783098f6">+1/-0</a> </td> </tr> <tr> <td><strong>m20251024_000001_add_alert_deduplication.rs</strong><dd><code>Migration: add dedup columns and state table</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-5146fa66b9b2805cd19d8a0fe363976a5966d70132400e54e576f277c23c8d34">+245/-0</a> </td> </tr> <tr> <td><strong>alert_manager.rs</strong><dd><code>Add scheduled dedup state cleanup job</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-7e30858abad652a860186eb047347305488f52356112b1495dd53ce740316d7c">+55/-0</a> </td> </tr> <tr> <td><strong>deduplication.rs</strong><dd><code>Implement dedup logic, fingerprinting, cleanup</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-6073bba67ae904acb5f5b73104f84a81c13608f31aeb6558e9787da67efa03df">+975/-0</a> </td> </tr> <tr> <td><strong>handlers.rs</strong><dd><code>Apply deduplication before sending alerts</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-5eca8995a88fcecb6d6b8efd3c7c4496f4a96a4b060fb4ed85593574f7cf49eb">+49/-0</a> </td> </tr> <tr> <td><strong>alert.ts</strong><dd><code>Add deduplication to Alert interface</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-95f520d803aecbe4142e486037faf07124a5da245d504f0d11147bcb6a4c8918">+11/-0</a> </td> </tr> <tr> <td><strong>AlertsContainer.vue</strong><dd><code>UX: expand/collapse area clickable with hover</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-39b487d54970cff4a1ccdfbb49a4ccb38f7131bb9d30944ce1c6e86d3f818148">+12/-5</a> </td> </tr> <tr> <td><strong>DeduplicationConfig.vue</strong><dd><code>New UI for configuring alert deduplication</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-63eb39111409780e4dc064ea80056dfe096038ee76b389cdd8e9d14c0ae29a32">+401/-0</a> </td> </tr> <tr> <td><strong>ScheduledAlert.vue</strong><dd><code>Integrate dedup config into scheduled alerts (enterprise)</code></dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-5e143a17ab0fa5d7817f6d9301667fb5597236f27184248c7a71728e85b8d999">+13/-3</a> </td> </tr> </table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>deduplication.rs</strong><dd><code>New deduplication and grouping config with tests</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-ee8d9d671130757ae84ef01809003701d36e4cc90a1d1eca286d3af9a6def2ea">+183/-0</a> </td> </tr> </table></details></td></tr><tr><td><strong>Documentation</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>en.json</strong><dd><code>i18n strings for deduplication UI</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8884/files#diff-892aa3d75ab6e129ef9116aa21bec1b9a15ba69ce5366d2a19128078c690d824">+23/-1</a> </td> </tr> </table></details></td></tr></tr></tbody></table> </details> ___ --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>