fluent-plugin-elasticsearch-stats 0.1.0 → 0.2.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: 0dd73194ef81df48fccec9c76d2b3e7815fbd83736d5a545ad27c58d0a764e5e
4
- data.tar.gz: 806fbd6806d9b6c952e1c9807b528fedd64e27b612a41cd4ffe3b82c09cf9b82
3
+ metadata.gz: d776ffcbc115b404d3da96d04215181f1983fcf9c5c731841082c0790f44201d
4
+ data.tar.gz: 1c4f4245168f90a8ba7c3880737d34aeb42d2b270d3bf1956c3eb91c7a427415
5
5
  SHA512:
6
- metadata.gz: d3d4f1ce520a02d3e85e1d1c58289556891321da7f27e6f7898dc65d828b99426d8b2a97867830d367cecffcb8fd01f555a6ded4bf725007382cf294dc48e0a3
7
- data.tar.gz: 6ad75d6fa0c3476bde72ccf8bd5e6526c3080464491c57e5742d8b9f222091fe4c4cf3b09bd873ea9a4180f9b4b2548e149152ad8c6445b533ff4e616a71455a
6
+ metadata.gz: d78dd62a39fcbb39122cedf10e25a39a37a6c0af023c34c7e08015fdc036c3b10c6d8331ef5c7a6c01de7f7ff1d6adb5901a1d4fce4258d01442ad31ac73460e
7
+ data.tar.gz: 2841073645e617520f71e4d71f9382d98ed5ee09338681d9b69f7943761b2039068292c28d949cc88e08d8e03c40eb4624915a49205a207ef5a0308d1331710b
data/.rubocop.yml CHANGED
@@ -2,7 +2,7 @@ require:
2
2
  - rubocop-rake
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.4
5
+ TargetRubyVersion: 2.7
6
6
  NewCops: enable
7
7
 
8
8
  Gemspec/DevelopmentDependencies:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.0
1
+ 3.3.5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-elasticsearch-stats (0.1.0)
4
+ fluent-plugin-elasticsearch-stats (0.2.0)
5
5
  faraday (~> 2.9)
6
6
  fluentd (>= 0.14.10, < 2)
7
7
 
data/README.md CHANGED
@@ -34,26 +34,28 @@ Example of config
34
34
 
35
35
  #### global options
36
36
 
37
- | setting | type | default | description |
38
- |------------------------|--------------------|-----------------------------------|---------------------------------------------------------------------|
39
- | tag | | elasticsearch_stats | tag to emit events on |
40
- | urls | | ["http://localhost:9200"] | list of urls to poll |
41
- | timeout | second | 10 | timeout for each call |
42
- | username | | | username for basic authentication |
43
- | password | | | password for basic authentication |
44
- | user_agent | | fluent-plugin-elasticsearch-stats | user agent for http request |
45
- | ca_file | file | | CA cert file to use for request |
46
- | verify_ssl | true\|false | true | option to verify certificate/host |
47
- | | | | |
48
- | interval | second | 300 | interval for probe execution |
49
- | | | | |
50
- | metric_prefix | | | prefix for metric fields |
51
- | metadata_prefix | | | prefix for metadata fields |
52
- | timestamp_format | iso\|epochmillis | iso | event timestamp format |
53
- | event_name_separator | | / | event name separator |
54
- | | | | |
55
- | index_base_pattern | regexp | | base index pattern to generate aggregated index metrics |
56
- | index_base_replacement | regexp replacement | \1 | base index pattern replacement to generate aggregated index metrics |
37
+ | setting | type | default | description |
38
+ |-------------------------------|--------------------|-----------------------------------|---------------------------------------------------------------------|
39
+ | tag | | elasticsearch_stats | tag to emit events on |
40
+ | urls | | ["http://localhost:9200"] | list of urls to poll |
41
+ | timeout | second | 10 | timeout for each call |
42
+ | username | | | username for basic authentication |
43
+ | password | | | password for basic authentication |
44
+ | user_agent | | fluent-plugin-elasticsearch-stats | user agent for http request |
45
+ | ca_file | file | | CA cert file to use for request |
46
+ | verify_ssl | bool | true | option to verify certificate/host |
47
+ | | | | |
48
+ | interval | second | 300 | interval for probe execution |
49
+ | | | | |
50
+ | metric_prefix | | | prefix for metric fields |
51
+ | metadata_prefix | | | prefix for metadata fields |
52
+ | timestamp_format | iso\|epochmillis | iso | event timestamp format |
53
+ | event_name_separator | | / | event name separator |
54
+ | | | | |
55
+ | index_base_pattern | regexp | | base index pattern to generate aggregated index metrics |
56
+ | index_base_replacement | regexp replacement | \1 | base index pattern replacement to generate aggregated index metrics |
57
+ | | | | |
58
+ | aggregated_index_metrics_only | bool | false | for index matrics, only generate aggregated metrics |
57
59
 
