Pgq.event_6_0 is taking Too much Space

Hello Team
I noticed a high Disk usage and on running an SQL command, I see that pgq.event_6_0 is taking up a lot of space.
Ran the SQL:

SELECT
    table_schema || '.' || table_name AS "Table",
    pg_size_pretty(total_bytes) AS "Total Size"
FROM (
    SELECT
        table_name,
        table_schema,
        pg_total_relation_size(table_schema || '.' || table_name) AS total_bytes
    FROM
        information_schema.tables
    WHERE
        table_schema NOT IN ('pg_catalog', 'information_schema')
) AS sizes
ORDER BY
    total_bytes DESC;

Result below:

                        Table                        | Total Size 
-----------------------------------------------------+------------
 pgq.event_6_0                                       | 1370 GB
 cdr.cdr_2024_12_23                                  | 7273 MB
 cdr.cdr_2024_12_24                                  | 7174 MB
 cdr.cdr_2024_12_25                                  | 7153 MB
 cdr.cdr_2024_12_26                                  | 7044 MB
 cdr.cdr_2024_12_22                                  | 6796 MB
 cdr.cdr_2024_12_21                                  | 6674 MB
 cdr.cdr_2024_12_20                                  | 6491 MB
 cdr.cdr_2024_12_19                                  | 6219 MB
 cdr.cdr_2024_12_18                                  | 6189 MB
 cdr.cdr_2024_12_16                                  | 6029 MB
 cdr.cdr_2024_12_14                                  | 5956 MB

select * from pgq.event_2_0 Limit 10;
This shows recent records with today’s date on the timestamp. Billing is working normally.

Please what can I do to reduce the space taken?

cdr=# select * from pgq.get_consumer_info();
      queue_name      |    consumer_name     |           lag            |        last_seen         | last_tick | current_batch | next_tick | pending_events 
----------------------+----------------------+--------------------------+--------------------------+-----------+---------------+-----------+----------------
 async_cdr_statistics | async_cdr_statistics | 303 days 17:35:53.620738 | 303 days 17:35:53.620738 |         1 |               |           |      710582273
 cdr_billing          | cdr_billing          | 00:02:14.995396          | 00:00:03.763535          |   7775753 |       7775753 |   7775754 |            107
(2 rows)

looks like yeti-cdr-billing@cdr_stats service is not running.

You are right.

But after restarting, it still shows the activating state after some time

# systemctl status yeti-cdr-billing@cdr_stats.service
● yeti-cdr-billing@cdr_stats.service - YETI CDR billing: cdr_stats
     Loaded: loaded (/lib/systemd/system/yeti-cdr-billing@.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Fri 2024-12-27 19:18:26 WAT; 8s ago
       Docs: https://yeti-switch.org/docs/
    Process: 3820421 ExecStart=/opt/yeti-web/vendor/rbenv/shims/ruby /opt/yeti-web/pgq-processors/vendor/bundler/bin/bundle exec rake pgq:worker processor=cdr_stats>
   Main PID: 3820421 (code=exited, status=1/FAILURE)
        CPU: 1.697s

so you have to find why it not starting properly

Please where can I look for clues?

you have to check logs.

There is just
yeti-web.log and yeti-cdr-billing.log
No logs for the cdr_stats

there are journald and journalctl