Skip to content

Commit

Permalink
Merge pull request #3 from savelandr/feature/logstash_5
Browse files Browse the repository at this point in the history
Feature/logstash 5
  • Loading branch information
tdooner authored Nov 8, 2017
2 parents fa9ffb9 + 7839921 commit 8b8707c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
jruby-1.7.20
jruby-1.7.27
11 changes: 1 addition & 10 deletions lib/logstash/outputs/dogstatsd.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 3 additions & 5 deletions logstash-output-dogstatsd.gemspec
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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'
Expand Down
1 change: 0 additions & 1 deletion spec/outputs/dogstatsd_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# encoding: utf-8
require 'logstash/outputs/dogstatsd'
require_relative '../spec_helper'

describe LogStash::Outputs::Dogstatsd do
Expand Down

0 comments on commit 8b8707c

Please sign in to comment.