From d21f96de89befe9b98f7a0634a1fc402288598f4 Mon Sep 17 00:00:00 2001 From: rahulkaukuntla Date: Fri, 25 Oct 2024 14:10:19 -0400 Subject: [PATCH] adding a service check --- scaphandre/assets/service_checks.json | 18 +++++++++++++++++- scaphandre/tests/test_unit.py | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/scaphandre/assets/service_checks.json b/scaphandre/assets/service_checks.json index fe51488c7..14908f129 100644 --- a/scaphandre/assets/service_checks.json +++ b/scaphandre/assets/service_checks.json @@ -1 +1,17 @@ -[] +[ + { + "agent_version": "7.60.0", + "integration": "Scaphandre", + "check": "scaphandre.openmetrics.health", + "statuses": [ + "ok", + "critical" + ], + "groups": [ + "host", + "endpoint" + ], + "name": "scaphandre OpenMetrics endpoint health", + "description": "Returns `CRITICAL` if the Agent is unable to connect to the Scaphandre OpenMetrics endpoint, otherwise returns `OK`." + } +] \ No newline at end of file diff --git a/scaphandre/tests/test_unit.py b/scaphandre/tests/test_unit.py index b6e59542a..1526e6180 100644 --- a/scaphandre/tests/test_unit.py +++ b/scaphandre/tests/test_unit.py @@ -17,6 +17,7 @@ def test_check(dd_run_check, aggregator, mock_http_response): for metric in METRICS: aggregator.assert_metric(f'scaphandre.{metric}') + aggregator.assert_service_check('scaphandre.openmetrics.health', ServiceCheck.OK) aggregator.assert_all_metrics_covered() aggregator.assert_metrics_using_metadata(get_metadata_metrics()) aggregator.assert_service_check('scaphandre.openmetrics.health', ServiceCheck.OK)