# Metrics Every metric on the ops port's `/metrics` (`[ops] port`, 8090), generated from the code. Counters are shown with `_total`, histograms with `_bucket`, `_sum` and `_count`. Labels are bounded: never a run, task or attempt ID. ## Master | Metric | Type | Labels | Description | |---|---|---|---| | `schedr_master_triggers` | gauge | `state` | Triggers of DAGs that want them running, by state: running, waiting (for a free watcher slot or to start again), stopped (back-pressure, a generator that returned) or failing (`[triggers] failing_after` errors in a row) | | `schedr_master_trigger_events_total` | counter | `result` | Events received from triggers, by result: new (it started a run) or repeat (its key was seen before, and it started none) | | `schedr_master_trigger_back_pressure_stops_total` | counter | none | Triggers stopped for having `[triggers] max_queued_events` queued runs | | `schedr_master_trigger_idle_restarts_total` | counter | none | Triggers started again for finding nothing for their `restart_if_idle` | | `schedr_master_tick_duration_seconds` | histogram | none | How long each tick of the master's loop took | | `schedr_master_start_recorded_seconds` | histogram | none | From a task's start on its worker (in master time, as the worker estimates it) to the master recording it: the wait for the core's lock and the message's way (M5.1m) | | `schedr_master_core_lock_wait_seconds` | histogram | `by` | How long the master's core lock was waited for, by who waited (turn: a worker's messages; round; register; upload: a parse result; stream: a stream ended or dropped; restore) | | `schedr_master_turn_part_seconds` | histogram | `part` | How long each part of a worker's turn held the core lock (started: its `Started`s stored; finished: its `Finished`s; rest: heartbeats, warnings and the other messages) | | `schedr_master_turn_messages` | histogram | `part` | How many messages each part of a worker's turn handled | | `schedr_master_round_part_seconds` | histogram | `part` | How long each part of a round took, the core lock held (commands: commands applied and their follow-ups; scheduler: the scheduler's pass; triggers: the trigger loop's pass, beside the rounds; prepare: runs prepared and retries queued; expire: assignments expired and replaced incarnations ended; assign: cleanups, chained runs and assignments; rest: parse jobs expired, workers lost) | | `schedr_runs` | gauge | `state`, `kind` | Runs by state and kind | | `schedr_runs_finished_total` | counter | `dag_id`, `result` | Runs finished, by DAG and result | | `schedr_runs_late_failed_total` | counter | `dag_id`, `reason` | Runs that ended `success` and learnt of a failure afterwards (a yellow success, decision 309), by DAG and reason (`late_cleanup_failed`) | | `schedr_notifications_sent_total` | counter | `channel` | Notifications delivered, by channel | | `schedr_notifications_failed_total` | counter | `channel` | Notifications given up on (`[notifications] give_up_after`), by channel | | `schedr_retention_deleted_total` | counter | `kind` | Rows the retention job deleted: runs, outputs (runs whose outputs went), events, commands, dags, versions | | `schedr_tasks` | gauge | `state` | Task instances of unfinished runs, by state | | `schedr_tasks_waiting` | gauge | `reason` | Ready tasks not assigned at the last assignment pass, by reason (`next_round`: over the round's limit of assignments; `max_active_tasks`, `max_active`, `max_active_per_run`: a concurrency limit reached) | | `schedr_assignments_total` | counter | none | Attempts assigned to workers | | `schedr_rejections_total` | counter | `reason` | Assignments workers rejected, by reason | | `schedr_attempts_ended_total` | counter | `status` | Attempts ended, by status | | `schedr_parse_jobs_started_total` | counter | none | Parse jobs created | | `schedr_parse_jobs_finished_total` | counter | none | Parse jobs finished | | `schedr_parse_duration_seconds` | histogram | none | How long parse jobs took, from creation to the stored parse | | `schedr_commands_total` | counter | `kind`, `decision` | Commands decided, by kind and decision | | `schedr_command_latency_seconds` | histogram | none | How long commands waited for the master's decision | | `schedr_workers` | gauge | `state` | Workers in the registry, by state | | `schedr_master_leading` | gauge | none | 1 while this master holds the lease and schedules, 0 while it waits or is paused | | `schedr_master_replaced_attempts_held` | gauge | none | Started attempts of a replaced worker incarnation the master holds for a lease before ending them lost (decision 443): its old process may still run them | | `schedr_master_dags` | gauge | `state` | DAGs that can run, as of the last scheduler round: busy (it visited them) or quiet (nothing due); held: those whose file fails to import (no runs until it does) | | `schedr_master_dag_wakes_total` | counter | `reason` | DAGs a scheduler round visited after its term's first, by reason: timer, unknown (no next fire time stored), command, run_queued, run_ended, new_version | ## Worker | Metric | Type | Labels | Description | |---|---|---|---| | `schedr_worker_slots` | gauge | none | Task slots | | `schedr_worker_slots_used` | gauge | none | Task slots in use | | `schedr_worker_attempts_total` | counter | `status` | Attempts ended on this worker, by status | | `schedr_worker_task_start_seconds` | histogram | `method`, `phase` | How long Python tasks took to start, by start method (spawn, fork) and phase (runner: from starting the process to the runner's hello; import: from sending the task to the DAG file imported, not counted when that fails) | | `schedr_worker_assign_to_started_seconds` | histogram | none | How long an assignment took from its `AssignTask` taken by the agent's loop to its `Started` sent (its plan, inputs and journal record): not counted when rejected | | `schedr_worker_journal_write_seconds` | histogram | `record` | How long the journal took to keep records on disk, by record (start: a group of attempts before their `Started`s; process: a group of their processes' identities; results: a group of results) | | `schedr_worker_master_sample_age_seconds` | gauge | none | How old the heartbeat is that the worker reads master time from (decision 447: the tightest of its window; growing past a few heartbeats means the master isn't answering) | | `schedr_worker_master_round_trip_seconds` | gauge | none | That message's round trip, from its send to the master's answer naming it: how much the worker's master-time deadlines lose to the link | | `schedr_worker_older_epoch_refusals_total` | counter | none | Streams ended because their master leads with a lower lease epoch than one seen (decision 444: a deposed master still answering) | | `schedr_worker_watchdog_kills_total` | counter | none | Tasks and parse runners killed over their memory budget | | `schedr_worker_journal_records` | gauge | none | Attempts in the journal (running, or results not acknowledged) | | `schedr_worker_log_bytes` | gauge | none | Bytes of logs kept, as of the last retention sweep | | `schedr_worker_log_swept_bytes_total` | counter | none | Bytes of logs deleted by retention | | `schedr_worker_fork_servers` | gauge | `interpreter`, `kind`, `state` | Fork servers by interpreter, kind (preloaded, bare) and state (up, down, disabled): 1 for each server's current state | | `schedr_worker_fork_fallbacks_total` | counter | `interpreter`, `reason` | Python tasks a fork server didn't fork, by interpreter and reason (disabled, down, fork_failed, shim_died); the next fork server, or spawn, starts them | | `schedr_worker_watcher_slots` | gauge | none | Slots for wait steps | | `schedr_worker_watcher_slots_used` | gauge | none | Wait steps running | | `schedr_worker_watcher_hosts` | gauge | none | Processes running wait steps, one per code set | | `schedr_worker_watcher_threads` | gauge | `kind` | Threads of the hosts, by kind (tied: running a wait step's `to_thread` calls or started by it; untied: the rest of the process, a library's pools among them) | | `schedr_worker_watcher_memory_bytes` | gauge | none | Memory the hosts use together, against `[watchers] memory_budget` | | `schedr_worker_watcher_loop_lag_seconds` | histogram | none | How long a host's event loop took to get to a call: long ones are wait steps holding it up, short of `[watchers] block_limit` | | `schedr_worker_watcher_blocked_kills_total` | counter | none | Hosts killed for one wait step: it held the event loop, a thread of it stayed stuck, or it ignored its cancel | | `schedr_worker_watcher_restarts_total` | counter | none | Wait steps started again on a new host, as another one got theirs killed | | `schedr_worker_watcher_hosts_lost_total` | counter | `code` | Hosts ended with no wait step to blame (a crash, a memory kill, silence), by the code they ran: their wait steps use a retry | | `schedr_worker_watcher_thread_stops_total` | counter | none | `to_thread` calls stopped at their wait step's end, each of which may have left shared state half updated | ## Webserver | Metric | Type | Labels | Description | |---|---|---|---| | `schedr_http_requests_total` | counter | `route`, `status` | Requests to the REST API, by route template and status | | `schedr_log_proxy_errors_total` | counter | `kind` | Logs the webserver couldn't read from a worker, by why | ## Every role | Metric | Type | Labels | Description | |---|---|---|---| | `process_resident_memory_bytes` | gauge | none | Resident memory of this process | | `process_cpu_seconds_total` | counter | none | CPU time this process used, user and system | | `process_open_fds` | gauge | none | File descriptors this process has open | | `process_start_time_seconds` | gauge | none | When this process started, in seconds since the Unix epoch | | `schedr_build_info` | info | `version` | The schedr version running |