Spaces:
Runtime error
Runtime error
DaCrow13 commited on
Commit ·
b4e6edc
1
Parent(s): 888d4a9
Configura Prometheus per girare su Hugging Face Space
Browse filesFiles changed (4)
13 unmodified lines14151617181913 unmodified linesnginx \procps \curl \&& rm -rf /var/lib/apt/lists/*# Create a non-root user13 unmodified lines1415161718192013 unmodified linesnginx \procps \curl \prometheus \&& rm -rf /var/lib/apt/lists/*# Create a non-root user
48 unmodified lines49505152535448 unmodified lines- https://dacrow13-hopcroft-skill-classification.hf.space/openapi.json- https://dacrow13-hopcroft-skill-classification.hf.space/docs**Checks and alerts**- Monitors are configured to run from multiple locations.- Email notifications are enabled for failures.48 unmodified lines495051525354555657585948 unmodified lines- https://dacrow13-hopcroft-skill-classification.hf.space/openapi.json- https://dacrow13-hopcroft-skill-classification.hf.space/docs## Prometheus on Hugging Face SpacePrometheus is also running directly on the Hugging Face Space and is accessible at:- https://dacrow13-hopcroft-skill-classification.hf.space/prometheus/**Checks and alerts**- Monitors are configured to run from multiple locations.- Email notifications are enabled for failures.
28 unmodified lines29303132333434 unmodified lines69707172737428 unmodified linesserver 127.0.0.1:8000;}server {listen 7860;server_name localhost;34 unmodified linesproxy_set_header Host $host;}# Streamlit (Catch-all)location / {proxy_pass http://streamlit;28 unmodified lines2930313233343536373834 unmodified lines73747576777879808182838485868728 unmodified linesserver 127.0.0.1:8000;}upstream prometheus {server 127.0.0.1:9090;}server {listen 7860;server_name localhost;34 unmodified linesproxy_set_header Host $host;}# Prometheus UIlocation /prometheus/ {proxy_pass http://prometheus/prometheus/;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;}# Streamlit (Catch-all)location / {proxy_pass http://streamlit;
51 unmodified lines52535455565751 unmodified linessleep 2doneecho "$(date) - Starting Nginx reverse proxy..."if ! command -v nginx &> /dev/null; thenecho "$(date) - ERROR: nginx not found in PATH"51 unmodified lines525354555657585960616263646566676869707172737475767778798081828384858651 unmodified linessleep 2doneecho "$(date) - Configuring and starting Prometheus..."# Create a config for the spacecat <<EOF > /tmp/prometheus.ymlglobal:scrape_interval: 15sevaluation_interval: 15sscrape_configs:- job_name: 'hopcroft-api'metrics_path: '/metrics'static_configs:- targets: ['127.0.0.1:8000']scrape_interval: 10s- job_name: 'prometheus'static_configs:- targets: ['127.0.0.1:9090']EOF# Start Prometheus# --web.external-url needs to match the path in Nginxprometheus \--config.file=/tmp/prometheus.yml \--storage.tsdb.path=/tmp/prometheus_data \--web.listen-address=0.0.0.0:9090 \--web.external-url=/prometheus/ \--web.route-prefix=/prometheus/ \>> /tmp/prometheus.log 2>&1 &echo "$(date) - Starting Nginx reverse proxy..."if ! command -v nginx &> /dev/null; thenecho "$(date) - ERROR: nginx not found in PATH"
Dockerfile+1
monitoring/README.md+5
nginx.conf+13
scripts/start_space.sh+29