diff --git a/README.md b/README.md index a3b7e7a..a2ed773 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,9 @@ docker run --rm -d -p 9620:9620 -e RUNDECK_TOKEN=$RUNDECK_TOKEN rundeck_exporter ``` ## Changelog +`2.2.5`: +* Fix issue #13 - Added new label execution_id to rundeck_project_execution_status metrics + `2.2.4`: * Fix issue Regarding execution status #11 - Modified GaugeMetricFamily location in the function get_project_executions diff --git a/rundeck_exporter.py b/rundeck_exporter.py index 46aa4d9..1e8710a 100755 --- a/rundeck_exporter.py +++ b/rundeck_exporter.py @@ -149,6 +149,7 @@ def get_project_executions(self, project: dict): job_info = project_execution.get('job', {}) job_id = job_info.get('id', 'None') job_name = job_info.get('name', 'None') + execution_id = str(project_execution.get('id', 'None')) if job_id in jobs_list: continue @@ -158,19 +159,19 @@ def get_project_executions(self, project: dict): start_metrics = GaugeMetricFamily( 'rundeck_project_start_timestamp', f'Rundeck Project {project_name} Start Timestamp', - labels=['project_name', 'job_id', 'job_name'] + labels=['project_name', 'job_id', 'job_name', 'execution_id'] ) duration_metrics = GaugeMetricFamily( 'rundeck_project_execution_duration_seconds', f'Rundeck Project {project_name} Execution Duration', - labels=['project_name', 'job_id', 'job_name'] + labels=['project_name', 'job_id', 'job_name', 'execution_id'] ) metrics = GaugeMetricFamily( 'rundeck_project_execution_status', f'Rundeck Project {project_name} Execution Status', - labels=['project_name', 'job_id', 'job_name', 'status'] + labels=['project_name', 'job_id', 'job_name', 'execution_id', 'status'] ) # Job start/end times @@ -182,7 +183,8 @@ def get_project_executions(self, project: dict): [ project_name, job_id, - job_name + job_name, + execution_id ], job_start_time ) @@ -192,7 +194,8 @@ def get_project_executions(self, project: dict): [ project_name, job_id, - job_name + job_name, + execution_id ], job_execution_duration ) @@ -210,6 +213,7 @@ def get_project_executions(self, project: dict): project_name, job_id, job_name, + execution_id, status ], value