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

Add unix socket support #61

Merged
merged 8 commits into from
Nov 14, 2017
Merged

Add unix socket support #61

merged 8 commits into from
Nov 14, 2017

Conversation

sullerandras
Copy link
Contributor

@sullerandras sullerandras commented Nov 2, 2017

Continuation of #55
To test it locally i installed the new datadog agent to my Mac following the instructions here then used a simple ruby script like this:

require './lib/datadog/statsd'
require 'time'
STDOUT.sync = true

socket_file = ENV['DD_DOGSTATSD_SOCKET'] || '/tmp/socket/statsd.socket'
puts "========> socket_file: #{socket_file}"

client = Datadog::Statsd.new(nil, nil, socket_path: socket_file)

loop do
  client.increment('whatever')
  sleep(1)
end

I tried all scenarios listed in the testing guide and it worked.

degemer and others added 3 commits July 12, 2017 14:36
Since our new dogstasd server is able to listen to a UNIX socket.
As otherwise the call is blocking
@sullerandras
Copy link
Contributor Author

Ruby 1.9 seems to fail because of this error.
Ruby 2.1 errors are strange. It works with older bundler <= 1.11.2 and seems to fail with any newer bundler.

@xvello
Copy link

xvello commented Nov 3, 2017

hi @sullerandras , thanks a lot for your contribution!

I'm tagging the library maintainers to help figure out how to fix the tests.
@degemer @yannmh could you please have a look?

@xvello
Copy link

xvello commented Nov 8, 2017

hi @sullerandras,

Could you please rebase on master, as tests are fixed now?

Regards

@masci masci added this to the 3.1.0 milestone Nov 8, 2017
@masci
Copy link
Contributor

masci commented Nov 13, 2017

@sullerandras tried to make tests on 2.1.10 pass with no success, do you have any idea what that could be? I think we can drop tests on jruby1.9 but 2.1 seems to work despite the tests :(

This should solve the issue with Ruby 2.1 which comes with Minitest 4.7.5 default gem
but we want to use Minitest 5.
@sullerandras
Copy link
Contributor Author

@masci It seems like MRI Ruby 2.1 comes with an embedded minitest 4.7.5 and rake uses that for running the specs. Minitest 5 is installed by bundler but it is not used.

so rake does not add /Users/andras/.rvm/rubies/ruby-2.1.10/lib/ruby/2.1.0 to the beginning of $LOAD_PATH which forces to use Minitest 4.7.5.
This should solve the problem with running the specs on Ruby 2.1
@sullerandras
Copy link
Contributor Author

@masci Changed to :direct loader and now it works with Ruby 2.1, but jruby still fails. Unfortunately i had to specify the spec file name so need to update this when adding more spec files.

@masci
Copy link
Contributor

masci commented Nov 14, 2017

@sullerandras awesome, thanks! I think this is a good tradeoff for keeping 2.1 tests around.
Can you remove jruby from the CI? Not sure why we still keep it there....

Copy link
Contributor

@masci masci left a comment

Choose a reason for hiding this comment

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

🎉

@masci masci merged commit ca6ced5 into DataDog:master Nov 14, 2017
abicky added a commit to abicky/ruby-kafka that referenced this pull request May 10, 2020
dogstatsd-ruby has supported Unix domain socket.
cf. DataDog/dogstatsd-ruby#61
abicky added a commit to abicky/ruby-kafka that referenced this pull request May 10, 2020
dogstatsd-ruby has supported Unix domain socket.
cf. DataDog/dogstatsd-ruby#61
abicky added a commit to abicky/ruby-kafka that referenced this pull request May 10, 2020
dogstatsd-ruby has supported Unix domain socket.
cf. DataDog/dogstatsd-ruby#61
abicky added a commit to abicky/ruby-kafka that referenced this pull request May 10, 2020
dogstatsd-ruby has supported Unix domain socket.
cf. DataDog/dogstatsd-ruby#61
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.

None yet

4 participants