Monitoring

SAQ comes with a simple UI for monitor workers and jobs:

SAQ Web UI

SAQ Web UI

Part of worker process

You can run it as part of the worker process:

saq examples.simple.settings --web

which wil serve it on port 8080 by default. You can specify a custom port by adding --port <portnum>. e.g.:

saq examples.simple.settings --web --port 7000

Mounted in your own web service

You can also mount the Web UI as part of your own web service

Starlette/FastAPI

Module saq.web.starlette contains a starlette instance for use in anything that is derived from Starlette.

from fastapi import FastAPI
from saq.web.starlette import saq_web

app = FastAPI()

app.mount("/monitor", saq_web("/monitor", queues=all_the_queues_list))
from saq.web.starlette import saq_web
from starlette.routing import Mount

routes = [
    ...
    Mount("/monitor", saq_web("/monitor", queues=all_the_queues_list))
]
saq.web.starlette.saq_web(root_path, queues)[source]

Create an embeddable monitoring Web UI

Example

routes = [
    Mount("/monitor", saq_web("/monitor", queues=all_the_queues_list))
]
Parameters:
  • root_path (str) – The absolute mount point, typically the same as where you mount it.

  • queues (list[saq.queue.Queue]) – The list of known queues

Returns:

Starlette ASGI instance.

Return type:

starlette.applications.Starlette