Skip to content

ClusterCheck: The empty_default_hostname option has no effect in the Postgres check. #22161

@dimke931

Description

@dimke931

I am using the latest agent version 7.73.1, and in cluster checks I see the following warning:

2025-12-17 18:48:54 UTC | CORE | WARN | (pkg/collector/python/datadog_agent.go:145 in LogMessage) | unknown | (postgres.py:136) | The empty_default_hostname option has no effect in the Postgres check. Use the exclude_hostname option instead.

I cannot find where this parameter is configured explicitly.
After investigation, I found that it seems to be injected by the Cluster Checks code here

When I run agent configcheck postgres -v, I see empty_default_hostname: true in the generated configuration:

agent configcheck postgres -v
heck_name: postgres
init_config: {}
instances:
- custom_queries:
  - columns:
    - name: blocked_query
      type: gauge
    metric_prefix: postgresql
    query: my_query
  - columns:
    - name: corrupted_index
      type: gauge
    - name: database_name
      type: tag
    - name: index_name
      type: tag
    metric_prefix: postgresql
    query: my_query
  dbname: DBNAME
  dbstrict: "true"
  empty_default_hostname: true
  host: DBHOST
  password: '********'
  port: "5432"
  query_timeout: "1000"
  relations:
  - relation_regex: .*
  tags:
  - tag:tag
  username: datadog
logs_config: null

My understanding is that this parameter is automatically added by the Cluster Agent for cluster checks, but the Postgres integration does not support it and logs a warning instead.

Could you please confirm whether this is expected behavior or a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions