telegraf 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1992e9545cbbf54646dec6c4830190258a5756d1c536b71a42378ca5c7717eed
4
- data.tar.gz: 6e00f1a167a6ac9663903623317fe1d896b882feb5d866eb52385da54603ed09
3
+ metadata.gz: 132cb999b16a37b5dbb280da213c44c1a227165c0f28a4dcb568a42c6d149033
4
+ data.tar.gz: 511605f1d7ed94572d4cce1431cc7c48c82b502154d19a1de63ec098b026c177
5
5
  SHA512:
6
- metadata.gz: 949c16ce2e986feef4362d1060290b64efd01ed08a08222129a59577f22c3a4d643dc80324ede1f27f10dee63fcf0519f4c3386547c67c435418e68634644627
7
- data.tar.gz: 8eafa264491cff6861f7b346e3548bf51ef5b570f2779a7b3d31e02dc62c2d8c011c9eeaeda6fc6b0e64ff79fba7ccb839615bb43101fa73f0d177600e18f216
6
+ metadata.gz: 570b4cafae14dab8ed1d43072366c4df5a4e2ea37862e3643ebd96cc7f556f7a644c9aa60afb2ce7e3b00d1ec8bee78cd8c525390bcd30d64c310ac79769410e
7
+ data.tar.gz: f595be285d5edaf4c84ba6ed97be15f6097ba747ea493f6f4fef5f15fa604f9a44392b7794c979da06751df081599cd06b3aee5ec54d328c0067e80e4e1320a2
@@ -1,5 +1,4 @@
1
- name: Lint
2
- on: [push]
1
+ on: [push, pull_request]
3
2
  jobs:
4
3
  rubocop:
5
4
  name: rubocop
@@ -14,7 +13,7 @@ jobs:
14
13
  - uses: actions/checkout@master
15
14
  - uses: ruby/setup-ruby@v1
16
15
  with:
17
- ruby-version: 2.7
16
+ ruby-version: 3.0
18
17
  bundler-cache: true
19
18
 
20
19
  - run: bundle exec rubocop --parallel --color
@@ -1,5 +1,4 @@
1
- name: Test
2
- on: [push]
1
+ on: [push, pull_request]
3
2
  jobs:
4
3
  test:
5
4
  name: Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }}
@@ -8,6 +7,7 @@ jobs:
8
7
  strategy:
9
8
  matrix:
10
9
  ruby:
10
+ - '3.0'
11
11
  - '2.7'
12
12
  - '2.6'
13
13
  - '2.5'
@@ -18,6 +18,9 @@ jobs:
18
18
  - rack_2.0.gemfile
19
19
  - rack_2.1.gemfile
20
20
  - rack_2.2.gemfile
21
+ exclude:
22
+ - ruby: '3.0'
23
+ gemfile: rails_5.2.gemfile
21
24
  fail-fast: false
22
25
 
