Technologies/Prefect/prefect.flow_run.count
PrefectPrefectMetric

prefect.flow_run.count

Total flow runs by state
Dimensions:None
Available on:PrometheusPrometheus (1)DatadogDatadog (1)Native (1)
Interface Metrics (3)
PrometheusPrometheus
Total number of flow runs by state
Dimensions:None
DatadogDatadog
Total number of flow runs
Dimensions:None
Native
Total number of flow runs by state
Dimensions:None

Technical Annotations (61)

Configuration Parameters (8)
concurrency_limitrecommended: 5-100 depending on capacity
Per-deployment cap prevents runaway concurrent executions
for_eachrecommended: ['prefect.resource.id'] or ['client_id']
Deduplicates runs per resource or client during floods
work_pool_typerecommended: cloud-run:push
Cloud Run has fastest cold starts for serverless workloads
marklateruns.loop_intervalrecommended: 5.0 seconds
default loop interval being exceeded by 2x
--limit
caps concurrent flow runs per agent as workaround for workload imbalance
PREFECT_AGENT_QUERY_RUN_FETCH_LIMIT
proposed setting to limit flow runs fetched per query cycle
forrecommended: 5m
Alert evaluation period before firing to avoid flapping
PREFECT_EVENTS_RETENTION_PERIODrecommended: 1-2 days for high volume, 3-5 days for medium volume
Default 7 days causes rapid growth on high-volume deployments
Error Signatures (7)
MarkLateRuns tooklog pattern
401http status
httpx.PoolTimeoutexception
httpcore.PoolTimeoutexception
Handler '_replicate_pod_event' failed with an exceptionlog pattern
Pendinglog pattern
Failedlog pattern
CLI Commands (12)
prefect work-pool set-concurrency-limit my-pool 5remediation
prefect work-queue set-concurrency-limit my-queue 5 --pool my-poolremediation
prefect work-pool create db-events-pool --type cloud-run:pushremediation
prefect work-pool provision-infra db-events-poolremediation
prefect work-pool set-concurrency-limit db-events-pool 100remediation
prefect agent start -q default --limit Nremediation
prefect agent start --hide-welcome -q default -p default-agent-pooldiagnostic
df -h /path/to/postgresql/datadiagnostic
SELECT pg_size_pretty(pg_database_size('prefect')) AS database_size;diagnostic
prefect config set PREFECT_EVENTS_RETENTION_PERIOD="2d"remediation
SELECT pg_size_pretty(pg_total_relation_size('public.events')) AS total_size, to_char(count(*), 'FM999,999,999') AS row_count, min(occurred) AS oldest_event, max(occurred) AS newest_event FROM events;diagnostic
prefect config view | grep EVENTS_RETENTIONdiagnostic
Technical References (34)
concurrency_limitcomponentfor_eachcomponentbackpressureconceptCloud RuncomponentECS FargatecomponentAzure Container Instancescomponentcold startconceptENI quotaconceptemit_eventcomponentprefect.resource.idcomponentMarkLateRunscomponentprefect.server.services.marklaterunscomponentread_flow_runscomponentset_flow_run_statecomponentkopfcomponent_replicate_pod_eventcomponentprefect_kubernetes.observercomponentHeroku schedulercomponentPrefect Cloudcomponentprefect agentcomponentwork queuecomponentflow runconceptwork poolcomponentPENDINGconceptRUNNINGconceptCANCELLINGconceptPydanticcomponentparameter schemaconceptagentcomponentworkercomponenton_failureconcepteventscomponentlogcomponentbackground servicescomponent
Related Insights (17)
API server overload at high scale causes HTTP 500 errorswarning
Alert flooding kills workers without concurrency limitscritical
Push work pools scale to high concurrency for event-driven workloadsinfo
Time-based polling obscures pipeline trigger causes and creates constant execution overheadwarning
MarkLateRuns service execution exceeds loop intervalwarning
Flow runs stuck in Cancelling state trigger persistent alertswarning
Prefect Cloud free tier rate limits cause request failureswarning
Prefect Kubernetes worker CPU spike and crash above 3.5K deployed flowscritical
Prefect observer cannot keep pace with K8s events at 5-10K concurrent flowswarning
Short-lived serverless agent deployments waste resources without timeoutwarning
Agent workload imbalance causes resource exhaustion on multi-agent deploymentswarning
Work pool concurrency limit blocks agent from picking up late runs when PENDING runs accumulatecritical
Flow runs stuck in PENDING state accumulate and consume work pool capacity indefinitelywarning
Invalid parameters cause flow runs to fail before executionwarning
Flow run submission failure sets incorrect Failed state instead of Crashedwarning
Disk usage exceeds critical threshold causing outage riskcritical
High-volume workload with default event retention causes rapid database growthwarning