Skip to content

Commit

Permalink
Collect more client_read and client_write metrics by default (#16423
Browse files Browse the repository at this point in the history
)
  • Loading branch information
FlorentClarret committed Dec 14, 2023
1 parent eeb9699 commit 96c406b
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
1 change: 1 addition & 0 deletions aerospike/changelog.d/16423.added
@@ -0,0 +1 @@
Collect more `client_read` and `client_write` metrics by default
11 changes: 9 additions & 2 deletions aerospike/datadog_checks/aerospike/metrics.py
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down
7 changes: 7 additions & 0 deletions aerospike/metadata.csv
Expand Up @@ -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,,
Expand All @@ -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,,
Expand Down
7 changes: 7 additions & 0 deletions aerospike/tests/common.py
Expand Up @@ -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',
Expand Down
21 changes: 21 additions & 0 deletions aerospike/tests/fixtures/prometheus.txt
Expand Up @@ -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
1 change: 1 addition & 0 deletions aerospike/tests/test_unit_openmetricsv2.py
Expand Up @@ -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)

Expand Down

0 comments on commit 96c406b

Please sign in to comment.