Skip to content

Conversation

@lovasoa
Copy link

@lovasoa lovasoa commented Dec 19, 2025

Update example configuration for Unix socket path.

What does this PR do?

Fixes the suggested postgres socket path

Motivation

The currently suggested path results in

    postgres (23.2.0)
    -----------------
      Instance ID: postgres:e3271050cd12e4fc [ERROR]
      Configuration Source: file:/etc/datadog-agent/conf.d/postgres.d/conf.yaml[0]
      Total Runs: 1
      Metric Samples: Last Run: 0, Total: 0
      Events: Last Run: 0, Total: 0
      Service Checks: Last Run: 0, Total: 0
      Average Execution Time : 17ms
      Last Execution Date : 2025-12-19 14:33:08.13 UTC (1766154788130)
      Last Successful Execution Date : Never
      metadata:
        config.source: /etc/datadog-agent/conf.d/postgres.d/conf.yaml[0]
        resolved_hostname: frankfurt
      Error: connection is bad: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432/.s.PGSQL.5432" failed: Not a directory
        Is the server running locally and accepting connections on that socket?
      Traceback (most recent call last):
        File "/opt/datadog-agent/embedded/lib/python3.13/site-packages/datadog_checks/base/checks/base.py", line 1299, in run
          self.run_check_initializations()
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
        File "/opt/datadog-agent/embedded/lib/python3.13/site-packages/datadog_checks/base/checks/base.py", line 1343, in run_check_initializations
          initialization()
          ~~~~~~~~~~~~~~^^
        File "/opt/datadog-agent/embedded/lib/python3.13/site-packages/datadog_checks/postgres/postgres.py", line 988, in _connect
          with self.db() as conn:
               ~~~~~~~^^
        File "/opt/datadog-agent/embedded/lib/python3.13/contextlib.py", line 141, in __enter__
          return next(self.gen)
        File "/opt/datadog-agent/embedded/lib/python3.13/site-packages/datadog_checks/postgres/postgres.py", line 294, in db
          self._db = self._new_connection(self._config.dbname)
                     ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
        File "/opt/datadog-agent/embedded/lib/python3.13/site-packages/datadog_checks/postgres/postgres.py", line 978, in _new_connection
          conn = TokenAwareConnection.connect(**kwargs)
        File "/opt/datadog-agent/embedded/lib/python3.13/site-packages/datadog_checks/postgres/connection_pool.py", line 111, in connect
          return super().connect(*args, **kwargs)
                 ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
        File "/opt/datadog-agent/embedded/lib/python3.13/site-packages/psycopg/connection.py", line 120, in connect
          raise last_ex.with_traceback(None)
      psycopg.OperationalError: connection is bad: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432/.s.PGSQL.5432" failed: Not a directory
        Is the server running locally and accepting connections on that socket?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • 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

Update example configuration for Unix socket path.
@github-actions
Copy link

⚠️ Major version bump
The changelog type changed or removed was used in this Pull Request, so the next release will bump major version. Please make sure this is a breaking change, or use the fixed or added type instead.

@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.35%. Comparing base (eebd0e7) to head (eb8dca0).
⚠️ Report is 27 commits behind head on master.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sethsamuel
Copy link
Contributor

@lovasoa Thanks for the contribution! Could you please update the changelog to a fixed?

@lovasoa lovasoa enabled auto-merge December 29, 2025 14:51
@lovasoa
Copy link
Author

lovasoa commented Dec 29, 2025

@sethsamuel done :)

@lovasoa
Copy link
Author

lovasoa commented Dec 30, 2025

the failed tests do not seem related to the contents of the pr

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