Skip to main content

sprio

Overview

Collects SLURM job priority information using sprio and publishes it at regular intervals. This enables FAIR Passport and other tools to display job priority factors for users across clusters.

Data Type: DataType.LOG, Schema: SprioPayload

Execution Scope

Single node in the cluster.

Output Schema

SprioPayload

Published with DataType.LOG:

{
"ds": str, # Collection date (YYYY-MM-DD in Pacific time)
"collection_unixtime": int, # Unix timestamp of collection (for snapshot identification)
"cluster": str, # Cluster identifier
"derived_cluster": str, # Sub-cluster (same as cluster if not `--heterogeneous-cluster-v1`)
"sprio": { # Dictionary of job priority attributes
"JOBID": float, # Job ID
"PARTITION": str, # Partition name
"USER": str, # Username
"ACCOUNT": str, # Account name
"PRIORITY": float, # Total priority score
"SITE": float, # Site priority factor
"AGE": float, # Age priority factor
"ASSOC": str, # Association priority factor
"FAIRSHARE": float, # Fairshare priority factor
"JOBSIZE": float, # Job size priority factor
"PARTITION_PRIO": float, # Partition priority factor
"QOSNAME": str, # QoS name
"QOS": str, # QoS priority factor
"NICE": float, # Nice value adjustment
}
}

Important Notes:

  1. Each pending job creates a separate record
  2. Numeric priority factors are floats; identifiers are strings

Data Collection Commands

The collector executes:

sprio -h --sort=r,-y -o "%i|%r|%u|%o|%Y|%S|%a|%A|%F|%J|%P|%n|%Q|%N"

The custom format string avoids duplicate column names that appear in sprio -l output. Jobs are sorted by partition (ascending) and priority (descending).

Implementation Note: This format string is auto-generated from the SprioRow dataclass. Each field's format_code metadata defines the corresponding sprio format specifier. To add or modify fields, update SprioRow - the format string regenerates automatically.

Command-Line Options

OptionTypeDefaultDescription
--clusterStringAuto-detectedCluster name for metadata enrichment
--sinkStringRequiredSink destination, see Exporters
--sink-optsMultiple-Sink-specific options
--log-levelChoiceINFODEBUG, INFO, WARNING, ERROR, CRITICAL
--log-folderString/var/log/fb-monitoringLog directory
--stdoutFlagFalseDisplay metrics to stdout in addition to logs
--heterogeneous-cluster-v1FlagFalseEnable per-partition metrics for heterogeneous clusters
--intervalInteger120Seconds between collection cycles (2 minutes)
--onceFlagFalseRun once and exit (no continuous monitoring)
--retriesIntegerShared defaultRetry attempts on sink failures
--dry-runFlagFalsePrint to stdout instead of publishing to sink
--chunk-sizeIntegerShared defaultThe maximum size in bytes of each chunk when writing data to sink.

Usage Examples

Basic Continuous Collection

gcm sprio --sink otel --sink-opts "log_resource_attributes={'attr_1': 'value1'}"

One-Time Snapshot

gcm sprio --once --sink stdout

Debug Mode with Local File Output

gcm sprio \
--once \
--log-level DEBUG \
--stdout \
--sink file --sink-opts filepath=/tmp/sprio_data.jsonl