Skip to content

fix: preserve unix DogStatsD URLs in Gunicorn config - #555

Open
hshree-cs wants to merge 2 commits into
mainfrom
GSRE3388
Open

fix: preserve unix DogStatsD URLs in Gunicorn config#555
hshree-cs wants to merge 2 commits into
mainfrom
GSRE3388

Conversation

@hshree-cs

Copy link
Copy Markdown
Contributor

Finishes GSRE-3388

Updates Gunicorn StatsD configuration to preserve unix:// DogStatsD URLs.This prevents invalid socket configuration when DD_DOGSTATSD_URL is set to a Unix socket path and should resolve StatsD transport errors caused by the previous parsing logic

Merge checklist:
Check off if complete or not applicable:

  • Documentation updated (not only docstrings)
  • Fixup commits are squashed away
  • Unit tests added/updated
  • Manual testing instructions provided
  • Noted any: Concerns, dependencies, migration issues, deadlines, tickets

Post-merge:

@hshree-cs
hshree-cs requested a review from a team as a code owner July 31, 2026 14:50
Copilot AI review requested due to automatic review settings July 31, 2026 14:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Gunicorn configuration used by commerce-coordinator to better handle Datadog DogStatsD endpoint configuration, specifically preserving unix://... URLs when DD_DOGSTATSD_URL points at a Unix domain socket.

Changes:

  • Adds explicit handling for DD_DOGSTATSD_URL values starting with unix:// so the socket URL is passed through as-is.
  • Retains existing behavior for udp://... endpoints by stripping the scheme to match Gunicorn’s expected HOST:PORT format.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread commerce_coordinator/docker_gunicorn_configuration.py
@github-actions

Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

Copilot AI review requested due to automatic review settings July 31, 2026 15:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

commerce_coordinator/docker_gunicorn_configuration.py:21

  • The unix-socket branch only treats the exact string "unix://" as invalid, but values like "unix:///" (no path) or "unix://path" (missing the third slash) would still be forwarded to Gunicorn even though the comment says the expected form is "unix:///path". Consider normalizing/validating the URL so you only set statsd_host when a non-empty socket path is present, and rewrite "unix://" to "unix:///" for consistency.
    if _dogstatsd_url.startswith("unix://"):
        # Gunicorn accepts unix socket directly as "unix:///path".
        _statsd_host = _dogstatsd_url if _dogstatsd_url != "unix://" else ""
    else:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants