Skip to content

Avoid overwriting AWS cloud_metadata #20774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions postgres/changelog.d/20774.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug where the AWS configuration was overwritten for the Postgres integration
5 changes: 2 additions & 3 deletions postgres/datadog_checks/postgres/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,8 @@ def set_resource_tags(self):
# allow for detecting if the host is an RDS host, and emit
# the resource properly even if the `aws` config is unset
self.tags.append("dd.internal.resource:aws_rds_instance:{}".format(self.resolved_hostname))
self.cloud_metadata["aws"] = {
"instance_endpoint": self.resolved_hostname,
}
self.cloud_metadata["aws"] = self.cloud_metadata.get("aws", {})
self.cloud_metadata["aws"]["instance_endpoint"] = self.resolved_hostname
if self.cloud_metadata.get("azure") is not None:
deployment_type = self.cloud_metadata.get("azure")["deployment_type"]
# some `deployment_type`s map to multiple `resource_type`s
Expand Down
2 changes: 1 addition & 1 deletion postgres/tests/test_pg_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ def test_wal_stats(aggregator, integration_check, pg_instance, is_aurora):
cur.execute("insert into persons (lastname) values ('test');")

# Wait for pg_stat_wal to be updated
for _ in range(10):
for _ in range(50):
with conn.cursor() as cur:
cur.execute("select wal_records, wal_bytes from pg_stat_wal;")
new_wal_records = cur.fetchall()[0][0]
Expand Down
Loading