Commit graph

5 commits

Author SHA1 Message Date
sparky8512
dc4ff85dbe A few tweaks to the Prometheus exporter script
Move the global state onto the http server object so it doesn't have to be accessed as module globals.

Limit the mode groups that can be selected via command line args to the ones that are actually parsed. There are a few other options added in dish_common that don't really apply to this script, but they are mostly harmless, whereas some of the other mode groups will cause this script to throw an exception.

Reject access to "/favicon.ico" path, so testing from a web browser does not result in running the dish queries twice, and thus confusing the global state a little.

Add a lock to serialize calls to dish_common.get_data. That function is not thread-safe, even with CPython's Global Interpreter Lock, because the starlink_grpc functions it calls block. This script is really not meant for concurrent HTTP access, given that the usage stats are reported as usage since last access (by default), but since it's technically supported, might as well have it work properly.

Add the same handling of keyboard interrupt (Ctrl-C) and SIGTERM signal as the other grpc scripts, along with proper shutdown.
2022-12-21 10:25:57 -08:00
sparky8512
f23cf2d756 Revert "Make dish_obstruction_map work in Docker image"
This reverts commit 1545b0fcc9.
2022-12-01 17:51:24 -08:00
sparky8512
1545b0fcc9 Make dish_obstruction_map work in Docker image
As noted in issue #72, pypng was missing from the list of pip packages installed for the Docker image, which is required for dish_obstruction_map.
2022-12-01 17:50:29 -08:00
luxifer
d5f04c4999 ignore status_snr as it's deprecated 2022-11-18 22:26:28 +00:00
luxifer
40cd0127dc add prometheus exporter 2022-11-15 16:45:24 +00:00