Skip to content

Commit

Permalink
* Fix issue #13 - Added new label execution_id to rundeck_project_exe…
Browse files Browse the repository at this point in the history
…cution_status metrics
  • Loading branch information
phsmith committed Mar 22, 2021
1 parent 55fc3e1 commit 322e41d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 9 additions & 5 deletions rundeck_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -182,7 +183,8 @@ def get_project_executions(self, project: dict):
[
project_name,
job_id,
job_name
job_name,
execution_id
],
job_start_time
)
Expand All @@ -192,7 +194,8 @@ def get_project_executions(self, project: dict):
[
project_name,
job_id,
job_name
job_name,
execution_id
],
job_execution_duration
)
Expand All @@ -210,6 +213,7 @@ def get_project_executions(self, project: dict):
project_name,
job_id,
job_name,
execution_id,
status
],
value
Expand Down

0 comments on commit 322e41d

Please sign in to comment.