Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check environment variables for host and port #17

Closed
wants to merge 2 commits into from

Conversation

bergos
Copy link

@bergos bergos commented Mar 1, 2018

Uses the environment variables DOGSTATSD_HOSTNAME and DOGSTATSD_PORT for host and port if set. These variables were defined by DataDog in this issue.

Copy link
Owner

@mrbar42 mrbar42 left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!
left a small note

this.host = host || "localhost";
this.port = port || 8125;
this.host = host || process.env.DOGSTATSD_HOSTNAME || "localhost";
this.port = port || process.env.DOGSTATSD_PORT || 8125;
Copy link
Owner

Choose a reason for hiding this comment

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

maybe it's worth converting this to a number

this.port = port || Number(process.env.DOGSTATSD_PORT) || 8125;

@bergos bergos closed this Feb 3, 2020
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