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

datadog/client.NewClientWith swallows errors #97

Open
shawnHartsell opened this issue Dec 14, 2018 · 2 comments
Open

datadog/client.NewClientWith swallows errors #97

shawnHartsell opened this issue Dec 14, 2018 · 2 comments

Comments

@shawnHartsell
Copy link

shawnHartsell commented Dec 14, 2018

When constructing a new DataDog client with this method, I noticed that if the call to dial fails the error is only logged. Returning the error would let callers take specific actions during their application's initialization.

I realize this proposal is a breaking change; if you all think this is a good idea I would be willing to create the patch!

@achille-roussel
Copy link
Contributor

For context, this has never really been an issue because it's pretty easy to spot when metrics just don't work.

If this is a feature you need we can introduce a new function that constructs the client but also returns any error that it would observe (NewClientWithError?), I don't think we have to make it a breaking change.

What do you think?

@shawnHartsell
Copy link
Author

Makes sense, and yes, something like NewClientWithError would work.

Specifically, I'm instrumenting a business critical service and want to have the option to not spin it up if initialization fails (e.g. bad addr, an internal error making the sys calls, etc)

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

No branches or pull requests

2 participants