diff --git a/scylla/datadog_checks/scylla/data/conf.yaml.example b/scylla/datadog_checks/scylla/data/conf.yaml.example index ead4e4048814f..4a83e49216152 100644 --- a/scylla/datadog_checks/scylla/data/conf.yaml.example +++ b/scylla/datadog_checks/scylla/data/conf.yaml.example @@ -12,18 +12,18 @@ instances: # # metric_groups: # - scylla.alien - # - scylla.batchlog + # - scylla.batchlog_manager # - scylla.commitlog # - scylla.cql # - scylla.database - # - scylla.execution + # - scylla.execution_stages # - scylla.hints # - scylla.httpd - # - scylla.io + # - scylla.io_queue # - scylla.lsa # - scylla.memory # - scylla.memtables - # - scylla.query + # - scylla.query_processor # - scylla.scheduler # - scylla.sstables # - scylla.thrift diff --git a/scylla/datadog_checks/scylla/metrics.py b/scylla/datadog_checks/scylla/metrics.py index 6975897181723..09045b08166fb 100644 --- a/scylla/datadog_checks/scylla/metrics.py +++ b/scylla/datadog_checks/scylla/metrics.py @@ -9,7 +9,7 @@ 'scylla_alien_total_sent_messages': 'alien.total_sent_messages', } -SCYLLA_BATCHLOG = { +SCYLLA_BATCHLOG_MANAGER = { 'scylla_batchlog_manager_total_write_replay_attempts': 'batchlog_manager.total_write_replay_attempts', } @@ -138,7 +138,7 @@ 'scylla_database_view_update_backlog': 'database.view_update_backlog', } -SCYLLA_EXECUTION = { +SCYLLA_EXECUTION_STAGES = { 'scylla_execution_stages_function_calls_enqueued': 'execution_stages.function_calls_enqueued', 'scylla_execution_stages_function_calls_executed': 'execution_stages.function_calls_executed', 'scylla_execution_stages_tasks_preempted': 'execution_stages.tasks_preempted', @@ -174,7 +174,7 @@ 'scylla_httpd_requests_served': 'httpd.requests_served', } -SCYLLA_IO = { +SCYLLA_IO_QUEUE = { 'scylla_io_queue_delay': 'io_queue.delay', 'scylla_io_queue_queue_length': 'io_queue.queue_length', 'scylla_io_queue_shares': 'io_queue.shares', @@ -225,7 +225,7 @@ 'scylla_node_operation_mode': 'node.operation_mode', } -SCYLLA_QUERY = { +SCYLLA_QUERY_PROCESSOR = { 'scylla_query_processor_queries': 'query_processor.queries', 'scylla_query_processor_statements_prepared': 'query_processor.statements_prepared', } @@ -376,18 +376,18 @@ ADDITIONAL_METRICS_MAP = { 'scylla.alien': SCYLLA_ALIEN, - 'scylla.batchlog': SCYLLA_BATCHLOG, + 'scylla.batchlog_manager': SCYLLA_BATCHLOG_MANAGER, 'scylla.commitlog': SCYLLA_COMMITLOG, 'scylla.cql': SCYLLA_CQL, 'scylla.database': SCYLLA_DATABASE, - 'scylla.execution': SCYLLA_EXECUTION, + 'scylla.execution_stages': SCYLLA_EXECUTION_STAGES, 'scylla.hints': SCYLLA_HINTS, 'scylla.httpd': SCYLLA_HTTPD, - 'scylla.io': SCYLLA_IO, + 'scylla.io_queue': SCYLLA_IO_QUEUE, 'scylla.lsa': SCYLLA_LSA, 'scylla.memory': SCYLLA_MEMORY, 'scylla.memtables': SCYLLA_MEMTABLES, - 'scylla.query': SCYLLA_QUERY, + 'scylla.query_processor': SCYLLA_QUERY_PROCESSOR, 'scylla.scheduler': SCYLLA_SCHEDULER, 'scylla.sstables': SCYLLA_SSTABLES, 'scylla.thrift': SCYLLA_THRIFT, diff --git a/scylla/tests/common.py b/scylla/tests/common.py index b946203b58aa7..e7bd96c0ac502 100644 --- a/scylla/tests/common.py +++ b/scylla/tests/common.py @@ -355,6 +355,27 @@ ] +INSTANCE_ADDITIONAL_GROUPS = [ + 'scylla.alien', + 'scylla.batchlog_manager', + 'scylla.commitlog', + 'scylla.cql', + 'scylla.database', + 'scylla.execution_stages', + 'scylla.hints', + 'scylla.httpd', + 'scylla.io_queue', + 'scylla.lsa', + 'scylla.memory', + 'scylla.memtables', + 'scylla.query_processor', + 'scylla.scheduler', + 'scylla.sstables', + 'scylla.thrift', + 'scylla.tracing', +] + + # expand the lists into a single list of metrics def get_metrics(metric_groups): """Given a list of metric groups, return single consolidated list""" @@ -362,3 +383,4 @@ def get_metrics(metric_groups): INSTANCE_DEFAULT_METRICS = get_metrics(INSTANCE_DEFAULT_GROUPS) +INSTANCE_ADDITIONAL_METRICS = get_metrics(INSTANCE_ADDITIONAL_GROUPS) diff --git a/scylla/tests/test_scylla.py b/scylla/tests/test_scylla.py index b9f73b20ded2c..274c20d0a5cfa 100644 --- a/scylla/tests/test_scylla.py +++ b/scylla/tests/test_scylla.py @@ -8,7 +8,13 @@ from datadog_checks.base.errors import CheckException, ConfigurationError from datadog_checks.scylla import ScyllaCheck -from .common import INSTANCE_DEFAULT_GROUPS, INSTANCE_DEFAULT_METRICS, get_metrics +from .common import ( + INSTANCE_ADDITIONAL_GROUPS, + INSTANCE_ADDITIONAL_METRICS, + INSTANCE_DEFAULT_GROUPS, + INSTANCE_DEFAULT_METRICS, + get_metrics, +) @pytest.mark.unit @@ -42,6 +48,23 @@ def test_instance_additional_check(aggregator, db_instance, mock_db_data): aggregator.assert_service_check('scylla.prometheus.health', count=1) +@pytest.mark.unit +def test_instance_full_additional_check(aggregator, db_instance, mock_db_data): + instance = deepcopy(db_instance) + instance['metric_groups'] = INSTANCE_ADDITIONAL_GROUPS + + c = ScyllaCheck('scylla', {}, [instance]) + + c.check(instance) + + metrics_to_check = INSTANCE_DEFAULT_METRICS + INSTANCE_ADDITIONAL_METRICS + + for m in metrics_to_check: + aggregator.assert_metric(m) + aggregator.assert_all_metrics_covered() + aggregator.assert_service_check('scylla.prometheus.health', count=1) + + @pytest.mark.unit def test_instance_invalid_group_check(aggregator, db_instance, mock_db_data): additional_metric_groups = ['scylla.bogus', 'scylla.sstables']