How to retrieve job run id from the script itself in python shell glue job
0
I need to print my python shell glue job run id from the script itself into cloudwatch logs. But I didn’t find a way to find the current job run id, I have found a partial way using boto3 functions but its giving all glue job run ids and if we want to find out current job run id then its saying to filter with job run status, but this procedure works only there is one job run at a time, in my scenario I am expecting concurrent runs. Can you help me on how to find out the current job run id??
asked 2 months ago50 views
1 Answers
0
You can pass this in your AWS Glue Scripts. See if this helps
import sys
from awsglue.utils import getResolvedOptions
args = getResolvedOptions(sys.argv, ['JOB_NAME'])
job_run_id = args['JOB_RUN_ID']
answered 2 months ago
Relevant questions
Accessing job arguments from a Glue script
Accepted Answerasked 5 years agoGlue job error : run ID: jr_f96799827354866ac2e798fb8b40d5781284e5ed5b3a4ff
asked a year agoUsing External Python Packages on AWS Glue.
asked 6 months agoThe job run failed. For help, post the error message on the AWS Glue forum or contact AWS support with the job run ID: jr_c543734f36402f421890d90db0419cc3c45816a3a767480d3dc19b6de68fac22
asked 3 months agoGlue studio has no option to edit existing job visually
asked 2 months agofail a glue job if the called stored procedure fails
asked 5 months agosend email from glue job
Accepted Answerasked 5 months agoAWS Glue python shell job is supporting only python 3.6, but boto3 is now stopping its support to python 3.6
asked 2 months agoHow to retrieve job run id from the script itself in python shell glue job
asked 2 months agoCan't install pyarrow on AWS Glue python shell
asked 2 years ago
I have tried this, but the job is throwing an error -> KeyError: JOB_RUN_ID, and as per your message it seems like job is trying to retrieve a job parameter which is not even passed. Without passing job run id in the job parameters how can we retrieve it from script?