dagster-daemon CLI
Thedagster-daemon command-line interface manages the Dagster daemon process, which is responsible for executing schedules, sensors, backfills, and other background tasks.
Installation
The daemon is included with the main Dagster package:Overview
The Dagster daemon is a long-running process that must be running for:- Schedules to trigger runs automatically
- Sensors to evaluate and launch runs
- Backfills to execute partitioned runs
- Run queue management for controlling concurrency
- Auto-materializing assets (asset sensors)
- Run retries and failure handling
The daemon is automatically started when using
dagster dev. For production deployments, you’ll need to run it separately.Global Options
Show the installed Dagster version
Show help message and exit
dagster-daemon run
Start the Dagster daemon process.Usage
Options
Set the log level for code servers spun up by the daemonChoices:
critical, error, warning, info, debugSet the log level for the daemon processChoices:
critical, error, warning, info, debugEnvironment Variable: DAGSTER_DAEMON_LOG_LEVELFormat of the log output from the daemonChoices:
colored, json, richWorkspace Options
Path to workspace file. Can be specified multiple times
Path to a Python file containing Dagster definitions
Python module containing Dagster definitions
Working directory to use when loading the repository
Attribute within the module or file that defines the Definitions object
Example
Output
Daemon Types
The daemon automatically runs multiple sub-daemons:- SchedulerDaemon - Evaluates schedules and launches runs
- SensorDaemon - Evaluates sensors and launches runs
- BackfillDaemon - Executes backfill jobs
- AssetDaemon - Auto-materializes assets based on policies
- RunMonitoringDaemon - Monitors run status
- RunTimeoutDaemon - Handles run timeouts
- RunQueueDaemon - Manages run queue and concurrency
dagster-daemon liveness-check
Check for recent heartbeats from the daemon to verify it’s running.Usage
Example
Output
Exit Codes
0- Daemon is running1- Daemon is not running or unhealthy
Use Cases
Health Check in Docker:dagster-daemon wipe
Wipe all heartbeat data from storage.This command removes heartbeat metadata. It does not affect runs, schedules, or other data.
Usage
Example
Output
When to Use
- After changing daemon configuration
- When troubleshooting daemon issues
- After instance migration
- To clear stale heartbeat data
dagster-daemon debug
Daemon debugging utilities.dagster-daemon debug heartbeat
Read and write a test heartbeat to verify storage connectivity.dagster-daemon debug heartbeat-dump
Log all current heartbeat statuses.Output
When to Use Debug Commands
- Diagnosing daemon connectivity issues
- Verifying storage backend is working
- Troubleshooting heartbeat problems
- Checking daemon health status
Production Deployment
Running as a Service
Systemd Service (Linux):Docker Deployment
Dockerfile:Kubernetes Deployment
Configuration
dagster.yaml
Configure daemon behavior in yourdagster.yaml file:
Environment Variables
Directory containing the dagster.yaml instance configuration
Default log level for the daemon (overrides —log-level)
Seconds before considering a daemon unhealthy (default: 300)
Monitoring
Logs
Daemon logs are crucial for debugging. Common log locations: Development:Metrics
Important metrics to monitor:- Heartbeat Health - Use
liveness-checkregularly - Schedule Success Rate - Track successful schedule evaluations
- Sensor Lag - Time between sensor evaluations
- Queue Depth - Number of queued runs
- Daemon Uptime - Continuous operation time
Alerts
Set up alerts for:- Daemon process down
- Heartbeat failures
- Schedule evaluation errors
- Sensor evaluation errors
- Run queue backlog
Troubleshooting
Daemon Not Starting
Check instance configuration:Schedules Not Running
-
Verify daemon is running:
-
Check schedule is started:
-
Review daemon logs for errors:
- Verify schedule cron expression: Test your cron at crontab.guru
Sensors Not Triggering
-
Check sensor evaluation logs:
-
Verify sensor is enabled:
Check the UI or run
dagster sensor list - Check sensor evaluation time: Sensors evaluate every 30 seconds by default
Memory Issues
If the daemon is consuming too much memory:-
Reduce concurrent evaluations:
-
Limit run queue size:
-
Monitor and restart periodically:
High CPU Usage
-
Reduce sensor evaluation frequency:
- Optimize sensor code: Avoid expensive computations in sensor evaluation
- Check for sensor errors: Failing sensors may retry aggressively
Storage Connection Issues
Test storage connectivity:Related
- dagster CLI - Main Dagster CLI reference
- Instance Configuration - Configure your instance
- Schedules - Working with schedules
- Sensors - Working with sensors
- Run Coordinator - Configure run execution
