fluent-plugin-node-exporter-metrics 0.2.0 → 0.2.2

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: a62cd74f3d7cf5b3e1dbca91ddf364d74ef624f5bbbf7fc4c433cb01fe0fe395
4
- data.tar.gz: ef90042396cde24e70b97238ce3bf9d1d477f60ccada8e387c750edc13904976
3
+ metadata.gz: 39c4e311b2cb926ee56048a22458ad3919180b6b9623d6b5067979f32440772d
4
+ data.tar.gz: b0489c8318a0ee7456b2f67ff7afb0049c1a07f905a66ce708ee571dc3f446fd
5
5
  SHA512:
6
- metadata.gz: fe568aa876e4f02e8c2ad36a89e41f6499c3fc6cbd7c0bb048c7e1f889e87e2b4deb6cfc1cbd3d952c1dd69423912d804203e8e0f9e245d75204583cf972ed91
7
- data.tar.gz: 64aa9bb65c333d5add6fcad002da4225977b766b6bec9bea0f8f8bbfbe26e8761a432cf6fe5ce52f1a3bc40c92c9ff0b6b9a07413a59fa1308681b1ed28f6730
6
+ metadata.gz: 3eb6209efcff10d759d6a3b3fcc2ab883c2e75df076d249afe5a79727471b867339f2eec1a74622fa06953b2bac0d18dbdfc7926d7b563a6215a673d3df0b2dd
7
+ data.tar.gz: 8b7d39a645a6c2e80cb8196b70d4b19968c11e995ff88876760c18df53c7f62acf50bbeeec348f223dda4e189b74122cca8700f1c967af563836cb7b97a03131
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: 'github-actions'
4
+ directory: '/'
5
+ schedule:
6
+ interval: 'monthly'
@@ -9,7 +9,7 @@ jobs:
9
9
  strategy:
10
10
  fail-fast: false
11
11
  matrix:
12
- ruby-version: ['3.0', '2.7', '2.6']
12
+ ruby-version: ['3.3', '3.2', '3.1', '3.0', '2.7']
13
13
  os: [ubuntu-latest]
14
14
  experimental: [false]
15
15
  include:
@@ -22,9 +22,9 @@ jobs:
22
22
 
23
23
  name: Ruby ${{ matrix.ruby-version }} capability ${{ matrix.capability }} on ${{ matrix.os }}
24
24
  steps:
25
- - uses: actions/checkout@v2
25
+ - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
26
26
  - name: Set up Ruby
27
- uses: ruby/setup-ruby@v1
27
+ uses: ruby/setup-ruby@7bae1d00b5db9166f4f0fc47985a3a5702cb58f0 # v1.197.0
28
28
  with:
29
29
  ruby-version: ${{ matrix.ruby-version }}
30
30
  - name: Install dependencies
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # 0.2.2
2
+
3
+ ## Release v0.2.2 - 2024/10/23
4
+
5
+ * Fixed "time" to produce collect Unix time
6
+ * meminfo: Added missing meminfo entries
7
+ * Updated dependency to cmetrics 0.3.x
8
+
9
+ # 0.2.1
10
+
11
+ ## Release v0.2.1 - 2021/09/28
12
+
13
+ * Fixed needless instance assignment for diskstats collector
14
+
1
15
  # 0.2.0
2
16
 
3
17
  ## Release v0.2.0 - 2021/09/22
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "fluent-plugin-node-exporter-metrics"
6
- spec.version = "0.2.0"
6
+ spec.version = "0.2.2"
7
7
  spec.authors = ["Kentaro Hayashi"]
8
8
  spec.email = ["hayashi@clear-code.com"]
9
9
 
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = test_files
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_runtime_dependency "cmetrics", "~> 0.2.3"
23
+ spec.add_runtime_dependency "cmetrics", "~> 0.3.3"
24
24
  spec.add_runtime_dependency "capng_c", "~> 0.2.2"
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 2.2.0"
@@ -152,8 +152,6 @@ module Fluent
152
152
  "This is the total number of seconds spent by all flush requests.",
153
153
  ["device"])
154
154
  end
155
-
156
- @metrics = {}
157
155
  end
158
156
 
159
157
  def kernel_version_over4_18?
@@ -240,7 +238,12 @@ module Fluent
240
238
  end
241
239
  end
242
240
  end
243
- @metrics = {
241
+ end
242
+ end
243
+ end
244
+
245
+ def cmetrics
246
+ metrics = {
244
247
  reads_completed_total: @reads_completed_total,
245
248
  reads_merged_total: @reads_merged_total,
246
249
  read_bytes_total: @read_bytes_total,
@@ -252,27 +255,22 @@ module Fluent
252
255
  io_now: @io_now,
253
256
  io_time_seconds_total: @io_time_seconds_total,
254
257
  io_time_weighted_seconds_total: @io_time_weighted_seconds_total
255
- }
256
- if kernel_version_over4_18?
257
- @metrics.merge!({
258
- discards_completed_total: @discards_completed_total,
259
- discards_merged_total: @discards_merged_total,
260
- discarded_sectors_total: @discarded_sectors_total,
261
- discard_time_seconds_total: @discard_time_seconds_total
262
- })
263
- end
264
- if kernel_version_over5_5?
265
- @metrics.merge!({
266
- flush_requests_total: @flush_requests_total,
267
- flush_requests_time_seconds_total: @flush_requests_time_seconds_total
268
- })
269
- end
270
- end
258
+ }
259
+ if kernel_version_over4_18?
260
+ metrics.merge!({
261
+ discards_completed_total: @discards_completed_total,
262
+ discards_merged_total: @discards_merged_total,
263
+ discarded_sectors_total: @discarded_sectors_total,
264
+ discard_time_seconds_total: @discard_time_seconds_total
265
+ })
271
266
  end
