diff --git a/turbinia/processors/google_cloud.py b/turbinia/processors/google_cloud.py index 6825934f7..f7e9cf42e 100644 --- a/turbinia/processors/google_cloud.py +++ b/turbinia/processors/google_cloud.py @@ -25,7 +25,7 @@ from six.moves import urllib from libcloudforensics.providers.gcp.internal import project as gcp_project -from prometheus_client import Gauge +from prometheus_client import Counter from turbinia import config from turbinia import TurbiniaException @@ -35,7 +35,7 @@ ATTACH_SLEEP_TIME = 3 DETACH_SLEEP_TIME = 5 -turbinia_nonexisting_disk_path = Gauge( +turbinia_nonexisting_disk_path = Counter( 'turbinia_nonexisting_disk_path', 'Total number of non existing disk paths after attempts to attach') diff --git a/turbinia/processors/mount_local.py b/turbinia/processors/mount_local.py index ed2d58184..706a16607 100644 --- a/turbinia/processors/mount_local.py +++ b/turbinia/processors/mount_local.py @@ -24,7 +24,7 @@ import filelock import re -from prometheus_client import Gauge +from prometheus_client import Counter from turbinia import config from turbinia import TurbiniaException @@ -32,7 +32,7 @@ RETRY_MAX = 10 -turbinia_failed_loop_device_detach = Gauge( +turbinia_failed_loop_device_detach = Counter( 'turbinia_failed_loop_device_detach', 'Total number of loop devices failed to detach') diff --git a/turbinia/task_manager.py b/turbinia/task_manager.py index 5a6af5877..421324fb4 100644 --- a/turbinia/task_manager.py +++ b/turbinia/task_manager.py @@ -20,7 +20,7 @@ from datetime import datetime import time -from prometheus_client import Gauge +from prometheus_client import Counter import turbinia from turbinia import workers @@ -60,20 +60,21 @@ SERVER_TASK_TIMEOUT_BUFFER = 86400 # Define metrics -turbinia_server_tasks_total = Gauge( +turbinia_server_tasks_total = Counter( 'turbinia_server_tasks_total', 'Turbinia Server Total Tasks') -turbinia_server_tasks_completed_total = Gauge( +turbinia_server_tasks_completed_total = Counter( 'turbinia_server_tasks_completed_total', 'Total number of completed server tasks') -turbinia_jobs_total = Gauge('turbinia_jobs_total', 'Total number jobs created') -turbinia_jobs_completed_total = Gauge( +turbinia_jobs_total = Counter( + 'turbinia_jobs_total', 'Total number jobs created') +turbinia_jobs_completed_total = Counter( 'turbinia_jobs_completed_total', 'Total number jobs resolved') -turbinia_server_request_total = Gauge( +turbinia_server_request_total = Counter( 'turbinia_server_request_total', 'Total number of requests received.') -turbinia_server_task_timeout_total = Gauge( +turbinia_server_task_timeout_total = Counter( 'turbinia_server_task_timeout_total', 'Total number of Tasks that have timed out on the Server.') -turbinia_result_success_invalid = Gauge( +turbinia_result_success_invalid = Counter( 'turbinia_result_success_invalid', 'The result returned from the Task had an invalid success status of None') diff --git a/turbinia/tcelery.py b/turbinia/tcelery.py index 077d1b51e..0c2577ad8 100644 --- a/turbinia/tcelery.py +++ b/turbinia/tcelery.py @@ -53,6 +53,7 @@ def setup(self): self.app = celery.Celery( 'turbinia', broker=config.CELERY_BROKER, backend=config.CELERY_BACKEND) self.app.conf.update( + broker_connection_retry_on_startup=True, task_default_queue=config.INSTANCE_ID, accept_content=['json'], task_acks_late=True, diff --git a/turbinia/workers/__init__.py b/turbinia/workers/__init__.py index 1f949ea8c..6a662f8b1 100644 --- a/turbinia/workers/__init__.py +++ b/turbinia/workers/__init__.py @@ -34,7 +34,7 @@ import uuid import filelock -from prometheus_client import CollectorRegistry, Gauge, Histogram +from prometheus_client import CollectorRegistry, Counter, Histogram from turbinia import __version__, config from turbinia.config import DATETIME_FORMAT from turbinia.evidence import evidence_decode @@ -56,19 +56,19 @@ log = logging.getLogger('turbinia') registry = CollectorRegistry() -turbinia_worker_tasks_started_total = Gauge( +turbinia_worker_tasks_started_total = Counter( 'turbinia_worker_tasks_started_total', 'Total number of started worker tasks', registry=registry) -turbinia_worker_tasks_completed_total = Gauge( +turbinia_worker_tasks_completed_total = Counter( 'turbinia_worker_tasks_completed_total', 'Total number of completed worker tasks', registry=registry) -turbinia_worker_tasks_queued_total = Gauge( +turbinia_worker_tasks_queued_total = Counter( 'turbinia_worker_tasks_queued_total', 'Total number of queued worker tasks', registry=registry) -turbinia_worker_tasks_failed_total = Gauge( +turbinia_worker_tasks_failed_total = Counter( 'turbinia_worker_tasks_failed_total', 'Total number of failed worker tasks', registry=registry) -turbinia_worker_tasks_timeout_total = Gauge( +turbinia_worker_tasks_timeout_total = Counter( 'turbinia_worker_tasks_timeout_total', 'Total number of worker tasks timed out.', registry=registry)