Skip to content
BleemeoBleemeo

uWSGI

Auto-Detection
Built-in Metrics

Bleemeo monitors uWSGI through automatic service detection and built-in metrics gathered from the uWSGI stats server.

Glouton automatically detects uWSGI instances running on the host. To enable metrics collection, the stats server must be enabled by adding --stats 127.0.0.1:1717 --memory-report to your uWSGI command. Without --memory-report, the uwsgi_memory_used metric is not available.

By default, Glouton assumes the stats server runs on port 1717. If the auto-detected parameters are incorrect, you can override them manually.

Terminal window
sudo tee /etc/glouton/conf.d/99-uwsgi.conf > /dev/null << 'EOF'
service:
# For a uWSGI running outside a container
- type: "uwsgi"
address: "127.0.0.1"
port: 8080
stats_port: 1717
# If your server uses the --stats-http option, set the protocol to "http".
# If not set, "tcp" is used by default.
stats_protocol: "tcp"
# For an additional uWSGI running outside a container
- type: "uwsgi"
instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE"
address: "127.0.0.1"
port: 8080
stats_port: 1717
# For a uWSGI running in a Docker container
- type: "uwsgi"
instance: "CONTAINER_NAME"
port: 8080
stats_port: 1717
EOF
MetricDescription
service_statusStatus of uWSGI
uwsgi_requestsNumber of requests per second
uwsgi_transmittedAmount of data transmitted in bits per second
uwsgi_memory_usedMemory used in bytes
uwsgi_avg_request_timeAverage time to process a request in seconds
uwsgi_exceptionsNumber of exceptions per second
uwsgi_harakiri_countNumber of worker timeouts per second

See Troubleshoot a Service Check or Missing Metrics for what applies to every service: finding the address and port Glouton really uses, what each check message means, and how to read the collection error — which does not appear in the agent logs at the default level.

The check only opens the TCP port — it sends no command — so it fails when the port is wrong (Connection refused), when a firewall drops the packets (connection timed out after 10 seconds), or when the configured address cannot be parsed (Invalid TCP address). A green check proves the port is open, and nothing more.

A passing check says nothing about the metrics: they are collected separately.

Metrics come from the uWSGI stats server, on stats_port if set and 1717 otherwise, over TCP unless stats_protocol says http.

Reproduce what Glouton does, from the machine where the agent runs:

Terminal window
nc -w 2 127.0.0.1 1717 | head -c 200
What you see Cause Fix
a connection error on port 1717 The stats server is not enabled Add --stats 127.0.0.1:1717 to the uWSGI command
a connection error, and no TCP port for uWSGI in ss -lntp The stats server listens on a UNIX socket Glouton does not support the socket form — expose the stats server on a TCP port
a connection error The stats server is on another port Set stats_port
a parsing error The stats server is exposed over HTTP Set stats_protocol: "http"
uwsgi_memory_used is the only missing metric, everything else arrives uWSGI does not collect memory usage unless asked to Add --memory-report to the uWSGI command