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

Output on console #33

Closed
davidebettio opened this issue Sep 2, 2016 · 4 comments
Closed

Output on console #33

davidebettio opened this issue Sep 2, 2016 · 4 comments

Comments

@davidebettio
Copy link

With versions 2.2.0 every time is there a call to:

DogStatsd.Counter

in console I see these strings:

Command length 25
MaxUDP size 512
@yannmh
Copy link
Member

yannmh commented Sep 2, 2016

Thanks for reporting @davidebettio,

Could you confirm that this was not the case prior to the 2.2.0 version please?

@davidebettio
Copy link
Author

davidebettio commented Sep 2, 2016

Yes, prior to the version 2.2.0 all is ok.

@Friss
Copy link

Friss commented Sep 4, 2016

I'm seeing the same thing in my console but with Histogram and Gauge Version 2.1.1 does not have the same effect

@albertofem
Copy link
Contributor

albertofem commented Oct 11, 2016

I think I found the issue. The Release code is compiled using the "TRACE" define:

https://github.com/DataDog/dogstatsd-csharp-client/blob/master/src/StatsdClient/StatsdClient.csproj#L30

This is telling the low level socket library to output trace information, specifically in the method "SendTo" (https://github.com/DataDog/dogstatsd-csharp-client/blob/master/src/StatsdClient/StatsdUDP.cs#L86) as per the following documentation:

https://msdn.microsoft.com/en-us/library/eae4f5y0(v=vs.110).aspx

This member outputs trace information when you enable network tracing in your application. For more information, see Network Tracing in the .NET Framework.

If you read the documentation, you can see how setting the TRACE constant will enable the tracing:

https://msdn.microsoft.com/en-us/library/64yxa344(v=vs.110).aspx

The solution is easy enough: remove the "TRACE" from Release builds. I made a PR: #34

I tried the solution by compiling without the trace and linking against my program and it works, no more trace info is being output.

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

4 participants