View a markdown version of this page

Monitoring and billing for auto scaling - AWS Glue

Monitoring and billing for auto scaling

This topic applies to both ways of using auto scaling on AWS Glue: legacy auto scaling (--enable-auto-scaling) and the managed scaling profile (--scaling-profile balanced). You use the same metrics, logs, and billing information to monitor a run with either method.

Billing

With both legacy auto scaling and the managed scaling profile, AWS Glue bills for the executors that a run actually uses, measured in DPU-seconds. It doesn't bill for the maximum number of workers that you allow. After a batch ETL job run finishes, GetJobRun returns the DPUSeconds field with the resources that the run used. For pricing details, see the AWS Glue pricing page.

Monitoring scaling with Amazon CloudWatch metrics

The CloudWatch executor metrics are available for your AWS Glue 3.0 or later jobs when you use auto scaling. The metrics can be used to monitor the demand and optimized usage of executors in their Spark applications that use auto scaling. For more information, see Monitoring AWS Glue using Amazon CloudWatch metrics.

You can also utilize AWS Glue observability metrics to get insights about resource utilization. For example, by monitoring glue.driver.workerUtilization, you can monitor how much resource was actually used with and without auto scaling. For another example, by monitoring glue.driver.skewness.job and glue.driver.skewness.stage, you can see how the data is skewed. Those insights will help you decide to enable auto scaling and fine tune the configurations. For more information, see Monitoring with Monitoring with AWS Glue Observability metrics.

  • glue.driver.ExecutorAllocationManager.executors.numberAllExecutors

  • glue.driver.ExecutorAllocationManager.executors.numberMaxNeededExecutors

For more details on these metrics, see Monitoring for DPU capacity planning.

Note

CloudWatch executor metrics are not available for interactive sessions.

Monitoring auto scaling with Amazon CloudWatch metrics.

Monitoring scaling with Amazon CloudWatch Logs

If you are using interactive sessions, you can monitor the number of executors by enabling continuous Amazon CloudWatch Logs and searching “executor” in the logs, or by using the Spark UI. To do this, use the %%configure magic to enable continuous logging along with enable auto scaling.

%%configure{ "--enable-continuous-cloudwatch-log": "true", "--enable-auto-scaling": "true" }

In the Amazon CloudWatch Logsevents, search "executor"in the logs:

Monitoring auto scaling with Amazon CloudWatch metrics.

Monitoring scaling with Spark UI

With auto scaling, you can also monitor executors being added and removed with dynamic scale-up and scale-down based on the demand in your AWS Glue jobs using the Glue Spark UI. For more information, see Enabling the Apache Spark web UI for AWS Glue jobs.

Monitoring auto scaling with Spark UI.

Monitoring job run DPU usage

You may use the AWS Glue Studio Job run view to check the DPU usage of your jobs.

  1. Choose Monitoring from the AWS Glue Studio navigation pane. The Monitoring page appears.

  2. Scroll down to the Job runs chart.

  3. Navigate to the job run you are interested and scroll to the DPU hours column to check the usage for the specific job run.