Total bytes received over a period of time

I’m using Fluentd to forward logs to Prometheus, querying Prometheus every 15 seconds. Within Prometheus, there are multiple workers and nodes. I aim to calculate the total bytes of logs received per each appcode, consolidating data from all workers and nodes for each appcode. Additionally, I need the query to handle scenarios where machines crash and restart, providing the total bytes received both before and after the crash. For instance, if I send 500 bytes for a specific appcode, which is distributed across different workers and nodes, and then the machine crashes and restarts, followed by sending 300 bytes, the query should return 800. I’ve experimented with sum_over_time and increase, but they haven’t yielded the correct results. Any assistance on providing a solution for this would be greatly appreciated. Thank you.