riemann-opensearch 0.0.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ad75c8e4d2492c09bf3d837e26f95d7afc4969c840ea981cae193ba047b2a0c
4
- data.tar.gz: becbc3a64ac8adfc216d614821638bad5c9cdda449f8398a6d7ddd48ba86e3dc
3
+ metadata.gz: e421ab3d4b594cb0d899db3f7c943cba9f508f4910ee17029e74b36bbd58ba08
4
+ data.tar.gz: 6021ddfdf816fb9ebcb4b3ebfab92440f423eac5473e4d7c9699d5f5dcbb7f6c
5
5
  SHA512:
6
- metadata.gz: 29d052cff7131832712db0b85493af178c8a4d10b3ee81270da43978747d86811b3a0e687fb8c0099dddf626dcd343f73e1fa37fcc8d6f1cc84cedc33146d4fe
7
- data.tar.gz: 4763cf0dfb57bbabaacffd8db98c8df6c0ca06e42c160edfdb3c77d0c9f08a70494b760faf6e70d9282d5a1b078346de2c38efd0ea88d707995a74ce62823f38
6
+ metadata.gz: 942e357f3327a1b33d5365ce84fd171f4e682a614937887d6cc4d750370044e07d51f692a732d0096565f655739e5baeb85ad3310807eaa777f69e8add9ff5b2
7
+ data.tar.gz: be0bbcebc1454adb840d7b0790f46ba2def7a24fc166d2588bc6e1ad5b37f505180b52b2da8994ff3b4bdadc8d69d41383a2f24f65cd2ef216685c98d55679fc
@@ -0,0 +1 @@
1
+ * @opus-codium/core @opus-codium/vittoria-conseil
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: CI
3
+
4
+ on:
5
+ push:
6
+ branches:
7
+ - main
8
+ pull_request:
9
+ branches:
10
+ - main
11
+
12
+ jobs:
13
+ standard:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v3
17
+ - name: Setup ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: 3.0
21
+ bundler-cache: true
22
+ - name: Run static code analysis
23
+ run: bundle exec standardrb
24
+ unit:
25
+ runs-on: ubuntu-latest
26
+ needs: standard
27
+ strategy:
28
+ matrix:
29
+ ruby:
30
+ - "2.7"
31
+ - "3.0"
32
+ - "3.1"
33
+ - "3.2"
34
+ - "3.3"
35
+ - "3.4"
36
+ name: Ruby ${{ matrix.ruby }}
37
+ steps:
38
+ - uses: actions/checkout@v3
39
+ - name: Setup ruby
40
+ uses: ruby/setup-ruby@v1
41
+ with:
42
+ ruby-version: ${{ matrix.ruby }}
43
+ bundler-cache: true
44
+ - name: Run tests
45
+ run: bundle exec rspec
data/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # Changelog
2
+
3
+ ## [v1.0.0](https://github.com/opus-codium/riemann-opensearch/tree/v1.0.0) (2025-05-06)
4
+
5
+ [Full Changelog](https://github.com/opus-codium/riemann-opensearch/compare/v0.0.1...v1.0.0)
6
+
7
+ **Breaking changes:**
8
+
9
+ - Remove disk usage metric [\#4](https://github.com/opus-codium/riemann-opensearch/pull/4) ([smortex](https://github.com/smortex))
10
+
11
+ **Implemented enhancements:**
12
+
13
+ - Add a metric for the indices size on disk [\#3](https://github.com/opus-codium/riemann-opensearch/pull/3) ([smortex](https://github.com/smortex))
14
+
15
+ **Fixed bugs:**
16
+
17
+ - Fix loading with riemann-wrapper [\#2](https://github.com/opus-codium/riemann-opensearch/pull/2) ([smortex](https://github.com/smortex))
18
+
19
+ ## [v0.0.1](https://github.com/opus-codium/riemann-opensearch/tree/v0.0.1) (2025-04-08)
20
+
21
+ [Full Changelog](https://github.com/opus-codium/riemann-opensearch/compare/5e90741b9e5dd17b64e08ee7907a06a4f8c2f0aa...v0.0.1)
22
+
23
+
24
+
25
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile CHANGED
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in riemann-opensearch.gemspec
6
6
  gemspec
7
7
 
8
+ gem "github_changelog_generator"
8
9
  gem "rake", "~> 13.0"
9
10
  gem "rspec", "~> 3.0"
10
11
  gem "standard", "~> 1.3"
data/Rakefile CHANGED
@@ -8,3 +8,12 @@ RSpec::Core::RakeTask.new(:spec)
8
8
  require "standard/rake"
9
9
 
10
10
  task default: %i[standard spec]
11
+
12
+ require "github_changelog_generator/task"
13
+
14
+ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
15
+ config.user = "opus-codium"
16
+ config.project = "riemann-opensearch"
17
+ config.exclude_labels = ["skip-changelog"]
18
+ config.future_release = "v#{Riemann::Tools::Opensearch::VERSION}"
19
+ end
@@ -4,4 +4,4 @@ Process.setproctitle($PROGRAM_NAME)
4
4
 
5
5
  require "riemann/tools/opensearch"
6
6
 
7
- Riemann::Tools::OpenSearch.run
7
+ Riemann::Tools::Opensearch.run
@@ -0,0 +1,7 @@
1
+ module Riemann
2
+ module Tools
3
+ class Opensearch
4
+ VERSION = "1.0.0"
5
+ end
6
+ end
7
+ end
@@ -5,7 +5,7 @@ require "opensearch-ruby"
5
5
 
6
6
  module Riemann
7
7
  module Tools
8
- class OpenSearch
8
+ class Opensearch
9
9
  class JsonMapper
10
10
  def initialize(values)
11
11
  values.each do |k, v|
@@ -41,7 +41,6 @@ module Riemann
41
41
  attr_accessor :shards, :disk, :host, :ip, :node
42
42
 
43
43
  def initialize(values)
44
- # @disk = Disk.new
45
44
  @disk = Struct.new(:indices, :used, :avail, :total, :percent).new
46
45
  super
47
46
  end
@@ -71,9 +70,6 @@ module Riemann
71
70
  opt :os_shard_allocation_warning, "Shard allocation warning threshold", short: :none, default: 0.90
72
71
  opt :os_shard_allocation_error, "Shard allocation error threshold", short: :none, default: 0.95
73
72
 
74
- opt :os_disk_usage_warning, "Disk usage warning threshold", short: :none, default: 0.90
75
- opt :os_disk_usage_error, "Disk usage error threshold", short: :none, default: 0.95
76
-
77
73
  HEALTH_STATUS_STATE = {
78
74
  "green" => :ok,
79
75
  "yellow" => :warning,
@@ -110,12 +106,9 @@ module Riemann
110
106
  description: "#{allocation.shards}/#{max_shards_per_node}"
111
107
  })
112
108
 
113
- usage = allocation.disk.used.to_f / allocation.disk.total
114
109
  report({
115
- service: "#{health.cluster} #{allocation.node} disk usage",
116
- state: disk_usage_state(usage),
117
- metric: usage,
118
- description: format("%.3f %%", usage * 100)
110
+ service: "#{health.cluster} #{allocation.node} indices size",
111
+ metric: allocation.disk.indices
119
112
  })
120
113
  end
121
114
  end
@@ -148,16 +141,6 @@ module Riemann
148
141
  value
149
142
  end
150
143
 
151
- def disk_usage_state(usage)
152
- if usage >= opts[:os_disk_usage_error]
153
- :critical
154
- elsif usage >= opts[:os_disk_usage_warning]
155
- :warning
156
- else
157
- :ok
158
- end
159
- end
160
-
161
144
  def shard_allocation_state(count, limit)
162
145
  if count >= opts[:os_shard_allocation_error] * limit
163
146
  :critical
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "lib/riemann/tools/opensearch/version"
4
+
3
5
  Gem::Specification.new do |spec|
4
6
  spec.name = "riemann-opensearch"
5
- spec.version = "0.0.1"
7
+ spec.version = Riemann::Tools::Opensearch::VERSION
6
8
  spec.authors = ["Romain Tartière"]
7
9
  spec.email = ["romain@blogreen.org"]
8
10
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-opensearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Romain Tartière
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-04-08 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: faraday-net_http_persistent
@@ -52,7 +51,6 @@ dependencies:
52
51
  - - "~>"
53
52
  - !ruby/object:Gem::Version
54
53
  version: '1.0'
55
- description:
56
54
  email:
57
55
  - romain@blogreen.org
58
56
  executables:
@@ -60,8 +58,11 @@ executables:
60
58
  extensions: []
61
59
  extra_rdoc_files: []
62
60
  files:
61
+ - ".github/CODEOWNERS"
62
+ - ".github/workflows/ci.yml"
63
63
  - ".gitignore"
64
64
  - ".rspec"
65
+ - CHANGELOG.md
65
66
  - CODE_OF_CONDUCT.md
66
67
  - Gemfile
67
68
  - LICENSE.txt
@@ -71,6 +72,7 @@ files:
71
72
  - bin/setup
72
73
  - exe/riemann-opensearch
73
74
  - lib/riemann/tools/opensearch.rb
75
+ - lib/riemann/tools/opensearch/version.rb
74
76
  - riemann-opensearch.gemspec
75
77
  homepage: https://github.com/opus-codium/riemann-opensearch
76
78
  licenses:
@@ -81,7 +83,6 @@ metadata:
81
83
  source_code_uri: https://github.com/opus-codium/riemann-opensearch
82
84
  changelog_uri: https://github.com/opus-codium/riemann-opensearch
83
85
  rubygems_mfa_required: 'true'
84
- post_install_message:
85
86
  rdoc_options: []
86
87
  require_paths:
87
88
  - lib
@@ -96,8 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
97
  - !ruby/object:Gem::Version
97
98
  version: '0'
98
99
  requirements: []
99
- rubygems_version: 3.3.15
100
- signing_key:
100
+ rubygems_version: 3.6.7
101
101
  specification_version: 4
102
102
  summary: Send OpenSearch metrics to Riemann
103
103
  test_files: []