23
26
  env:
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.0.0] - 2021-09-30
10
+ ### Changed
11
+ - The sidekiq middleware does not use keyword arguments as sidekiq does not handle them correctly on Ruby 3.0 (#14)
12
+
9
13
  ## [1.0.0] - 2021-01-26
10
14
  ### Added
11
15
  - Global tags (#6)
@@ -30,7 +34,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
30
34
  ### Changed
31
35
  - Remove `influxdb` not unnecessarily restrict users needing a specific influxdb client.
32
36
 
33
- [Unreleased]: https://github.com/jgraichen/telegraf-ruby/compare/v1.0.0...HEAD
37
+ [Unreleased]: https://github.com/jgraichen/telegraf-ruby/compare/v2.0.0...HEAD
38
+ [2.0.0]: https://github.com/jgraichen/telegraf-ruby/compare/v1.0.0...v2.0.0
34
39
  [1.0.0]: https://github.com/jgraichen/telegraf-ruby/compare/v0.8.0...v1.0.0
35
40
  [0.8.0]: https://github.com/jgraichen/telegraf-ruby/compare/v0.7.0...v0.8.0
36
41
  [0.7.0]: https://github.com/jgraichen/telegraf-ruby/compare/v0.6.1...v0.7.0
data/README.md CHANGED
@@ -78,7 +78,7 @@ require "telegraf/rails"
78
78
 
79
79
  class MyApplication > ::Rails::Application
80
80
  # Configure receiver
81
- config.telegraf.connect = "udp://localhost:9084"
81
+ config.telegraf.connect = "udp://localhost:8094"
82
82
 
83
83
  # Global tags added to all events. These will override
84
84
  # any local tag with the same name.
@@ -125,7 +125,7 @@ require "telegraf/active_job"
125
125
  agent = ::Telegraf::Agent.new
126
126
  ActiveSupport::Notifications.subscribe(
127
127
  'perform.active_job',
128
- Telegraf::ActiveJob.new(agent: agent, series: 'background', tags: {global: 'tag'})
128
+ Telegraf::ActiveJob.new(agent: agent, series: 'active_job', tags: {global: 'tag'})
129
129
  )
130
130
  ```
131
131
 
@@ -139,7 +139,7 @@ require "telegraf/sidekiq"
139
139
  agent = ::Telegraf::Agent.new
140
140
  Sidekiq.configure_server do |config|
141
141
  config.server_middleware do |chain|
142
- chain.add ::Telegraf::Sidekiq::Middleware, agent: agent, series: 'background', tags: {global: 'tag'}
142
+ chain.add ::Telegraf::Sidekiq::Middleware, agent: agent, series: 'sidekiq', tags: {global: 'tag'}
143
143
  end
144
144
  end
145
145
  ```
@@ -70,12 +70,11 @@ module Telegraf
70
70
  config.telegraf.sidekiq.tags = {}
71
71
 
72
72
  initializer 'telegraf.agent' do |app|
73
- app.config.telegraf.agent ||= begin
73
+ app.config.telegraf.agent ||= \
74
74
  ::Telegraf::Agent.new \
75
75
  app.config.telegraf.connect,
76
76
  logger: Rails.logger,
77
77
  tags: app.config.telegraf.tags
78
- end
79
78
  end
80
79
 
81
80
  initializer 'telegraf.rack' do |app|
@@ -127,9 +126,11 @@ module Telegraf
127
126
  ::Sidekiq.configure_server do |config|
128
127
  config.server_middleware do |chain|
129
128
  chain.add Telegraf::Sidekiq::Middleware, \
130
- agent: app.config.telegraf.agent,
131
- series: app.config.telegraf.sidekiq.series,
132
- tags: app.config.telegraf.sidekiq.tags
129
+ app.config.telegraf.agent,
130
+ {
131
+ series: app.config.telegraf.sidekiq.series,
132
+ tags: app.config.telegraf.sidekiq.tags
133
+ }
133
134
  end
134
135
  end
135
136
  end
@@ -37,10 +37,10 @@ module Telegraf
37
37
  # Only present for "normal" (async) jobs (with tag `type` of "job").
38
38
  #
39
39
  class Middleware
40
- def initialize(agent:, series: 'sidekiq', tags: {})
40
+ def initialize(agent, options = {})
41
41
  @agent = agent
42
- @series = series.to_s.freeze
43
- @tags = tags.freeze
42
+ @series = options.fetch(:series, 'sidekiq').to_str.freeze
43
+ @tags = options.fetch(:tags, {}).to_hash.freeze
44
44
  end
45
45
 
46
46
  def call(worker, job, queue)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Telegraf
4
4
  module VERSION
5
- MAJOR = 1
5
+ MAJOR = 2
6
6
  MINOR = 0
7
7
  PATCH = 0
8
8
  STAGE = nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegraf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-26 00:00:00.000000000 Z
11
+ date: 2021-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: influxdb
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  requirements: []
96
- rubygems_version: 3.2.4
96
+ rubygems_version: 3.2.22
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: Metric Reporter to local telegraf agent