Skip to content

[DBMON-6784] Fix Clickhouse database_hostname usage#24247

Merged
eric-weaver merged 3 commits into
masterfrom
eric.weaver/DBMON-6784
Jun 29, 2026
Merged

[DBMON-6784] Fix Clickhouse database_hostname usage#24247
eric-weaver merged 3 commits into
masterfrom
eric.weaver/DBMON-6784

Conversation

@eric-weaver

@eric-weaver eric-weaver commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a dedicated database_hostname property to the ClickHouse check and uses it for the database_hostname tag and the database-instance metadata, instead of reusing reported_hostname.

The new property always resolves the underlying database host via resolve_db_host(server), independent of the reported_hostname config override, and is cached. This mirrors the database_hostname convention already implemented in the Postgres, MySQL, and SQL Server integrations.

Changes:

  • Add cached database_hostname property (initialized in __init__).
  • Source the database_hostname core tag (_add_core_tags) and the database_hostname metadata field (_send_database_instance_metadata) from self.database_hostname rather than self.reported_hostname.
  • Update unit tests to assert against check.database_hostname.

Motivation

ClickHouse conflated database_hostname with reported_hostname. When a user set the reported_hostname config override, the database_hostname tag and metadata incorrectly became that override value instead of the true resolved host. database_hostname is meant to be a stable identifier of the underlying DB host used to correlate DBM data, so this broke correlation and diverged from the behavior of the other DBM integrations.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

@eric-weaver eric-weaver marked this pull request as ready for review June 29, 2026 16:46
@eric-weaver eric-weaver requested review from a team as code owners June 29, 2026 16:46
@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Jun 29, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 03e5995 | Docs | Datadog PR Page | Give us feedback!

@eric-weaver eric-weaver added the qa/skip-qa Automatically skip this PR for the next QA label Jun 29, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Validation Report

All 21 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

@eric-weaver eric-weaver added this pull request to the merge queue Jun 29, 2026
Merged via the queue into master with commit 968e439 Jun 29, 2026
56 of 57 checks passed
@eric-weaver eric-weaver deleted the eric.weaver/DBMON-6784 branch June 29, 2026 17:31
@dd-octo-sts dd-octo-sts Bot added this to the 7.82.0 milestone Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants