Skip to content

Commit 9ce82a8

Browse files
authored
Fix health event tags in Postgres (DataDog#21764)
* Fix health event tags in Postgres * Changelog
1 parent 398f37f commit 9ce82a8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

postgres/changelog.d/21764.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix handling health event tags in Postgres to allow for additional tags as an argument.

postgres/datadog_checks/postgres/health.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def submit_health_event(
3737
self,
3838
name: HealthEvent | PostgresHealthEvent,
3939
status: HealthStatus,
40-
data: dict,
40+
tags: list[str] = None,
41+
data: dict = None,
4142
**kwargs,
4243
):
4344
"""
@@ -53,7 +54,7 @@ def submit_health_event(
5354
name=name,
5455
status=status,
5556
# If we have an error parsing the config we may not have tags yet
56-
tags=self.check.tags if hasattr(self.check, 'tags') else [],
57+
tags=(self.check.tags if hasattr(self.check, 'tags') else []) + (tags or []),
5758
data={
5859
"database_instance": self.check.database_identifier,
5960
"ddagenthostname": self.check.agent_hostname,

0 commit comments

Comments
 (0)