Platform Supported
Deployments
Recommendations
- Install
python3.11 or above - Use a dedicated virtual environment
Install PyObservability
python -m pip install pyobservabilityInitiate - IDE
import pyobservability
if __name__ == '__main__':
pyobservability.start()Initiate - CLI
pyobservability startUse
pyobservability --helpfor usage instructions.
Containerized Deployment
docker pull thevickypedia/pyobservability:latest
docker run \
--name observability \
-p 8080:80 \
-v /home/user/config:/config \
--restart=no \
thevickypedia/pyobservabilitySourcing environment variables from an env file
By default,
PyObservabilitywill look for a.envfile in the current working directory. Other file options (like JSON and YAML) are supported with a custom kwarg or env varenv_filepointing to the filepath.
Mandatory
- TARGETS - Target URLs running
PyNinjain the following format.TARGETS='[{"name":"node1","base_url":"http://192.168.1.10:8000","apikey":"token1"},{"name":"node2","base_url":"http://192.168.1.11:8000"}]'
Defaults
- HOST - Host IP to run PyObservability. Defaults to
127.0.0.1or0.0.0.0 - PORT - Port number to run PyObservability. Defaults to
8080 - INTERVAL - Polling interval to retrieve server information.
Optional
- USERNAME - Username to authenticate the monitoring page.
- PASSWORD - Password to authenticate the monitoring page.
- TIMEOUT - Timeout (in seconds) for UI authentication. Defaults to 5m.
Logging
PyObservability uses
uvicornlogger by default. Following options can be used to override the default logger.
- LOG - Lazy logger to use a custom log format. Can either be
fileorstdout. - DEBUG - Enables debug level logging. Defaults to
False. - LOGS_PATH - Directory path to store log files if
LOGis set tofile. - LOG_CONFIG - Path to a custom logging configuration file.
© Vignesh Rao
Licensed under the MIT License