diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ec632e..15ebadb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.8.4] - 2025-01-13 ### Changed - Bump chart version (`0.3.1`) @@ -15,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Helm chart error when using `serviceMonitor.name` (formatting error) - Remove default `RUNDECK_TOKEN` env variable (default value overrules value from secret if set) +- Issue [#108](https://github.com/phsmith/rundeck_exporter/issues/108), fix Prometheus duplicate metrics error report when `rundeck.projects.executions.cache` option is enabled. ## [2.8.3] - 2024-10-16 ### Fixed @@ -322,7 +324,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release -[unreleased]: https://github.com/phsmith/rundeck_exporter/compare/v2.8.3...HEAD +[unreleased]: https://github.com/phsmith/rundeck_exporter/compare/v2.8.4...HEAD +[2.8.4]: https://github.com/phsmith/rundeck_exporter/compare/v2.8.3...v2.8.4 [2.8.3]: https://github.com/phsmith/rundeck_exporter/compare/v2.8.2...v2.8.3 [2.8.2]: https://github.com/phsmith/rundeck_exporter/compare/v2.8.1...v2.8.2 [2.8.1]: https://github.com/phsmith/rundeck_exporter/compare/v2.8.0...v2.8.1 diff --git a/requirements.txt b/requirements.txt index 8f69eda..a95bcc1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/rundeck_exporter.py b/rundeck_exporter.py index 1b4c490..d624b71 100755 --- a/rundeck_exporter.py +++ b/rundeck_exporter.py @@ -27,7 +27,7 @@ __author__ = 'Phillipe Smith' __author_email__ = 'phsmithcc@gmail.com' __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