Mark
05/18/2026, 1:47 PMPREFECT_API_ENABLE_METRICS to true). But on my local prefect server, when I open the /metrics endpoint, I only see metrics on system resources (like filedescriptors, garbage collection and cpu_seconds), but I'm not seeing any metrics on number of flow runs. How do I get those metrics?Marvin
05/18/2026, 1:47 PMMarvin
05/18/2026, 1:50 PM/metrics by default.
With PREFECT_API_ENABLE_METRICS=true, Prefect’s /metrics endpoint exposes mostly:
- Python/runtime metrics like GC, CPU, file descriptors
- process metrics
- some Prefect event/log client metrics
But not built-in Prometheus metrics like “number of flow runs”.
If you want flow run counts, the native way is to query the API directly, for example:
bash
curl -X POST <http://localhost:4200/api/flow_runs/count>
You can also filter that count via the API if you only want certain flows, deployments, states, etc.
So the distinction is:
- /metrics = Prometheus/process-style telemetry
- /api/flow_runs/count = Prefect operational count data
If your goal is to put flow-run counts into Prometheus/Grafana, you’d typically do one of these:
1. Poll Prefect’s count endpoints and export them yourself
2. Build a small custom exporter that calls:
- /api/flow_runs/count
- optionally /api/task_runs/count
3. Scrape that exporter from Prometheus
Relevant endpoint:
- Prefect docs
If helpful, I can give you a small example exporter script that turns Prefect flow run counts into Prometheus metrics.Mark
05/22/2026, 10:12 AMMarvin
05/22/2026, 10:12 AMMarvin
05/22/2026, 10:12 AMMark
05/22/2026, 10:14 AMMarvin
05/22/2026, 10:14 AMMarvin
05/22/2026, 10:15 AMtext
### Bug summary
When running Prefect server in Docker with a read-only root filesystem, Prefect may repeatedly restart or fail to come up if the writable volume used for frontend static assets is too small.
In our case, this happened after a UI update increased the required disk space for static frontend files. The configured writable volume was previously large enough, but after the update it was no longer sufficient.
The main difficulty was that the failure mode did not produce a clear error message indicating that disk space for frontend assets was the issue.
### Version info
Please fill in:
- Prefect version:
- Deployment method: Docker
- OS / platform:
- Python version:
### Expected behavior
If Prefect cannot write or unpack required frontend static files because the writable filesystem/volume is too small, it should fail with a clear and actionable error message indicating:
- which path needs writable storage
- how much space was required / available, if possible
- that this may happen in read-only filesystem container setups
### Actual behavior
Prefect server restarted / failed to start, but without a sufficiently clear error message pointing to insufficient disk space for frontend static assets.
### Environment / setup
We run Prefect server in a Docker container with:
- read-only root filesystem
- an explicit writable mounted volume for frontend/static files
That writable volume was configured to 20MB.
Before the UI update, frontend files required about 17MB, so the setup worked.
After the UI update, the required size increased to about 53MB, and the server began restarting.
### Steps to reproduce
A rough reproduction path:
1. Run Prefect server in Docker with a read-only root filesystem
2. Mount a small writable volume for frontend/static files
3. Limit that volume to something below the required static asset size (for example ~20MB)
4. Start or upgrade Prefect to a version with larger frontend assets
5. Observe startup failure or restart loop
### What we found
The root cause was insufficient writable disk space for frontend static files.
Increasing the mounted volume size resolved the restart issue.
### Suggested improvement
It would help if Prefect:
- logged a clear startup error when frontend assets cannot be written due to insufficient space
- documented writable filesystem requirements for containerized read-only deployments
- possibly documented expected frontend asset storage requirements or recommended buffer space across upgrades
### Additional context
In our case, the frontend asset size increased from roughly 17MB to roughly 53MB after a UI update, which exceeded the configured writable volume size.
If you want, I can also make this more concise and “maintainer-friendly” before you post it.Mark
05/22/2026, 10:17 AMMarvin
05/22/2026, 10:17 AMMarvin
05/22/2026, 10:18 AMServer Stopped!
Body
text
### Bug summary
When running Prefect server in Docker with a read-only root filesystem, the server can fail to start / enter a restart loop if the writable volume used for frontend static assets is too small.
In this failure mode, the only visible log we saw was:
`Server Stopped!`
That made the issue difficult to diagnose and also makes it hard for other users to search for.
### Environment
- Deployment method: Docker
- Filesystem setup: read-only root filesystem
- Writable mount: separate volume for frontend/static files
- Writable volume size: 20MB
### Root cause
A recent UI update increased the required space for frontend static assets from roughly 17MB to roughly 53MB.
Our mounted writable volume was still sized for the older asset footprint, so Prefect could no longer write/unpack the frontend files and the server restarted.
Increasing the volume size resolved the issue.
### Expected behavior
If Prefect cannot write frontend static assets because the writable filesystem is too small, startup should fail with a clear, actionable error message indicating:
- the path that needs writable storage
- that disk space is insufficient
- ideally the required vs available space
### Actual behavior
The server stopped/restarted, and the only visible feedback was the info-level log line:
`Server Stopped!`
### Suggested improvement
Please surface a more specific startup error when frontend asset initialization fails due to insufficient writable storage, especially for read-only container deployments.
You can post it here:
- PrefectHQ/prefect issues
If you want, I can also draft a 1-paragraph GitHub Discussion version in case you’d rather post it as a discussion than an issue.