[ZBXNEXT-8520] turn auditlog table into hypertable Created: 2023 Jun 21  Updated: 2024 Jun 27  Resolved: 2023 Aug 14

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Server (S)
Affects Version/s: 7.0.0alpha2
Fix Version/s: 7.0.0alpha4, 7.0 (plan)

Type: Change Request Priority: Trivial
Reporter: Artjoms Rimdjonoks Assignee: Armands Arseniuss Skolmeisters
Resolution: Fixed Votes: 3
Labels: TimescaleDB
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Causes
causes ZBX-23930 invalid partitioning function cuid_ti... Closed
causes ZBX-24643 Auditlog table compression Closed
causes ZBX-24601 Misleading Zabbix server log warning ... Closed
Epic Link: Zabbix 7.0
Team: Team C
Sprint: Sprint 102 (Jul 2023), Sprint 103 (Aug 2023)
Story Points: 2

 Description   

1) this can take considerable amount of space.

         table_name         | pg_size_pretty | pg_relation_size
----------------------------+----------------+------------------
 auditlog                   | 635 GB         |     681780338688
 item_discovery             | 26 GB          |      28250169344

2) it has clock column
3) its historic records do not get modified
4) this should be easy to do, for new installations our timescalesdb script could be modified like:

PERFORM create_hypertable('auditlog', 'clock', chunk_time_interval => 86400, migrate_data => true)

and for the existing installations, separate upgrade patch could be provided in a file that users could run manually



 Comments   
Comment by Aigars Kadikis [ 2023 Jun 21 ]

Maybe we can extend the hyper tables to be customizable per data type. A separate period per all 7 data tables.
The biggest use case is log file monitoring when we can collect the raw log (let's say hardware is not an issue) file only ONCE. In this setup, we can have more than one trigger which detects the patterns on-the-fly. In this setup we would like to keep "history_log" for a smaller period.

Comment by Oleksii Zagorskyi [ 2023 Jun 22 ]

What is zabbix version there?
Keep in mind please ZBX-21145

Comment by Armands Arseniuss Skolmeisters [ 2023 Jul 24 ]

Implemented in development branch feature/ZBXNEXT-8520-6.5.

Comment by Martins Valkovskis [ 2023 Aug 08 ]

Updated documentation:

Generated at Wed Mar 26 06:24:31 EET 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.