Skip to content

Commit 571da3a

Browse files
authored
[SNMP] Fix datadog.snmp.check_duration metric not in tests (DataDog#20867)
* Fix datadog.snmp.check_duration metric * Add datadog.snmp.check_duration in metrics to skip for Python integration * Remove useless * Add quotes? * Fix space
1 parent 28ec1e3 commit 571da3a

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

snmp/metadata.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
metric_name,metric_type,interval,unit_name,per_unit_name,description,orientation,integration,short_name,curated_metric
22
datadog.snmp.check_duration,gauge,,second,,"The duration of a check run in seconds. The time needed for the integration check to run once on a device, including time to collect snmp data from a device, processing and submitting metrics/service checks/etc.",0,snmp,,
33
datadog.snmp.check_interval,count,,second,,The interval between check runs in seconds. The time delta between end of current check run and end of last check run,0,snmp,,
4+
datadog.snmp.requests,gauge,,,,"The number of SNMP requests sent during a check run.",0,snmp,,
45
datadog.snmp.submitted_metrics,gauge,,,,The number of SNMP metrics submitted metrics for a check run (does not include service checks and telemetry metrics).,0,snmp,,
56
datadog.snmp_traps.forwarded,count,,packet,,The number of SNMP Traps forwarded.,0,snmp,,
67
datadog.snmp_traps.incorrect_format,count,,packet,,The number of SNMP Traps dropped because of an incorrect format tagged by error.,0,snmp,,

snmp/tests/common.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,11 @@ def assert_common_check_run_metrics(aggregator, tags=None, is_e2e=False, loader=
301301
aggregator.assert_metric('datadog.snmp.check_duration', metric_type=aggregator.GAUGE, tags=tags)
302302
aggregator.assert_metric('datadog.snmp.check_interval', metric_type=monotonic_type, tags=tags)
303303
aggregator.assert_metric('datadog.snmp.submitted_metrics', metric_type=aggregator.GAUGE, tags=tags)
304+
if loader == 'core':
305+
# request_type tag can be get, getbulk, or getnext
306+
aggregator.assert_metric_has_tag_prefix('datadog.snmp.requests', tag_prefix='request_type:get')
307+
for tag in tags:
308+
aggregator.assert_metric_has_tag('datadog.snmp.requests', tag)
304309

305310

306311
def assert_common_device_metrics(

snmp/tests/test_e2e_core_vs_python.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
# Profiles may contain symbols declared twice with different names and the same OID
2727
# Python check does handle one single metric name per OID symbol
2828
SKIPPED_CORE_ONLY_METRICS = [
29+
'datadog.snmp.requests',
2930
'snmp.memory.total',
3031
'snmp.memory.used',
3132
'snmp.memory.free',

0 commit comments

Comments
 (0)