Skip to main content

Spark Job Metrics

Metrics published by every Onehouse-managed Spark job, for tracking job health, resource usage, and throughput in your own dashboards.

Query them from the Prometheus and Grafana running in your cloud environment — see Advanced Monitoring for access. For the ingestion and table-service metrics that describe what your Flows and Tables are doing, see the Datadog Metrics Reference. Both are in the same Prometheus, so you can combine them on one dashboard.

Executor metrics

The primary family for tracking a Spark job. Labeled with application_id, application_name, and executor_id. The driver reports itself as executor_id="driver" — filter with executor_id!="driver" for executors only.

Tasks

MetricDescription
metrics_executor_activeTasksTasks currently running
metrics_executor_maxTasksMaximum concurrent tasks the executor can run
metrics_executor_totalCoresCores available to the executor
metrics_executor_completedTasks_totalTasks completed successfully (cumulative)
metrics_executor_failedTasks_totalTasks that failed (cumulative)
metrics_executor_totalTasks_totalAll tasks launched (cumulative)
metrics_executor_totalDuration_seconds_totalTotal task execution time (cumulative)

Memory

MetricDescription
metrics_executor_JVMHeapMemory_bytesJVM heap in use
metrics_executor_JVMOffHeapMemory_bytesJVM off-heap in use
metrics_executor_memoryUsed_bytesMemory used for cached blocks
metrics_executor_maxMemory_bytesMemory available for cached blocks
metrics_executor_OnHeapExecutionMemory_bytesOn-heap memory used for execution (shuffles, joins, aggregations)
metrics_executor_OnHeapStorageMemory_bytesOn-heap memory used for storage
metrics_executor_OffHeapExecutionMemory_bytesOff-heap memory used for execution
metrics_executor_OffHeapStorageMemory_bytesOff-heap memory used for storage
metrics_executor_DirectPoolMemory_bytesNIO direct buffer pool
metrics_executor_MappedPoolMemory_bytesNIO mapped buffer pool

Process memory

Memory as seen by the OS. Useful for diagnosing container OOM kills, which JVM heap metrics alone will not explain.

MetricDescription
metrics_executor_ProcessTreeJVMRSSMemory_bytesJVM resident memory
metrics_executor_ProcessTreeJVMVMemory_bytesJVM virtual memory
metrics_executor_ProcessTreePythonRSSMemory_bytesPython resident memory (PySpark)
metrics_executor_ProcessTreePythonVMemory_bytesPython virtual memory (PySpark)

Garbage collection

MetricDescription
metrics_executor_totalGCTime_seconds_totalTotal GC time across all collectors (cumulative)
metrics_executor_MinorGCCount_totalMinor (young generation) GC count
metrics_executor_MinorGCTime_seconds_totalMinor GC time
metrics_executor_MajorGCCount_totalMajor (full) GC count
metrics_executor_MajorGCTime_seconds_totalMajor GC time

Shuffle, I/O, and storage

MetricDescription
metrics_executor_totalInputBytes_bytes_totalBytes read from input sources (cumulative)
metrics_executor_totalShuffleRead_bytes_totalShuffle bytes read (cumulative)
metrics_executor_totalShuffleWrite_bytes_totalShuffle bytes written (cumulative)
metrics_executor_diskUsed_bytesDisk used for cached blocks
metrics_executor_rddBlocksCached RDD blocks held by the executor

Driver metrics

Job-level state from the Spark driver.

note

Driver metrics are not labeled by application. Filter on the pod label, which is named managed-spark-job-<job-uuid>-driver, to attribute them to a specific job.

MetricDescription
metrics_onehouse_driver_jvm_heap_usage_ValueDriver heap in use, as a fraction between 0 and 1
metrics_onehouse_driver_JVMCPU_jvmCpuTime_ValueDriver JVM CPU time
metrics_onehouse_driver_DAGScheduler_job_activeJobs_ValueSpark jobs currently running
metrics_onehouse_driver_appStatus_jobDuration_ValueDuration of the most recent Spark job
metrics_onehouse_driver_appStatus_jobs_succeededJobs_CountSpark jobs that succeeded (cumulative)
metrics_onehouse_driver_appStatus_jobs_failedJobs_CountSpark jobs that failed (cumulative)
metrics_onehouse_driver_appStatus_stages_completedStages_CountStages completed (cumulative)
metrics_onehouse_driver_appStatus_stages_failedStages_CountStages that failed (cumulative)
metrics_onehouse_driver_ExecutorAllocationManager_executors_numberAllExecutors_ValueExecutors currently allocated
metrics_onehouse_driver_BlockManager_memory_memUsed_MB_ValueDriver memory used for cached blocks, in MB

The driver publishes several hundred additional metrics covering Spark internals. They are not listed here because they vary between Spark versions. To explore them, run this in the Prometheus query console:

group by (__name__) ({__name__=~"metrics_onehouse_driver_.*"})

Job and cluster status

MetricDescription
spark_infoSpark version and build info — always 1, read the labels
spark_driver_healthDriver health indicator
spark_job_failure_statusJob failure status
spark_job_inconsistent_stateJob is in an inconsistent state
auto_scale_target_executorsTarget executor count chosen by the autoscaler
auto_scale_triggerAutoscaling trigger events
auto_scale_eventsAutoscaling events

Labels

LabelPresent onMeaning
application_idexecutor metricsSpark application ID — unique per job run
application_nameexecutor metricsSpark application name — stable across runs
executor_idexecutor metricsExecutor number, or driver
podallDriver pod name — the only way to identify the job on driver metrics
namespaceallKubernetes namespace the job runs in
sparkClusterIdauto_scale_ metricsCluster the autoscaler is acting on
note

On auto_scale_ metrics the Spark job name appears as exported_job, not job — Prometheus renames the metric's own job label because it collides with the scrape target label.

Example queries

Active tasks per executor

sum by (application_name, executor_id) (metrics_executor_activeTasks)

Task failure rate per job

sum by (application_name) (rate(metrics_executor_failedTasks_total[5m]))

Percentage of executor time spent in GC

100 * sum by (application_name) (rate(metrics_executor_totalGCTime_seconds_total[5m]))
/ sum by (application_name) (rate(metrics_executor_totalDuration_seconds_total[5m]))

Executor JVM heap in use

sum by (application_name, executor_id) (metrics_executor_JVMHeapMemory_bytes)

Shuffle read and write throughput

sum by (application_name) (rate(metrics_executor_totalShuffleRead_bytes_total[5m]))

Input bytes read per job

sum by (application_name) (rate(metrics_executor_totalInputBytes_bytes_total[5m]))

Failed stages over the last hour

sum by (pod) (increase(metrics_onehouse_driver_appStatus_stages_failedStages_Count[1h]))

Executor count over time

metrics_onehouse_driver_ExecutorAllocationManager_executors_numberAllExecutors_Value

Things to know

  • Metrics exist only while the job runs. Series disappear when a job ends, and executor series churn as executors scale up and down. Use rate() or increase() over a window rather than instant values for stable panels.
  • Cumulative counters reset on restart. Anything ending in _total or _Count resets to zero when a driver or executor restarts. rate() and increase() handle this; raw subtraction does not.
  • Aggregate before charting. Executor metrics are per-executor — use sum by (application_name) or a busy job renders one line per executor.
  • maxMemory_bytes is not total heap. It is the memory reserved for cached blocks, so pair it with memoryUsed_bytes, not with JVMHeapMemory_bytes.
  • Watch cardinality. application_id is unique per job run and unbounded over time. Group by application_name or pod for dashboards that stay stable across restarts.

If you need a metric that is not listed here, file a support ticket with Onehouse.