Skip to content

Commit

Permalink
Fix issue #14 - Fixed the info about running status
Browse files Browse the repository at this point in the history
  • Loading branch information
phsmith committed Mar 31, 2021
1 parent c0a9db2 commit f77253b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ docker run --rm -d -p 9620:9620 -e RUNDECK_TOKEN=$RUNDECK_TOKEN rundeck_exporter
```

## Changelog
`2.2.6`:
* Fix issue #14 - Fixed the info about running status

`2.2.5`:
* Fix issue #13 - Added new label execution_id to rundeck_project_execution_status metrics

Expand Down
13 changes: 10 additions & 3 deletions rundeck_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,21 @@ def get_project_executions(self, project: dict):
jobs_list = list()
metrics = None
endpoint = f'/project/{project_name}/executions?recentFilter=1d'
endpoint_running_executions = f'/project/{project_name}/executions/running?recentFilter=1d'


try:
if self.args.rundeck_projects_executions_cache:
project_executions = self.cached_request_data_from(endpoint)
project_executions_running_info = self.cached_request_data_from(endpoint_running_executions)
project_executions_info = self.cached_request_data_from(endpoint)
else:
project_executions = self.request_data_from(endpoint)
project_executions_running_info = self.request_data_from(endpoint_running_executions)
project_executions_info = self.request_data_from(endpoint)

project_executions = (project_executions_running_info.get('executions', [])
+ project_executions_info.get('executions', []))

for project_execution in project_executions['executions']:
for project_execution in project_executions:
job_info = project_execution.get('job', {})
job_id = job_info.get('id', 'None')
job_name = job_info.get('name', 'None')
Expand Down

0 comments on commit f77253b

Please sign in to comment.