Monitoring auto upgrades
You can follow an auto upgrade with the job, its job runs, the evaluation record, the summaries, and Amazon EventBridge events.
Checking a job's auto upgrade status
While the job is set to auto, GetJob returns AutoUpgradeMetadata. It shows the source version, the target version, the evaluation status, and the analysis ID. Use the analysis ID to approve or decline an upgrade and to get the summaries.
aws glue get-job \ --job-name my-etl-job \ --query 'Job.AutoUpgradeMetadata'
Checking which version a run used
GlueVersion in the GetJobRun response shows the version that a run actually used, such as 4.0. It never shows auto. Use it to tell apart runs on the current version, upgraded runs, and retries.
aws glue get-job-run \ --job-name my-etl-job \ --run-id jr_0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ --query 'JobRun.{Version:GlueVersion,State:JobRunState,Attempt:Attempt}'
Getting evaluation details
GetJobUpgradeAnalysis returns the current status in Status.
Status | Meaning | Runs execute on |
|---|---|---|
| Observation or the compatibility check is in progress | Current version |
| Waiting for you to approve or decline | Current version |
| Upgrade validation is in progress | Target version |
| The job now runs on the target version | Target version |
| The upgrade failed, and Amazon Glue set the job back to its previous version | Previous version |
| You declined, the request expired, you turned off auto upgrade, or you deleted the job | Current version |
The following command gets an evaluation.
aws glue get-job-upgrade-analysis \ --job-name my-etl-job \ --analysis-id ja-1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
To find the evaluations for a job, run the following command.
aws glue list-job-upgrade-analyses \ --job-name my-etl-job \ --filter '{"AnalysisType": "AUTO_UPGRADE"}'
Downloading the summary reports
For what each report contains, see Summary reports. To download the reports, do one of the following:
Console – Choose the job, and then choose the Upgrade Analysis tab.
Amazon CLI – Run the following command. The
AutoUpgradeEligibilitySummaryandAutoUpgradeEvaluationSummaryfields hold download URLs. The URLs are valid for 1 hour. To get new ones, run the command again.
aws glue get-job-upgrade-analysis \ --job-name my-etl-job \ --analysis-id ja-1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d \ --query '{Eligibility:AutoUpgradeEligibilitySummary,Evaluation:AutoUpgradeEvaluationSummary}'
Amazon EventBridge events
Amazon Glue sends an event at each step of an auto upgrade. You can use these events to get notified, for example when an upgrade needs your approval. Amazon Glue sends the events to the default event bus in your account. All events use the source aws.glue-autoversion. The detail type is Auto Version Job State Change. The resources field lists the job ARN. Delivery is best effort. Use GetJobUpgradeAnalysis as the source of truth.
| Sent when | Additional fields |
|---|---|---|
| An evaluation begins |
|
| The eligibility summary is ready |
|
| No decision within 7 days |
|
| The compatibility check blocked the upgrade after observation |
|
| An upgraded run passed validation |
|
| An upgraded run failed or failed validation |
|
| The upgrade succeeded |
|
| The upgrade failed and the job was set back to its previous version |
|
| You turned off auto upgrade or deleted the job |
|
The following event pattern matches approval requests. You can use it in a rule that sends them to an Amazon SNS topic.
{ "source": ["aws.glue-autoversion"], "detail-type": ["Auto Version Job State Change"], "detail": { "state": ["CONSENT_REQUIRED"] } }