58
60
  #### cluster health options
59
61
 
@@ -5,15 +5,15 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'fluent-plugin-elasticsearch-stats'
8
- spec.version = '0.1.0'
8
+ spec.version = '0.2.0'
9
9
  spec.authors = ['Thomas Tych']
10
10
  spec.email = ['thomas.tych@gmail.com']
11
11
 
12
12
  spec.summary = 'fluentd plugin to generate elasticsearch cluster stats events.'
13
- spec.homepage = 'https://gitlab.com/ttych/fluent-plugin-elasticsearch-status'
13
+ spec.homepage = 'https://gitlab.com/ttych/fluent-plugin-elasticsearch-stats'
14
14
  spec.license = 'Apache-2.0'
15
15
 
16
- spec.required_ruby_version = '>= 2.4.0'
16
+ spec.required_ruby_version = '>= 2.7.0'
17
17
 
18
18
  spec.metadata['rubygems_mfa_required'] = 'true'
19
19
 
@@ -40,6 +40,7 @@ module Fluent
40
40
  base_metrics = extract_indices_base_metrics
41
41
  aggregated_metrics = extract_indices_aggregated_metrics(base_metrics)
42
42
 
43
+ return aggregated_metrics if metric.aggregated_index_metrics_only
43
44
  base_metrics + aggregated_metrics
44
45
  end
45
46
 
@@ -14,7 +14,7 @@ module Fluent
14
14
 
15
15
  def generate_dangling_indices_count
16
16
  metrics = []
