-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* chore: update requirements.txt * docs: update CHANGELOG.md * fix(#108): add timestamp to project_executions metrics
- Loading branch information
Showing
3 changed files
with
13 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
cachetools==5.3.3 | ||
prometheus-client==0.20.0 | ||
cachetools==5.5.0 | ||
prometheus-client==0.21.1 | ||
requests==2.32.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
__author__ = 'Phillipe Smith' | ||
__author_email__ = '[email protected]' | ||
__app__ = 'rundeck_exporter' | ||
__version__ = '2.8.3' | ||
__version__ = '2.8.4' | ||
|
||
# Disable InsecureRequestWarning | ||
requests.urllib3.disable_warnings() | ||
|
@@ -527,6 +527,7 @@ def collect(self): | |
|
||
with ThreadPoolExecutor(thread_name_prefix='project_executions', max_workers=self.args.threadpool_max_workers) as project_executions_threadpool: | ||
project_execution_records = project_executions_threadpool.map(self.get_project_executions, projects) | ||
timestamp = datetime.now().timestamp() | ||
|
||
default_labels = self.default_labels + [ | ||
'project_name', | ||
|
@@ -565,15 +566,16 @@ def collect(self): | |
for project_execution_record_group, project_executions_total in project_execution_records: | ||
project_executions_total_metrics.add_metric( | ||
self.default_labels_values + [project_executions_total['project']], | ||
project_executions_total['total_executions'] | ||
project_executions_total['total_executions'], | ||
timestamp=timestamp | ||
) | ||
for project_execution_record in project_execution_record_group: | ||
if project_execution_record.execution_type == RundeckProjectExecution.START: | ||
project_start_metrics.add_metric(project_execution_record.tags, project_execution_record.value) | ||
project_start_metrics.add_metric(project_execution_record.tags, project_execution_record.value, timestamp=timestamp) | ||
elif project_execution_record.execution_type == RundeckProjectExecution.DURATION: | ||
project_duration_metrics.add_metric(project_execution_record.tags, project_execution_record.value) | ||
project_duration_metrics.add_metric(project_execution_record.tags, project_execution_record.value, timestamp=timestamp) | ||
elif project_execution_record.execution_type == RundeckProjectExecution.STATUS: | ||
project_metrics.add_metric(project_execution_record.tags, project_execution_record.value) | ||
project_metrics.add_metric(project_execution_record.tags, project_execution_record.value, timestamp=timestamp) | ||
|
||
yield project_start_metrics | ||
yield project_duration_metrics | ||
|