Describe the bug
Self-hosting on MacOS no longer works due to recent changes to prometheus.py.
This utility now attempts to open /proc/stat which does not exist in MacOS, and does not handle the error gracefully.
[Cluster 1] Traceback (most recent call last):
[Cluster 1] File "/Users/Nelluk/Documents/ProgrammingProjects/discord_bots/modmail-pc-2/main.py", line 67, in <module>
[Cluster 1] loop.run_until_complete(bot.start_bot())
[Cluster 1] File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
[Cluster 1] return future.result()
[Cluster 1] File "/Users/Nelluk/Documents/ProgrammingProjects/discord_bots/modmail-pc-2/classes/bot.py", line 102, in start_bot
[Cluster 1] await self.connect_prometheus()
[Cluster 1] File "/Users/Nelluk/Documents/ProgrammingProjects/discord_bots/modmail-pc-2/classes/bot.py", line 95, in connect_prometheus
[Cluster 1] self.prom = prometheus.Prometheus(self)
[Cluster 1] File "/Users/Nelluk/Documents/ProgrammingProjects/discord_bots/modmail-pc-2/utils/prometheus.py", line 22, in __init__
[Cluster 1] with open(os.path.join("/proc", "stat"), "rb") as stat:
[Cluster 1] FileNotFoundError: [Errno 2] No such file or directory: '/proc/stat'
[Cluster 1] ERROR:asyncio:Unclosed client session
[Cluster 1] client_session: <aiohttp.client.ClientSession object at 0x10494ce80>
[Cluster 1] ERROR:asyncio:Exception in default exception handler
Describe the bug Self-hosting on MacOS no longer works due to recent changes to
prometheus.py
. This utility now attempts to open/proc/stat
which does not exist in MacOS, and does not handle the error gracefully.