Skip to content

Commit 4896c1d

Browse files
authored
[DBMON-6783] Implement DatabaseChecks.tags property to use tag_manager (#24244)
* Implement tags property to use tag_manager * Add changelog
1 parent 0886dca commit 4896c1d

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Implement the `DatabaseCheck.tags` property backed by a shared `TagManager` so DBM integrations can consolidate tag handling.

datadog_checks_base/datadog_checks/base/checks/db.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44

55
from abc import abstractmethod
66

7+
from datadog_checks.base.utils.db.utils import TagManager
8+
79
from . import AgentCheck
810

911

1012
class DatabaseCheck(AgentCheck):
13+
def __init__(self, *args, **kwargs):
14+
super().__init__(*args, **kwargs)
15+
self.tag_manager = TagManager()
16+
1117
def database_monitoring_query_sample(self, raw_event: str):
1218
self.event_platform_event(raw_event, "dbm-samples")
1319

@@ -43,9 +49,8 @@ def dbms_version(self) -> str:
4349
pass
4450

4551
@property
46-
@abstractmethod
4752
def tags(self) -> list[str]:
48-
pass
53+
return self.tag_manager.get_tags()
4954

5055
@property
5156
@abstractmethod

0 commit comments

Comments
 (0)