Closed DmitriiRus37 closed 9 months ago
I have a peace of confuguration like this in setup.rb:
setup.rb
require 'telegraf' require 'telegraf/sidekiq' Sidekiq.configure_server do |config| config.logger = $log agent = ::Telegraf::Agent.new "udp://#{my_host}:#{my_port}" config.server_middleware do |chain| chain.add Telegraf::Sidekiq::Middleware, agent: agent, series: 'my_series', tags: { application: 'my_app' } end end
and I receive:
2024-02-05T20:00:43+03:00 WARN NoMethodError: undefined method `write' for {:agent=>#<Telegraf::Agent:0x00007fb03962b128 @uri=#<URI::Generic udp://*host*:*port*>, @tags={}, @logger=nil>, :series=>"my_series", :tags=>{:application=>"my_app"}}:Hash
I can't found out what is wrong here. What did I miss?
ruby 3.2.2 telegraf 2.1.1 sidekiq 7.2.1
agent isn't a keyword argument.
agent
Try this:
chain.add Telegraf::Sidekiq::Middleware, agent, series: 'my_series', tags: { application: 'my_app' }
I have a peace of confuguration like this in
setup.rb
:and I receive:
I can't found out what is wrong here. What did I miss?
ruby 3.2.2 telegraf 2.1.1 sidekiq 7.2.1