272
- end
273
-
274
- def cmetrics
275
- @metrics
267
+ if kernel_version_over5_5?
268
+ metrics.merge!({
269
+ flush_requests_total: @flush_requests_total,
270
+ flush_requests_time_seconds_total: @flush_requests_time_seconds_total
271
+ })
272
+ end
273
+ metrics
276
274
  end
277
275
  end
278
276
  end
@@ -35,7 +35,7 @@ module Fluent
35
35
 
36
36
  def time_update
37
37
  current_time = Fluent::EventTime.now
38
- value = current_time.to_i / 1e9
38
+ value = current_time.to_i
39
39
  @gauge.set(value)
40
40
  end
41
41
 
@@ -344,20 +344,29 @@ class NodeExporterMetricsInputTest < Test::Unit::TestCase
344
344
  Unevictable_bytes
345
345
  Mlocked_bytes
346
346
  SwapTotal_bytes
347
- SwapFree_bytes
347
+ SwapFree_bytes)
348
+ if meminfo_key_exist?("Zswap")
349
+ fields.concat(%w(
350
+ Zswap_bytes
351
+ Zswapped_bytes
352
+ ))
353
+ end
354
+ fields.concat(%w(
348
355
  Dirty_bytes
349
356
  Writeback_bytes
350
357
  AnonPages_bytes
351
358
  Mapped_bytes
352
359
  Shmem_bytes
353
- )
360
+ ))
354
361
  fields.concat(["KReclaimable_bytes"]) if meminfo_key_exist?("KReclaimable")
355
362
  fields.concat(%w(
356
363
  Slab_bytes
357
364
  SReclaimable_bytes
358
365
  SUnreclaim_bytes
359
366
  KernelStack_bytes
360
- PageTables_bytes
367
+ PageTables_bytes))
368
+ fields.concat(["SecPageTables_bytes"]) if meminfo_key_exist?("SecPageTables")
369
+ fields.concat(%w(
361
370
  NFS_Unstable_bytes
362
371
  Bounce_bytes
363
372
  WritebackTmp_bytes
@@ -376,6 +385,7 @@ class NodeExporterMetricsInputTest < Test::Unit::TestCase
376
385
  fields.concat(["ShmemPmdMapped_bytes"]) if meminfo_key_exist?("ShmemPmdMapped")
377
386
  fields.concat(["FileHugePages_bytes"]) if meminfo_key_exist?("FileHugePages")
378
387
  fields.concat(["FilePmdMapped_bytes"]) if meminfo_key_exist?("FilePmdMapped")
388
+ fields.concat(["Unaccepted_bytes"]) if meminfo_key_exist?("Unaccepted")
379
389
  fields.concat(%w(
380
390
  HugePages_Total
381
391
  HugePages_Free
@@ -9,7 +9,7 @@ class TimeColectorTest < Test::Unit::TestCase
9
9
  stub(Fluent::EventTime).now { Fluent::EventTime.new(1e9) }
10
10
  collector.run
11
11
  time_seconds = collector.cmetrics[:time_seconds]
12
- assert_equal(1.0, time_seconds.val)
12
+ assert_equal(1_000_000_000, time_seconds.val)
13
13
  end
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-node-exporter-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kentaro Hayashi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-22 00:00:00.000000000 Z
11
+ date: 2024-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cmetrics
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.3
19
+ version: 0.3.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.3
26
+ version: 0.3.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: capng_c
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -121,6 +121,7 @@ executables: []
121
121
  extensions: []
122
122
  extra_rdoc_files: []
123
123
  files:
124
+ - ".github/dependabot.yml"
124
125
  - ".github/workflows/linux-test.yaml"
125
126
  - ".gitignore"
126
127
  - CHANGELOG.md
@@ -205,7 +206,7 @@ homepage: https://github.com/fluent-plugins-nursery/fluent-plugin-node-exporter-
205
206
  licenses:
206
207
  - Apache-2.0
207
208
  metadata: {}
208
- post_install_message:
209
+ post_install_message:
209
210
  rdoc_options: []
210
211
  require_paths:
211
212
  - lib
@@ -220,8 +221,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
221
  - !ruby/object:Gem::Version
221
222
  version: '0'
222
223
  requirements: []
223
- rubygems_version: 3.1.6
224
- signing_key:
224
+ rubygems_version: 3.5.11
225
+ signing_key:
225
226
  specification_version: 4
226
227
  summary: Input plugin which collects metrics similar to Prometheus Node Exporter
227
228
  test_files: