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

Support configuring the client from environment variables #15

Closed
ahmed-mez opened this issue Mar 20, 2019 · 3 comments · Fixed by #17
Closed

Support configuring the client from environment variables #15

ahmed-mez opened this issue Mar 20, 2019 · 3 comments · Fixed by #17

Comments

@ahmed-mez
Copy link

ahmed-mez commented Mar 20, 2019

All of the official Datadog dogstatsd clients can now be configured via standard environment variables. As the maintainer of the closure dogstatsd library, could you port the same functionality to this client? We would prefer that configuration be consistent across client libraries.

Sample changes from the Go implementation can be found here: DataDog/datadog-go#78

Let me know if you have any questions about the code or the feature more generally.

Thanks,

Ahmed

@rymndhng
Copy link
Contributor

rymndhng commented May 2, 2019

Hey, sorry for the slow reply! I only noticed I had missed this email.

Yes, that's very doable. One thing to note is that this library is a wrapper over /~https://github.com/DataDog/java-dogstatsd-client. It looks like the latest release of the java client is 2.7, which does not yet support the env vars.

I'd prefer to put explicit support/test/documentation in this library after the Java client is updated -- this gives us an option to use the resolution strategy from the underlying library instead of duplicating functionality.

@hden
Copy link

hden commented Jun 20, 2019

It does now.
/~https://github.com/DataDog/java-dogstatsd-client/releases/tag/v2.8

rymndhng pushed a commit that referenced this issue Jun 28, 2019
The underlying library supports using the envvars DD_AGENT_HOST, DD_DOGSTATSD_PORT and DD_ENTITY_ID to configure the client.

The change in this PR removes the "custom" configuration in this library so that we defer all contextual setup to the underlying library. This slightly alters the default behaviour by requiring consumers to set the host explicity (through envvars or the host option).

Closes #15
@rymndhng
Copy link
Contributor

Thanks for the heads up! 0.6.0 supports this now!

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 a pull request may close this issue.

3 participants