Skip to content

statsd_prefix ignored from non-cli option config #382

Open

Description

@wp-pelleys

statsd_prefix can only be set via the command line and does not work if set within hypercorn_config.py. Tested on version 0.18.0 (haven't tested on main but I think I see the cause and it's not fixed).

In src/hypercorn/__main__.py at line

parser.add_argument("--statsd-prefix", help="Prefix for all statsd messages", default="")
the argparse.ArgumentParser has default="". This is the only non-list arg to have a non-sentinel default, and later at
if args.statsd_prefix is not sentinel:
it is checked against sentinel but can never have been set to it.

Fix is to change the arg's default from "" to sentinel.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions