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

Bump minimum dogstatsd-ruby 5 version accepted to 5.3 #1717

Merged
merged 1 commit into from Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/GettingStarted.md
Expand Up @@ -2461,7 +2461,7 @@ The tracer and its integrations can produce some additional metrics that can pro
To configure your application for metrics collection:

1. [Configure your Datadog agent for StatsD](https://docs.datadoghq.com/developers/dogstatsd/#setup)
2. Add `gem 'dogstatsd-ruby', '~> 5.2'` to your Gemfile
2. Add `gem 'dogstatsd-ruby', '~> 5.3'` to your Gemfile

#### For application runtime

Expand Down
4 changes: 2 additions & 2 deletions lib/ddtrace/metrics.rb
Expand Up @@ -31,7 +31,7 @@ def supported?
!version.nil? && version >= Gem::Version.new('3.3.0') &&
# dogstatsd-ruby >= 5.0 & < 5.2.0 has known issues with process forks
# and do not support the single thread mode we use to avoid this problem.
!(version >= Gem::Version.new('5.0') && version < Gem::Version.new('5.2'))
!(version >= Gem::Version.new('5.0') && version < Gem::Version.new('5.3'))
end

def enabled?
Expand Down Expand Up @@ -274,7 +274,7 @@ def ignored_statsd_warning
IGNORED_STATSD_ONLY_ONCE.run do
Datadog.logger.warn(
'Ignoring user-supplied statsd instance as currently-installed version of dogstastd-ruby is incompatible. ' \
"To fix this, ensure that you have `gem 'dogstatsd-ruby', '~> 5.2'` on your Gemfile or gems.rb file."
"To fix this, ensure that you have `gem 'dogstatsd-ruby', '~> 5.3'` on your Gemfile or gems.rb file."
)
end
end
Expand Down
12 changes: 6 additions & 6 deletions spec/ddtrace/metrics_spec.rb
Expand Up @@ -121,13 +121,13 @@
end

context 'with incompatible 5.x version' do
let(:version) { Gem::Version.new('5.0.0') }
let(:version) { Gem::Version.new('5.2.0') }

it { is_expected.to be false }
end

context 'with compatible 5.x version' do
let(:version) { Gem::Version.new('5.2.0') }
let(:version) { Gem::Version.new('5.3.0') }

it { is_expected.to be true }
end
Expand All @@ -153,13 +153,13 @@
end

context 'with incompatible 5.x version' do
let(:gem_version_number) { '5.0.0' }
let(:gem_version_number) { '5.2.0' }

it { is_expected.to be false }
end

context 'with compatible 5.x version' do
let(:gem_version_number) { '5.2.0' }
let(:gem_version_number) { '5.3.0' }

it { is_expected.to be true }
end
Expand Down Expand Up @@ -272,8 +272,8 @@

let(:statsd_client) { instance_double(Datadog::Statsd) }
let(:options) do
# This tests is run with both ~> 4.0 and latest dogstatsd-ruby.
if Gem::Version.new(Datadog::Statsd::VERSION) >= Gem::Version.new('5.2.0')
# This test is run with both ~> 4.0 and latest dogstatsd-ruby.
if Gem::Version.new(Datadog::Statsd::VERSION) >= Gem::Version.new('5.3.0')
{ single_thread: true }
else
{}
Expand Down