diff --git a/snowflake/datadog_checks/snowflake/check.py b/snowflake/datadog_checks/snowflake/check.py index b5e548b95ccdd..f33c6634268f0 100644 --- a/snowflake/datadog_checks/snowflake/check.py +++ b/snowflake/datadog_checks/snowflake/check.py @@ -32,7 +32,7 @@ class SnowflakeCheck(AgentCheck): __NAMESPACE__ = 'snowflake' - SERVICE_CHECK_CONNECT = 'snowflake.can_connect' + SERVICE_CHECK_CONNECT = 'can_connect' def __init__(self, *args, **kwargs): super(SnowflakeCheck, self).__init__(*args, **kwargs) diff --git a/snowflake/tests/test_snowflake.py b/snowflake/tests/test_snowflake.py index d89b1dbf4e670..140ffdf46a3bf 100644 --- a/snowflake/tests/test_snowflake.py +++ b/snowflake/tests/test_snowflake.py @@ -1,6 +1,7 @@ # (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) +import copy from decimal import Decimal from typing import Any, Callable, Dict @@ -13,6 +14,14 @@ from .common import CHECK_NAME, EXPECTED_TAGS +def test_emits_critical_service_check_when_service_is_down(dd_run_check, aggregator, instance): + config = copy.deepcopy(instance) + config['login_timeout'] = 5 + check = SnowflakeCheck(CHECK_NAME, {}, [config]) + dd_run_check(check) + aggregator.assert_service_check('snowflake.can_connect', SnowflakeCheck.CRITICAL) + + def test_storage_metrics(dd_run_check, aggregator, instance): # type: (Callable[[SnowflakeCheck], None], AggregatorStub, Dict[str, Any]) -> None