From 96c406bd544fc44ba70521bfac2b77e7999215d0 Mon Sep 17 00:00:00 2001 From: Florent Clarret Date: Thu, 14 Dec 2023 10:40:43 +0100 Subject: [PATCH] Collect more `client_read` and `client_write` metrics by default (#16423) --- aerospike/changelog.d/16423.added | 1 + aerospike/datadog_checks/aerospike/metrics.py | 11 ++++++++-- aerospike/metadata.csv | 7 +++++++ aerospike/tests/common.py | 7 +++++++ aerospike/tests/fixtures/prometheus.txt | 21 +++++++++++++++++++ aerospike/tests/test_unit_openmetricsv2.py | 1 + 6 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 aerospike/changelog.d/16423.added diff --git a/aerospike/changelog.d/16423.added b/aerospike/changelog.d/16423.added new file mode 100644 index 0000000000000..2de31e585b93c --- /dev/null +++ b/aerospike/changelog.d/16423.added @@ -0,0 +1 @@ +Collect more `client_read` and `client_write` metrics by default diff --git a/aerospike/datadog_checks/aerospike/metrics.py b/aerospike/datadog_checks/aerospike/metrics.py index 6c5f7a495875f..dec7a679ddc55 100644 --- a/aerospike/datadog_checks/aerospike/metrics.py +++ b/aerospike/datadog_checks/aerospike/metrics.py @@ -10,7 +10,7 @@ 'aerospike_namespace_hwm_breached': 'namespace.hwm_breached', 'aerospike_namespace_memory_free_pct': 'namespace.memory_free_pct', 'aerospike_namespace_stop_writes': 'namespace.stop_writes', - # pmem only avalable when configured: + # pmem only available when configured: # https://github.com/aerospike/aerospike-prometheus-exporter/issues/20#issuecomment-634476536 'aerospike_namespace_pmem_available_pct': 'namespace.pmem_available_pct', 'aerospike_namespace_unavailable_partitions': 'namespace.unavailable_partitions', @@ -23,8 +23,15 @@ 'aerospike_xdr_lag': 'xdr.lag', 'aerospike_namespace_client_delete_error': 'namespace.client_delete_error', 'aerospike_namespace_client_read_error': 'namespace.client_read_error', + 'aerospike_namespace_client_read_success': 'namespace.client_read_success', + 'aerospike_namespace_client_read_not_found': 'namespace.client_read_not_found', + 'aerospike_namespace_client_read_timeout': 'namespace.client_read_timeout', + 'aerospike_namespace_client_read_filtered_out': 'namespace.client_read_filtered_out', 'aerospike_namespace_client_udf_error': 'namespace.client_udf_error', 'aerospike_namespace_client_write_error': 'namespace.client_write_error', + 'aerospike_namespace_client_write_success': 'namespace.client_write_success', + 'aerospike_namespace_client_write_timeout': 'namespace.client_write_timeout', + 'aerospike_namespace_client_write_filtered_out': 'namespace.client_write_filtered_out', # index_flash_alloc_pct only available in ee configured with index-type flash: # https://docs.aerospike.com/reference/metrics#index_flash_alloc_pct 'aerospike_namespace_index_flash_alloc_pct': 'namespace.index_flash_alloc_pct', @@ -33,7 +40,7 @@ 'aerospike_namespace_scan_basic_error': 'namespace.scan_basic_error', 'aerospike_namespace_scan_ops_bg_error': 'namespace.scan_ops_bg_error', 'aerospike_namespace_scan_udf_bg_error': 'namespace.scan_udf_bg_error', - # storage_engine metrics avaialble per-device or per-file depending on storage configuration: + # storage_engine metrics available per-device or per-file depending on storage configuration: # https://github.com/aerospike/aerospike-prometheus-exporter/blob/bf6af43d758c6f96d7d34bf2b8742d3a6df4bfc8/watcher_namespaces.go#L383-L400 'aerospike_namespace_storage_engine_device_defrag_q': 'namespace.storage_engine_device_defrag_q', 'aerospike_namespace_storage_engine_file_defrag_q': 'namespace.storage_engine_file_defrag_q', diff --git a/aerospike/metadata.csv b/aerospike/metadata.csv index 0b46ee77659dd..591e71365e3b5 100644 --- a/aerospike/metadata.csv +++ b/aerospike/metadata.csv @@ -404,6 +404,10 @@ aerospike.namespace.client_proxy_error,gauge,,,,[Legacy] The number of proxy tra aerospike.namespace.client_proxy_timeout,gauge,,,,[Legacy] The number of proxy transactions initiated by a client request that timed out.,0,aerospike,, aerospike.namespace.client_read_error,gauge,,,,[Legacy] The number of client read transaction errors.,0,aerospike,, aerospike.namespace.client_read_error.count,count,,,,[OpenMetricsV2 and Aerospike v3.9+] The number of client read transaction errors.,0,aerospike,, +aerospike.namespace.client_read_success.count,count,,,,[OpenMetricsV2 and Aerospike v3.9+] The number of client read transaction success.,0,aerospike,, +aerospike.namespace.client_read_not_found.count,count,,,,[OpenMetricsV2 and Aerospike v3.9+] The number of client read transaction not found.,0,aerospike,, +aerospike.namespace.client_read_timeout.count,count,,,,[OpenMetricsV2 and Aerospike v3.9+] The number of client read transaction timeout.,0,aerospike,, +aerospike.namespace.client_read_filtered_out.count,count,,,,[OpenMetricsV2 and Aerospike v3.9+] The number of client read transaction filtered out.,0,aerospike,, aerospike.namespace.client_read_not_found,gauge,,,,[Legacy] The number of client read transaction that resulted in not found.,0,aerospike,, aerospike.namespace.client_read_success,gauge,,,,[Legacy] The number of successful client read transactions.,0,aerospike,, aerospike.namespace.client_read_timeout,gauge,,,,[Legacy] The number of client read transaction that timed out.,0,aerospike,, @@ -415,6 +419,9 @@ aerospike.namespace.client_udf_error.count,count,,,,[OpenMetricsV2 and Aerospike aerospike.namespace.client_udf_timeout,gauge,,,,[Legacy] The number of udf transactions initiated by the client that timed out.,0,aerospike,, aerospike.namespace.client_write_error,gauge,,,,[Legacy] The number of client write transactions that failed with an error.,0,aerospike,, aerospike.namespace.client_write_error.count,count,,,,[OpenMetricsV2 and Aerospike v3.9+] The number of client write transactions that failed with an error.,0,aerospike,, +aerospike.namespace.client_write_success.count,count,,,,[OpenMetricsV2 and Aerospike v3.9+] The number of client write transactions that succeeded.,0,aerospike,, +aerospike.namespace.client_write_timeout.count,count,,,,[OpenMetricsV2 and Aerospike v3.9+] The number of client write transactions that timed out.,0,aerospike,, +aerospike.namespace.client_write_filtered_out.count,count,,,,[OpenMetricsV2 and Aerospike v3.9+] The number of client write transactions that were filtered out.,0,aerospike,, aerospike.namespace.client_write_success,gauge,,,,[Legacy] The number of successful client write transactions.,0,aerospike,, aerospike.namespace.client_write_timeout,gauge,,,,[Legacy] The number of client write transactions that timed out.,0,aerospike,, aerospike.namespace.evicted_objects,gauge,,,,[Legacy] The number of objects evicted from this namespace on this node since the server started. Deprecated since 3.9,0,aerospike,, diff --git a/aerospike/tests/common.py b/aerospike/tests/common.py index c981c56651054..c0dd957dbabda 100644 --- a/aerospike/tests/common.py +++ b/aerospike/tests/common.py @@ -24,8 +24,15 @@ EXPECTED_PROMETHEUS_METRICS = [ 'aerospike.namespace.client_delete_error.count', 'aerospike.namespace.client_read_error.count', + 'aerospike.namespace.client_read_success.count', + 'aerospike.namespace.client_read_not_found.count', + 'aerospike.namespace.client_read_timeout.count', + 'aerospike.namespace.client_read_filtered_out.count', 'aerospike.namespace.client_udf_error.count', 'aerospike.namespace.client_write_error.count', + 'aerospike.namespace.client_write_success.count', + 'aerospike.namespace.client_write_timeout.count', + 'aerospike.namespace.client_write_filtered_out.count', 'aerospike.namespace.clock_skew_stop_writes', 'aerospike.namespace.dead_partitions', 'aerospike.namespace.device_available_pct', diff --git a/aerospike/tests/fixtures/prometheus.txt b/aerospike/tests/fixtures/prometheus.txt index 764102bf16c6b..bc71a2a93cf6f 100644 --- a/aerospike/tests/fixtures/prometheus.txt +++ b/aerospike/tests/fixtures/prometheus.txt @@ -112,3 +112,24 @@ aerospike_xdr_retry_no_node{cluster_name="null",dc="DC1",service="192.168.32.3:3 # HELP aerospike_xdr_success success # TYPE aerospike_xdr_success counter aerospike_xdr_success{cluster_name="null",dc="DC1",service="192.168.32.3:3000"} 1 +# HELP aerospike_namespace_client_write_success client write success +# TYPE aerospike_namespace_client_write_success counter +aerospike_namespace_client_write_success{cluster_name="null",ns="DC1",service="192.168.32.3:3000",storage_engine="device"} 1.418680251e+09 +# HELP aerospike_namespace_client_write_timeout client write timeout +# TYPE aerospike_namespace_client_write_timeout counter +aerospike_namespace_client_write_timeout{cluster_name="null",ns="DC1",service="192.168.32.3:3000",storage_engine="device"} 144 +# HELP aerospike_namespace_client_write_filtered_out client write filtered out +# TYPE aerospike_namespace_client_write_filtered_out counter +aerospike_namespace_client_write_filtered_out{cluster_name="null",ns="DC1",service="192.168.32.3:3000",storage_engine="device"} 0 +# HELP aerospike_namespace_client_read_filtered_out client read filtered out +# TYPE aerospike_namespace_client_read_filtered_out counter +aerospike_namespace_client_read_filtered_out{cluster_name="null",ns="user-data",service="192.168.32.3:3000",storage_engine="device"} 0 +# HELP aerospike_namespace_client_read_not_found client read not found +# TYPE aerospike_namespace_client_read_not_found counter +aerospike_namespace_client_read_not_found{cluster_name="null",ns="user-data",service="192.168.32.3:3000",storage_engine="device"} 2 +# HELP aerospike_namespace_client_read_success client read success +# TYPE aerospike_namespace_client_read_success counter +aerospike_namespace_client_read_success{cluster_name="null",ns="user-data",service="192.168.32.3:3000",storage_engine="device"} 100 +# HELP aerospike_namespace_client_read_timeout client read timeout +# TYPE aerospike_namespace_client_read_timeout counter +aerospike_namespace_client_read_timeout{cluster_name="null",ns="user-data",service="192.168.32.3:3000",storage_engine="device"} 0 diff --git a/aerospike/tests/test_unit_openmetricsv2.py b/aerospike/tests/test_unit_openmetricsv2.py index bd0ef5ecd3725..f12312b46ba2c 100644 --- a/aerospike/tests/test_unit_openmetricsv2.py +++ b/aerospike/tests/test_unit_openmetricsv2.py @@ -20,6 +20,7 @@ def get_fixture_path(filename): def test_openmetricsv2_check(aggregator, dd_run_check, instance_openmetrics_v2, mock_http_response): mock_http_response(file_path=get_fixture_path('prometheus.txt')) + check = AerospikeCheck('aerospike', {}, [instance_openmetrics_v2]) dd_run_check(check)