From 6a8cc737227c6f9101ca5b49953eaeb71cb197b6 Mon Sep 17 00:00:00 2001 From: Natasha Dada Date: Fri, 27 Sep 2024 10:26:27 -0400 Subject: [PATCH] test --- sqlserver/datadog_checks/sqlserver/sqlserver.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sqlserver/datadog_checks/sqlserver/sqlserver.py b/sqlserver/datadog_checks/sqlserver/sqlserver.py index 090d1a262e28e..04c738e36c3ff 100644 --- a/sqlserver/datadog_checks/sqlserver/sqlserver.py +++ b/sqlserver/datadog_checks/sqlserver/sqlserver.py @@ -1,6 +1,7 @@ # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) + from __future__ import division import copy @@ -12,6 +13,11 @@ from datadog_checks.base import AgentCheck from datadog_checks.base.config import is_affirmative from datadog_checks.base.utils.db import QueryExecutor, QueryManager +from datadog_checks.base.utils.db.utils import ( + default_json_event_encoding, + resolve_db_host, + tracked_query, +) from datadog_checks.base.utils.db.utils import default_json_event_encoding, resolve_db_host, tracked_query from datadog_checks.base.utils.serialization import json from datadog_checks.sqlserver.activity import SqlserverActivity @@ -23,6 +29,7 @@ SqlserverDBFragmentationMetrics, SqlserverIndexUsageMetrics, ) +from datadog_checks.sqlserver.deadlocks import Deadlocks from datadog_checks.sqlserver.metadata import SqlserverMetadata from datadog_checks.sqlserver.schemas import Schemas from datadog_checks.sqlserver.statements import SqlserverStatementMetrics @@ -135,6 +142,7 @@ def __init__(self, name, init_config, instances): self.sql_metadata = SqlserverMetadata(self, self._config) self.activity = SqlserverActivity(self, self._config) self.agent_history = SqlserverAgentHistory(self, self._config) + self.deadlocks = Deadlocks(self, self._config) self.static_info_cache = TTLCache( maxsize=100, @@ -171,6 +179,7 @@ def cancel(self): self.activity.cancel() self.sql_metadata.cancel() self._schemas.cancel() + self.deadlocks.cancel() def config_checks(self): if self._config.autodiscovery and self.instance.get("database"): @@ -783,6 +792,7 @@ def check(self, _): self.activity.run_job_loop(self.tags) self.sql_metadata.run_job_loop(self.tags) self._schemas.run_job_loop(self.tags) + self.deadlocks.run_job_loop(self.tags) else: self.log.debug("Skipping check")