From 9cafa8991c0ce8b913f48d3f155d3dd7b9c544db Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Fri, 13 Dec 2024 18:48:11 +0400 Subject: [PATCH] cicd: fixed failing pipelines - workaround possible /sys/fs/cgroup issue - add test mertric files for Postgres 16 and 17 - install pg_buffercache extension in test DB - fix system.uptime expected metric name --- github-actions-tests/mamonsu_build.sh | 7 +- github-actions-tests/metrics.sh | 4 +- .../sources/metrics-linux-10.txt | 2 +- .../sources/metrics-linux-11.txt | 2 +- .../sources/metrics-linux-12.txt | 2 +- .../sources/metrics-linux-13.txt | 2 +- .../sources/metrics-linux-14.txt | 2 +- .../sources/metrics-linux-16.txt | 130 ++++++++++++++++++ .../sources/metrics-linux-17.txt | 116 ++++++++++++++++ .../sources/metrics-linux-9.6.txt | 2 +- .../sources/metrics-linux-full-list.txt | 2 +- 11 files changed, 260 insertions(+), 11 deletions(-) create mode 100644 github-actions-tests/sources/metrics-linux-16.txt create mode 100644 github-actions-tests/sources/metrics-linux-17.txt diff --git a/github-actions-tests/mamonsu_build.sh b/github-actions-tests/mamonsu_build.sh index 137e0729..6fbb92db 100644 --- a/github-actions-tests/mamonsu_build.sh +++ b/github-actions-tests/mamonsu_build.sh @@ -42,8 +42,9 @@ if [ "${OS%:*}" = "centos" ]; then make rpm sudo rpm -i ./mamonsu*.rpm cat /mamonsu/github-actions-tests/sources/agent_3.5.9.conf > /etc/mamonsu/agent.conf - systemctl daemon-reload - systemctl restart mamonsu + # ensuring mamonsu can actually start + sudo su -s /bin/bash -c "mamonsu bootstrap -x --user postgres -d mamonsu_test_db" mamonsu + /etc/init.d/mamonsu restart sleep 5 echo && echo && echo "mamonsu version:" mamonsu --version @@ -65,6 +66,8 @@ elif [ "${OS%:*}" = "ubuntu" ]; then make deb sudo dpkg -i ./mamonsu*.deb cat /mamonsu/github-actions-tests/sources/agent_3.5.9.conf > /etc/mamonsu/agent.conf + # ensuring mamonsu can actually start + sudo su -s /bin/bash -c "mamonsu bootstrap -x --user postgres -d mamonsu_test_db" mamonsu service mamonsu restart sleep 5 echo && echo && echo "mamonsu version:" diff --git a/github-actions-tests/metrics.sh b/github-actions-tests/metrics.sh index a4ebf630..5ea66946 100644 --- a/github-actions-tests/metrics.sh +++ b/github-actions-tests/metrics.sh @@ -60,12 +60,12 @@ END sleep 120 # read metric for specific version -while read metric; do +for metric in $(cat ${METRICS_FILE}); do GREP=$( mamonsu agent metric-get ${metric} | grep "pgsql\|sys\|mamonsu" ) if [ -z "$GREP" ]; then echo "---> ERROR: Cannot found metric $metric" exit 11 fi -done <"${METRICS_FILE}" +done echo && echo diff --git a/github-actions-tests/sources/metrics-linux-10.txt b/github-actions-tests/sources/metrics-linux-10.txt index f62a60f4..c2d044c5 100644 --- a/github-actions-tests/sources/metrics-linux-10.txt +++ b/github-actions-tests/sources/metrics-linux-10.txt @@ -120,4 +120,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-11.txt b/github-actions-tests/sources/metrics-linux-11.txt index f62a60f4..c2d044c5 100644 --- a/github-actions-tests/sources/metrics-linux-11.txt +++ b/github-actions-tests/sources/metrics-linux-11.txt @@ -120,4 +120,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-12.txt b/github-actions-tests/sources/metrics-linux-12.txt index 94ffe7eb..1c097974 100644 --- a/github-actions-tests/sources/metrics-linux-12.txt +++ b/github-actions-tests/sources/metrics-linux-12.txt @@ -121,4 +121,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-13.txt b/github-actions-tests/sources/metrics-linux-13.txt index c847ac5c..b6a0d1c1 100644 --- a/github-actions-tests/sources/metrics-linux-13.txt +++ b/github-actions-tests/sources/metrics-linux-13.txt @@ -125,4 +125,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-14.txt b/github-actions-tests/sources/metrics-linux-14.txt index fcc168bd..71f26843 100644 --- a/github-actions-tests/sources/metrics-linux-14.txt +++ b/github-actions-tests/sources/metrics-linux-14.txt @@ -132,4 +132,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-16.txt b/github-actions-tests/sources/metrics-linux-16.txt new file mode 100644 index 00000000..cfe646d0 --- /dev/null +++ b/github-actions-tests/sources/metrics-linux-16.txt @@ -0,0 +1,130 @@ +mamonsu.memory.rss[max] +mamonsu.plugin.errors[] +mamonsu.plugin.keepalive[] +pgsql.archive_command[archived_files] +pgsql.archive_command[count_files_to_archive] +pgsql.archive_command[failed_trying_to_archive] +pgsql.archive_command[size_files_to_archive] +pgsql.autovacuum.count[] +pgsql.autovacuum.utilization[] +pgsql.bgwriter[buffers_alloc] +pgsql.bgwriter[buffers_backend] +pgsql.bgwriter[buffers_backend_fsync] +pgsql.bgwriter[buffers_checkpoint] +pgsql.bgwriter[buffers_clean] +pgsql.bgwriter[maxwritten_clean] +pgsql.blocks[hit] +pgsql.blocks[read] +pgsql.checkpoint[checkpoint_sync_time] +pgsql.checkpoint[count_timed] +pgsql.checkpoint[count_wal] +pgsql.checkpoint[write_time] +pgsql.connections[active] +pgsql.connections[disabled] +pgsql.connections[fastpath_function_call] +pgsql.connections[idle] +pgsql.connections[idle_in_transaction] +pgsql.connections[idle_in_transaction_aborted] +pgsql.connections[max_connections] +pgsql.connections[other] +pgsql.connections[total] +pgsql.connections[waiting] +pgsql.database.discovery[] +pgsql.database.bloating_tables[mamonsu_test_db] +pgsql.database.bloating_tables[postgres] +pgsql.database.invalid_indexes[mamonsu_test_db] +pgsql.database.invalid_indexes[postgres] +pgsql.database.max_age[mamonsu_test_db] +pgsql.database.max_age[postgres] +pgsql.database.size[mamonsu_test_db] +pgsql.database.size[postgres] +pgsql.events[checksum_failures] +pgsql.events[conflicts] +pgsql.events[deadlocks] +pgsql.events[xact_rollback] +pgsql.oldest[transaction_time] +pgsql.oldest[xid_age] +pgsql.ping[] +pgsql.pg_locks[accessexclusive] +pgsql.pg_locks[accessshare] +pgsql.pg_locks[exclusive] +pgsql.pg_locks[rowexclusive] +pgsql.pg_locks[rowshare] +pgsql.pg_locks[share] +pgsql.pg_locks[sharerowexclusive] +pgsql.pg_locks[shareupdateexclusive] +pgsql.parallel[queries] +pgsql.prepared.count +pgsql.prepared.oldest +pgsql.relation.size[] +pgsql.relation.size[mamonsu_test_db.mamonsu.config] +pgsql.relation.size[postgres.pg_catalog.pg_class] +pgsql.replication.non_active_slots[] +pgsql.replication_lag[sec] +pgsql.replication_lag[sec] +pgsql.stat[dirty_bytes] +pgsql.stat[other_time] +pgsql.stat[read_bytes] +pgsql.stat[read_time] +pgsql.stat[wal_bytes] +pgsql.stat[wal_fpi] +pgsql.stat[wal_records] +pgsql.stat[write_bytes] +pgsql.stat[write_time] +pgsql.stat_info[dealloc] +pgsql.stat_info[stats_reset] +pgsql.temp[bytes] +pgsql.temp[files] +pgsql.transactions[committed] +pgsql.tuples[deleted] +pgsql.tuples[fetched] +pgsql.tuples[inserted] +pgsql.tuples[returned] +pgsql.tuples[updated] +pgsql.uptime[] +pgsql.wal.buffers_full[] +pgsql.wal.count[] +pgsql.wal.fpi.count[] +pgsql.wal.records.count[] +pgsql.wal.sync_time[] +pgsql.wal.write[] +pgsql.wal.write_time[] +system.cpu[idle] +system.cpu[iowait] +system.cpu[irq] +system.cpu[nice] +system.cpu[softirq] +system.cpu[system] +system.cpu[user] +system.disk.discovery[] +system.disk.all_read[] +system.disk.all_write[] +system.disk.all_read_b[] +system.disk.all_write_b[] +system.la[1] +system.memory[active] +system.memory[available] +system.memory[buffers] +system.memory[cached] +system.memory[committed] +system.memory[inactive] +system.memory[mapped] +system.memory[page_tables] +system.memory[slab] +system.memory[swap] +system.memory[swap_cache] +system.memory[total] +system.memory[vmalloc_used] +system.memory[unused] +system.memory[used] +system.net.discovery[] +system.open_files[] +system.processes[blocked] +system.processes[forkrate] +system.processes[running] +system.vfs.discovery[] +system.vfs.free[/] +system.vfs.percent_free[/] +system.vfs.percent_inode_free[/] +system.vfs.used[/] +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-17.txt b/github-actions-tests/sources/metrics-linux-17.txt new file mode 100644 index 00000000..1959c69b --- /dev/null +++ b/github-actions-tests/sources/metrics-linux-17.txt @@ -0,0 +1,116 @@ +mamonsu.memory.rss[max] +mamonsu.plugin.errors[] +mamonsu.plugin.keepalive[] +pgsql.archive_command[archived_files] +pgsql.archive_command[count_files_to_archive] +pgsql.archive_command[failed_trying_to_archive] +pgsql.archive_command[size_files_to_archive] +pgsql.autovacuum.count[] +pgsql.autovacuum.utilization[] +pgsql.bgwriter[buffers_alloc] +pgsql.bgwriter[buffers_clean] +pgsql.bgwriter[maxwritten_clean] +pgsql.blocks[hit] +pgsql.blocks[read] +pgsql.checkpoint[checkpoint_sync_time] +pgsql.checkpoint[count_timed] +pgsql.checkpoint[count_wal] +pgsql.checkpoint[write_time] +pgsql.connections[active] +pgsql.connections[disabled] +pgsql.connections[fastpath_function_call] +pgsql.connections[idle] +pgsql.connections[idle_in_transaction] +pgsql.connections[idle_in_transaction_aborted] +pgsql.connections[max_connections] +pgsql.connections[other] +pgsql.connections[total] +pgsql.connections[waiting] +pgsql.database.discovery[] +pgsql.database.bloating_tables[mamonsu_test_db] +pgsql.database.bloating_tables[postgres] +pgsql.database.invalid_indexes[mamonsu_test_db] +pgsql.database.invalid_indexes[postgres] +pgsql.database.max_age[mamonsu_test_db] +pgsql.database.max_age[postgres] +pgsql.database.size[mamonsu_test_db] +pgsql.database.size[postgres] +pgsql.events[checksum_failures] +pgsql.events[conflicts] +pgsql.events[deadlocks] +pgsql.events[xact_rollback] +pgsql.oldest[transaction_time] +pgsql.oldest[xid_age] +pgsql.ping[] +pgsql.pg_locks[accessexclusive] +pgsql.pg_locks[accessshare] +pgsql.pg_locks[exclusive] +pgsql.pg_locks[rowexclusive] +pgsql.pg_locks[rowshare] +pgsql.pg_locks[share] +pgsql.pg_locks[sharerowexclusive] +pgsql.pg_locks[shareupdateexclusive] +pgsql.parallel[queries] +pgsql.prepared.count +pgsql.prepared.oldest +pgsql.relation.size[] +pgsql.relation.size[mamonsu_test_db.mamonsu.config] +pgsql.relation.size[postgres.pg_catalog.pg_class] +pgsql.replication.non_active_slots[] +pgsql.replication_lag[sec] +pgsql.replication_lag[sec] +pgsql.temp[bytes] +pgsql.temp[files] +pgsql.transactions[committed] +pgsql.tuples[deleted] +pgsql.tuples[fetched] +pgsql.tuples[inserted] +pgsql.tuples[returned] +pgsql.tuples[updated] +pgsql.uptime[] +pgsql.wal.buffers_full[] +pgsql.wal.count[] +pgsql.wal.fpi.count[] +pgsql.wal.records.count[] +pgsql.wal.sync_time[] +pgsql.wal.write[] +pgsql.wal.write_time[] +system.cpu[idle] +system.cpu[iowait] +system.cpu[irq] +system.cpu[nice] +system.cpu[softirq] +system.cpu[system] +system.cpu[user] +system.disk.discovery[] +system.disk.all_read[] +system.disk.all_write[] +system.disk.all_read_b[] +system.disk.all_write_b[] +system.la[1] +system.memory[active] +system.memory[available] +system.memory[buffers] +system.memory[cached] +system.memory[committed] +system.memory[inactive] +system.memory[mapped] +system.memory[page_tables] +system.memory[slab] +system.memory[swap] +system.memory[swap_cache] +system.memory[total] +system.memory[vmalloc_used] +system.memory[unused] +system.memory[used] +system.net.discovery[] +system.open_files[] +system.processes[blocked] +system.processes[forkrate] +system.processes[running] +system.vfs.discovery[] +system.vfs.free[/] +system.vfs.percent_free[/] +system.vfs.percent_inode_free[/] +system.vfs.used[/] +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-9.6.txt b/github-actions-tests/sources/metrics-linux-9.6.txt index 3e3b990b..1623ddc2 100644 --- a/github-actions-tests/sources/metrics-linux-9.6.txt +++ b/github-actions-tests/sources/metrics-linux-9.6.txt @@ -119,4 +119,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-full-list.txt b/github-actions-tests/sources/metrics-linux-full-list.txt index a658c9a8..798ad2fc 100644 --- a/github-actions-tests/sources/metrics-linux-full-list.txt +++ b/github-actions-tests/sources/metrics-linux-full-list.txt @@ -133,4 +133,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[]