LOENS2 / pterodactyl_exporter

Python script that extracts metrics from the Pterodactyl API and provides a metrics endpoint for Prometheus
GNU General Public License v3.0
32 stars 13 forks source link

Error if the node is under contract #36

Open CodeExplorerX opened 3 months ago

CodeExplorerX commented 3 months ago

If the node is under maintenance, then pterodactyl_exporter returns an error and stops scanning all servers, spamming the error console.

2024-07-31 17:06:55 | Init successful! 2024-07-31 17:07:05 | An error occurred: Fetch metrics for Server Name

CodeExplorerX commented 3 months ago

mostly an error on my part since I'm using an old version of Pterodactyl. And if the server has the status “supsended” or the node is undergoing technical work. Then /api/client/servers/{server.id}/resources returns a response with code 409. image

What helped me fix the error was not a big change in http_client: https://pastebin.com/PQvK1NGT

LOENS2 commented 3 months ago

Ok. I remember, that the were several problems with nodes in maintenance mode. I'll add an additional check to only process the data from nodes that return 200.

CodeExplorerX commented 3 months ago

Ok. I remember, that the were several problems with nodes in maintenance mode. I'll add an additional check to only process the data from nodes that return 200.

One more thing in Grafana there is a warning in Network Trafics, but it collects information about the network image

LOENS2 commented 3 months ago

I don't exactly know what the problem is with that. I've already asked the Grafana devs about it and they told me that this is because I don't stick to the conventions. You can ignore that if everything works as expected.

LOENS2 commented 3 months ago

Could you please tell me witch version of the Pterodactyl Panel you are using, because I'm not able to replicate the problem on my testing system.

I get the:

2024-07-31 17:06:55 | Init successful!
2024-07-31 17:07:05 | An error occurred:

But the exporter successfully keeps on exporting the other nodes' metrics, so that error is likely exclusive to your specific panel version.

CodeExplorerX commented 3 months ago

Could you please tell me witch version of the Pterodactyl Panel you are using, because I'm not able to replicate the problem on my testing system.

I get the:

2024-07-31 17:06:55 | Init successful!
2024-07-31 17:07:05 | An error occurred:

But the exporter successfully keeps on exporting the other nodes' metrics, so that error is likely exclusive to your specific panel version.

1.11.3

LOENS2 commented 3 months ago

Unfortunately, I'm not able to recreate that error. I've switched versions of the panel and wings all throughout the 1.11.x versions and nothing. All works as expected. The exporter doesn't restart, and the panel doesn't return code 409 either. I'm starting to wonder if this has its origins in the general installation of the panel. I use Caddy as a web server, but I've also tested the ginx installation and both work fine, no matter which panel version is used. Could you please tell me which web server you are using? And what is holding you back from updating your panel to the newest version.