diff --git a/logstash-core/lib/logstash/instrument/metric.rb b/logstash-core/lib/logstash/instrument/metric.rb index 601c7b0ed..e6e12262a 100644 --- a/logstash-core/lib/logstash/instrument/metric.rb +++ b/logstash-core/lib/logstash/instrument/metric.rb @@ -13,7 +13,7 @@ module LogStash module Instrument class Metric attr_reader :collector - def initialize(collector = LogStash::Instrument::Collector.instance) + def initialize(collector) @collector = collector end diff --git a/logstash-core/spec/logstash/instrument/collector_spec.rb b/logstash-core/spec/logstash/instrument/collector_spec.rb index b96be4a5e..2a9979d0c 100644 --- a/logstash-core/spec/logstash/instrument/collector_spec.rb +++ b/logstash-core/spec/logstash/instrument/collector_spec.rb @@ -3,7 +3,7 @@ require "logstash/instrument/collector" require "spec_helper" describe LogStash::Instrument::Collector do - subject { LogStash::Instrument::Collector.instance } + subject { LogStash::Instrument::Collector.new } describe "#push" do let(:namespaces_path) { [:root, :pipelines, :pipelines01] } let(:key) { :my_key }