Skip to content

Commit

Permalink
feat: introduce logging_node_agent_buffer_size_bytes that tracks file…
Browse files Browse the repository at this point in the history
… count

Signed-off-by: Zadkiel Aharonian <[email protected]>
  • Loading branch information
aslafy-z committed Aug 3, 2023
1 parent 5867733 commit 149a9f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions buffer-size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@ while true; do
du -sb ${BUFFER_PATH} | sed -ne 's/\\/\\\\/;s/"/\\"/g;s/^\([0-9]\+\)\t\(.*\)$/logging_node_agent_buffer_size_bytes{entity="\2", host="'$(hostname)'"} \1/p' >> /prometheus/node_exporter/textfile_collector/logging_node_agent_buffer_size_bytes.prom.$$
mv /prometheus/node_exporter/textfile_collector/logging_node_agent_buffer_size_bytes.prom.$$ /prometheus/node_exporter/textfile_collector/logging_node_agent_buffer_size_bytes.prom

echo "# HELP logging_node_agent_buffer_files File count" > /prometheus/node_exporter/textfile_collector/logging_node_agent_buffer_files.prom
echo "# TYPE logging_node_agent_buffer_files gauge" >> /prometheus/node_exporter/textfile_collector/logging_node_agent_buffer_files.prom
echo -e "$(find "${BUFFER_PATH}" -type f 2>/dev/null | wc -l)\t${BUFFER_PATH}" | sed -ne 's/\\/\\\\/;s/"/\\"/g;s/^\([0-9]\+\)\t\(.*\)$/logging_node_agent_buffer_files{entity="\2", host="'$(hostname)'"} \1/p' >> /prometheus/node_exporter/textfile_collector/logging_node_agent_buffer_files.prom.$$
mv /prometheus/node_exporter/textfile_collector/logging_node_agent_buffer_files.prom.$$ /prometheus/node_exporter/textfile_collector/logging_node_agent_buffer_files.prom

sleep 60
done

0 comments on commit 149a9f4

Please sign in to comment.