diff --git a/.ruby-version b/.ruby-version index ca6ace5..5d83b41 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -jruby-1.7.20 +jruby-1.7.27 diff --git a/lib/logstash/outputs/dogstatsd.rb b/lib/logstash/outputs/dogstatsd.rb index 5f42e57..dbc8ad8 100644 --- a/lib/logstash/outputs/dogstatsd.rb +++ b/lib/logstash/outputs/dogstatsd.rb @@ -1,16 +1,7 @@ # encoding: utf-8 require "logstash/outputs/base" require "logstash/namespace" - -# This is a hack to load the dogstatsd-ruby gem's statsd.rb file into a -# namespace so as to not clobber the top-level Statsd provided by the -# much-more-popular Statsd gem. The problem is that both gems have a file named -# 'statsd.rb' that you are supposed to load. Why did Datadog not name their file -# differently? Who knows! -# (see: https://github.com/DataDog/dogstatsd-ruby/pull/3) -module Datadog - module_eval(File.read(Gem.find_files('**/statsd.rb').grep(/dogstatsd/).first)) -end +require "datadog/statsd" # dogstatsd is a fork of the statsd protocol which aggregates statistics, such # as counters and timers, and ships them over UDP to the dogstatsd-server diff --git a/logstash-output-dogstatsd.gemspec b/logstash-output-dogstatsd.gemspec index 0ba3d0f..1c368d1 100644 --- a/logstash-output-dogstatsd.gemspec +++ b/logstash-output-dogstatsd.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'logstash-output-dogstatsd' - s.version = '2.0.0' + s.version = '5.0.0' s.licenses = ['Apache License (2.0)'] s.summary = "Send metrics to StatsD" s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program" @@ -20,12 +20,10 @@ Gem::Specification.new do |s| s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" } # Gem dependencies - s.add_runtime_dependency "logstash-core", ">= 2.0.0.beta2", "< 3.0.0" + s.add_runtime_dependency "logstash-core", "~> 5.0" s.add_runtime_dependency 'logstash-input-generator' - # This version is pinned exactly to ensure that upgrades don't break the - # gnarly `module_eval` hack in lib/logstash/outputs/dogstatsd.rb. - s.add_runtime_dependency 'dogstatsd-ruby', '= 1.6' + s.add_runtime_dependency 'dogstatsd-ruby', '~> 3.0' s.add_development_dependency 'logstash-devutils' s.add_development_dependency 'overcommit' diff --git a/spec/outputs/dogstatsd_spec.rb b/spec/outputs/dogstatsd_spec.rb index a67cc0e..0932099 100644 --- a/spec/outputs/dogstatsd_spec.rb +++ b/spec/outputs/dogstatsd_spec.rb @@ -1,5 +1,4 @@ # encoding: utf-8 -require 'logstash/outputs/dogstatsd' require_relative '../spec_helper' describe LogStash::Outputs::Dogstatsd do