17
- metrics << metric.format(name: %w[dangling all count],
17
+ metrics << metric.format(name: %w[dangling_indices count],
18
18
  value: dangling_indices.size,
19
19
  family: family,
20
20
  metadata: metadata)
@@ -8,7 +8,7 @@ module Fluent
8
8
  DEFAULT_TIMESTAMP_FORMAT = :iso
9
9
 
10
10
  class << self
11
- attr_accessor :metric_prefix, :index_base_pattern, :index_base_replacement
11
+ attr_accessor :metric_prefix, :index_base_pattern, :index_base_replacement, :aggregated_index_metrics_only
12
12
 
13
13
  def name_separator
14
14
  @name_separator ||= DEFAULT_NAME_SEPARATOR
@@ -21,14 +21,16 @@ module Fluent
21
21
  end
22
22
  end
23
23
 
24
- attr_reader :metric_prefix, :timestamp_format, :index_base_pattern, :index_base_replacement, :name_separator
24
+ attr_reader :metric_prefix, :timestamp_format, :index_base_pattern, :index_base_replacement,
25
+ :aggregated_index_metrics_only, :name_separator
25
26
 
26
- def initialize(metric_prefix: nil, timestamp_format: nil, index_base_pattern: nil, index_base_replacement: nil,
27
+ def initialize(metric_prefix: nil, timestamp_format: nil, index_base_pattern: nil, index_base_replacement: nil, aggregated_index_metrics_only: nil,
27
28
  name_separator: nil)
28
29
  @metric_prefix = metric_prefix || self.class.metric_prefix
29
30
  @timestamp_format = timestamp_format || self.class.timestamp_format
30
31
  @index_base_pattern = index_base_pattern || self.class.index_base_pattern
31
32
  @index_base_replacement = index_base_replacement || self.class.index_base_replacement
33
+ @aggregated_index_metrics_only = aggregated_index_metrics_only || self.class.aggregated_index_metrics_only
32
34
  @name_separator = name_separator || self.class.name_separator
33
35
  end
34
36
 
@@ -52,6 +52,7 @@ module Fluent
52
52
  DEFAULT_INDEX_BASE_REPLACEMENT = '\1'
53
53
  DEFAULT_EVENT_NAME_SEPARATOR = '/'
54
54
  DEFAULT_SKIP_SYSTEM_INDICES = true
55
+ DEFAULT_AGGREGATED_INDEX_METRICS_ONLY = false
55
56
 
56
57
  ALLOWED_CLUSTER_HEALTH_LEVELS = Fluent::Plugin::ElasticsearchStats::Client::ALLOWED_CLUSTER_HEALTH_LEVELS
57
58
  ALLOWED_NODES_STATS_LEVELS = Fluent::Plugin::ElasticsearchStats::Client::ALLOWED_NODES_STATS_LEVELS
@@ -119,6 +120,9 @@ module Fluent
119
120
  desc 'base index pattern replacement to generate aggregated index metrics'
120
121
  config_param :index_base_replacement, :string, default: DEFAULT_INDEX_BASE_REPLACEMENT
121
122
 
123
+ desc 'base index pattern to generate aggregated index metrics'
124
+ config_param :aggregated_index_metrics_only, :bool, default: DEFAULT_AGGREGATED_INDEX_METRICS_ONLY
125
+
122
126
  # desc 'skip system indices'
123
127
  # config_param :skip_system_indices, :bool, default: DEFAULT_SKIP_SYSTEM_INDICES
124
128
 
@@ -135,6 +139,7 @@ module Fluent
135
139
  ElasticsearchStats::Metric.timestamp_format = timestamp_format
136
140
  ElasticsearchStats::Metric.index_base_pattern = index_base_pattern
137
141
  ElasticsearchStats::Metric.index_base_replacement = index_base_replacement
142
+ ElasticsearchStats::Metric.aggregated_index_metrics_only = aggregated_index_metrics_only
138
143
  ElasticsearchStats::Metric.name_separator = event_name_separator
139
144
 
140
145
  configure_elasticsearchs
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-elasticsearch-stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Tych
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-14 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: bump
@@ -226,7 +226,7 @@ files:
226
226
  - lib/fluent/plugin/elasticsearch_stats/nodes_stats_data.rb
227
227
  - lib/fluent/plugin/elasticsearch_stats/utils.rb
228
228
  - lib/fluent/plugin/in_elasticsearch_stats.rb
229
- homepage: https://gitlab.com/ttych/fluent-plugin-elasticsearch-status
229
+ homepage: https://gitlab.com/ttych/fluent-plugin-elasticsearch-stats
230
230
  licenses:
231
231
  - Apache-2.0
232
232
  metadata:
@@ -239,14 +239,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
239
239
  requirements:
240
240
  - - ">="
241
241
  - !ruby/object:Gem::Version
242
- version: 2.4.0
242
+ version: 2.7.0
243
243
  required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  requirements:
245
245
  - - ">="
246
246
  - !ruby/object:Gem::Version
247
247
  version: '0'
248
248
  requirements: []
249
- rubygems_version: 3.5.6
249
+ rubygems_version: 3.5.18
250
250
  signing_key:
251
251
  specification_version: 4
252
252
  summary: fluentd plugin to generate elasticsearch cluster stats events.