fluent-plugin-calyptia-monitoring 0.1.0.rc7 → 0.1.1

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: 7cfa17ee6e7d7b29c255151a698bdc9c004e936a1760a2f39ece7b204627f868
4
- data.tar.gz: '098ab10f65f463b7de64f1a30adb828877285ff4aa6482fd3fec6e02e1e2de59'
3
+ metadata.gz: 0fc0b5aeb01b9d8633b36bf2f3b9f58edbcb9ef013714e3e835521701351a4d4
4
+ data.tar.gz: db62765482fe0dd3cc2a3ceba7267f40a9da21bb4b52f99d230ccda39c52d27f
5
5
  SHA512:
6
- metadata.gz: e545fd36229c0be2bfbcf2a60045033ae95e131e67bd5ee810a2b784a71a4ba707684bb4d8674e7d891565ef0fce59b4f46f72c21fc4e30e60b94bf9274a6673
7
- data.tar.gz: d408f12b6c6a12ca21e402858703c57692b87c57a7571017e5c6beef30e019c15c1adea4f5def05711cdfef79c50c01286f839babec0501a033a43ab4e7f137a
6
+ metadata.gz: 9d56cd4f622355e6b7f3939044e33290fdfd1dc017fe77988296af190f1ba89020d0be45e123a782083e7bc7d617125ef92c2042e2d4777f7ef57736da0f75de
7
+ data.tar.gz: 36c91c64f0e13a06d9c2dd57c265989c6bf132dd7c9a57d388b22c6ba9d324af361253272763d761c6b21a99b8355f199ddd22b03539e6abd697488994c99767
data/README.md CHANGED
@@ -40,10 +40,11 @@ $ bundle
40
40
 
41
41
  |parameter|type|description|default|
42
42
  |---|---|---|---|
43
- |endpoint|string (optional)|The endpoint for Monitoring API HTTP request, e.g. http://example.com/api|`TBD`|
43
+ |endpoint|string (optional)|The endpoint for Monitoring API HTTP request, e.g. http://example.com/api|`"https://cloud-api.calyptia.com"`|
44
44
  |api_key|string (required)|The API KEY for Monitoring API HTTP request||
45
45
  |rate|time (optional)|Emit monitoring values interval. (minimum interval is 30 seconds.)|`30`|
46
46
  |pending_metrics_size|size (optional)|Setup pending metrics capacity size|`100`|
47
+ |fluentd_conf_path|string (optional)|Specify Fluentd config file path for RPC not to be available case|`nil`|
47
48
 
48
49
  ### Example
49
50
 
@@ -84,6 +85,44 @@ And enabling RPC and configDump endpoint is required if sending Fluentd configur
84
85
  </source>
85
86
  ```
86
87
 
88
+ And also retrieving configuration from actual file is also supported:
89
+
90
+ ```aconf
91
+ <system>
92
+ # If users want to use multi workers feature which corresponds to logical number of CPUs, please comment out this line.
93
+ # workers "#{require 'etc'; Etc.nprocessors}"
94
+ enable_input_metrics true
95
+ # This record size measuring settings might impact for performance.
96
+ # Please be careful for high loaded environment to turn on.
97
+ enable_size_metrics true
98
+ <metrics>
99
+ @type cmetrics
100
+ </metrics>
101
+ </system>
102
+ # And other configurations....
103
+
104
+ ## Fill YOUR_API_KEY with your Calyptia API KEY
105
+ <source>
106
+ @type calyptia_monitoring
107
+ @id input_caplyptia_moniroting
108
+ <cloud_monitoring>
109
+ # endpoint http://development-environment-or-production.fqdn:5000
110
+ api_key YOUR_API_KEY
111
+ rate 30
112
+ pending_metrics_size 100 # Specify capacity for pending metrics
113
+ fluentd_conf_path /path/to/fluent.conf
114
+ </cloud_monitoring>
115
+ <storage>
116
+ @type local
117
+ path /path/to/agent/accessible/directories/agent_states
118
+ </storage>
119
+ </source>
120
+ ```
121
+
122
+ **Note:** We recommend to use RPC version due to some circumstances should differ between a loaded configuration and a saved Fluentd configuration.
123
+ This is because calling dumping config RPC feature can obtain from configuration contents which are loaded on memory. But retrieving configuration from the specified file is just read from the file contents and it cannot handle/retrieve loaded configurations on Fluentd.
124
+ When users just update their Fluentd configurations and forgot to restart/reload their Fluentd instances, loaded configurations differ from just edited ones.
125
+
87
126
  ## Calyptia Monitoring API config generator
88
127
 
89
128
  Usage:
@@ -91,7 +130,7 @@ Usage:
91
130
  ```
92
131
  Usage: calyptia-config-generator api_key [options]
93
132
 
94
- Output plugin config definitions
133
+ Generate Calyptia monitoring plugin config definitions
95
134
 
96
135
  Arguments:
97
136
  api_key: Specify your API_KEY
@@ -104,10 +143,12 @@ Options:
104
143
  --disable-get-dump Disable RPC getDump procedure. getDump is enabled by default.
105
144
  --storage-agent-token-dir DIR
106
145
  Specify accesible storage token dir. (default: /path/to/accesible/dir)
146
+ --fluentd-conf-path PATH Specify fluentd configuration file path. (default: nil)
107
147
  ```
108
148
 
109
149
  ## Copyright
110
150
 
111
- * Copyright(c) 2021- Hiroshi Hatake
151
+ * Copyright(c) 2021- Calyptia Inc.
152
+ * Maintainer: Hiroshi Hatake <hatake@calyptia.com>
112
153
  * License
113
154
  * Apache License, Version 2.0
@@ -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-calyptia-monitoring"
6
- spec.version = "0.1.0.rc7"
6
+ spec.version = "0.1.1"
7
7
  spec.authors = ["Hiroshi Hatake"]
8
8
  spec.email = ["hatake@calyptia.com"]
9
9
 
@@ -23,6 +23,6 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "bundler", "~> 2.2.15"
24
24
  spec.add_development_dependency "rake", "~> 13.0"
25
25
  spec.add_development_dependency "test-unit", "~> 3.3"
26
- spec.add_runtime_dependency "fluentd", [">= 1.13.0", "< 2"]
27
- spec.add_runtime_dependency "fluent-plugin-metrics-cmetrics", ">= 0.1.0.rc3"
26
+ spec.add_runtime_dependency "fluentd", [">= 1.14.0", "< 2"]
27
+ spec.add_runtime_dependency "fluent-plugin-metrics-cmetrics", ">= 0.1.1"
28
28
  end
@@ -33,6 +33,8 @@ class CalyptiaConfigGenerator
33
33
  @enable_get_dump = true
34
34
  @rpc_endpoint = "127.0.0.1:24444"
35
35
  @storage_agent_token_dir = default_storage_dir
36
+ @fluentd_conf_path = nil
37
+ @disable_rpc = false
36
38
 
37
39
  prepare_option_parser
38
40
  end
@@ -71,7 +73,7 @@ class CalyptiaConfigGenerator
71
73
  @parser.banner = <<BANNER
72
74
  Usage: #{$0} api_key [options]
73
75
 
74
- Output plugin config definitions
76
+ Generate Calyptia monitoring plugin config definitions
75
77
 
76
78
  Arguments:
77
79
  \tapi_key: Specify your API_KEY
@@ -96,6 +98,10 @@ BANNER
96
98
  @parser.on("--storage-agent-token-dir DIR", "Specify accesible storage token dir. (default: #{default_storage_dir})") do |s|
97
99
  @storage_agent_token_dir = s
98
100
  end
101
+ @parser.on("--fluentd-conf-path PATH", "Specify fluentd configuration file path. (default: nil)") do |s|
102
+ @fluentd_conf_path = s
103
+ @disable_rpc = true
104
+ end
99
105
  end
100
106
 
101
107
  def usage(message = nil)
@@ -125,6 +131,8 @@ BANNER
125
131
  size_metrics: @enable_size_metrics,
126
132
  enable_get_dump: @enable_get_dump,
127
133
  storage_agent_token_dir: @storage_agent_token_dir,
134
+ fluentd_conf_path: @fluentd_conf_path,
135
+ disable_rpc: @disable_rpc,
128
136
  }
129
137
  rescue => e
130
138
  usage(e)
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fluent/env'
4
+ require 'fluent/engine'
5
+ require 'fluent/log'
6
+ require 'fluent/config'
7
+ require 'fluent/configurable'
8
+ require 'fluent/system_config'
9
+ require 'fluent/config/element'
10
+ require 'serverengine'
11
+ require 'stringio'
12
+
13
+ include Fluent::Configurable
14
+
15
+ def init_log
16
+ dl_opts = {}
17
+ dl_opts[:log_level] = ServerEngine::DaemonLogger::WARN
18
+ @sio = StringIO.new('', 'r+')
19
+ logger = ServerEngine::DaemonLogger.new(@sio, dl_opts)
20
+ $log = Fluent::Log.new(logger)
21
+ end
22
+
23
+ init_log
24
+
25
+ File.open(ENV["FLUENT_CONFIG_PATH"], "r") do |f|
26
+ config = Fluent::Config.parse(f.read, '(supervisor)', '(readFromFile)', true)
27
+ system_config = Fluent::SystemConfig.create(config)
28
+ Fluent::Engine.init(system_config, supervisor_mode: true)
29
+ Fluent::Engine.run_configure(config, dry_run: true)
30
+ confs = []
31
+ masked_element = config.to_masked_element
32
+ masked_element.elements.each{|e|
33
+ confs << e.to_s
34
+ }
35
+ puts confs.join
36
+ end
@@ -0,0 +1,87 @@
1
+ #
2
+ # fluent-plugin-calyptia-monitoring
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ require 'fluent/plugin/in_monitor_agent'
17
+
18
+ module Fluent::Plugin
19
+ class CalyptiaMonitoringBufferExtInput < MonitorAgentInput
20
+ CALYPTIA_PLUGIN_BUFFER_METRIC_INFO = {
21
+ 'buffer_total_queued_size' => ->() {
22
+ throw(:skip) unless instance_variable_defined?(:@buffer) && !@buffer.nil? && @buffer.is_a?(::Fluent::Plugin::Buffer)
23
+ @buffer.total_queued_size_metrics.cmetrics.to_msgpack
24
+ },
25
+ 'buffer_stage_length' => ->() {
26
+ throw(:skip) unless instance_variable_defined?(:@buffer) && !@buffer.nil? && @buffer.is_a?(::Fluent::Plugin::Buffer)
27
+ @buffer.stage_length_metrics.cmetrics.to_msgpack
28
+ },
29
+ 'buffer_stage_byte_size' => ->() {
30
+ throw(:skip) unless instance_variable_defined?(:@buffer) && !@buffer.nil? && @buffer.is_a?(::Fluent::Plugin::Buffer)
31
+ @buffer.stage_size_metrics.cmetrics.to_msgpack
32
+ },
33
+ 'buffer_queue_length' => ->() {
34
+ throw(:skip) unless instance_variable_defined?(:@buffer) && !@buffer.nil? && @buffer.is_a?(::Fluent::Plugin::Buffer)
35
+ @buffer.queue_length_metrics.cmetrics.to_msgpack
36
+ },
37
+ 'buffer_queue_byte_size' => ->() {
38
+ throw(:skip) unless instance_variable_defined?(:@buffer) && !@buffer.nil? && @buffer.is_a?(::Fluent::Plugin::Buffer)
39
+ @buffer.queue_size_metrics.cmetrics.to_msgpack
40
+ },
41
+ 'available_buffer_space_ratios' => ->() {
42
+ throw(:skip) unless instance_variable_defined?(:@buffer) && !@buffer.nil? && @buffer.is_a?(::Fluent::Plugin::Buffer)
43
+ @buffer.available_buffer_space_ratios_metrics.cmetrics.to_msgpack
44
+ },
45
+ 'newest_timekey' => ->() {
46
+ throw(:skip) unless instance_variable_defined?(:@buffer) && !@buffer.nil? && @buffer.is_a?(::Fluent::Plugin::Buffer)
47
+ @buffer.newest_timekey_metrics.cmetrics.to_msgpack
48
+ },
49
+ 'oldest_timekey' => ->() {
50
+ throw(:skip) unless instance_variable_defined?(:@buffer) && !@buffer.nil? && @buffer.is_a?(::Fluent::Plugin::Buffer)
51
+ @buffer.oldest_timekey_metrics.cmetrics.to_msgpack
52
+ },
53
+ }
54
+
55
+ def get_monitor_info(pe, opts = {})
56
+ obj = {}
57
+
58
+ obj['metrics'] = get_plugin_metric(pe)
59
+
60
+ obj
61
+ end
62
+
63
+ def get_plugin_metric(pe)
64
+ # Nop for non output plugin
65
+ return {} if plugin_category(pe) != "output"
66
+
67
+ metrics = {}
68
+
69
+ if pe.respond_to?(:statistics)
70
+ # Force to update buffers' metrics values
71
+ pe.statistics
72
+ end
73
+
74
+ CALYPTIA_PLUGIN_BUFFER_METRIC_INFO.each_pair { |key, code|
75
+ begin
76
+ v = pe.instance_exec(&code)
77
+ unless v.nil?
78
+ metrics[key] = v
79
+ end
80
+ rescue
81
+ end
82
+ }
83
+
84
+ metrics
85
+ end
86
+ end
87
+ end
@@ -37,12 +37,17 @@ module Fluent::Plugin
37
37
  ENV['HTTPS_PROXY'] || ENV['HTTP_PROXY'] || ENV['http_proxy'] || ENV['https_proxy']
38
38
  end
39
39
 
40
+ def create_go_semver(version)
41
+ version.gsub(/.(?<prever>(rc|alpha|beta|pre))/,
42
+ '-\k<prever>')
43
+ end
44
+
40
45
  def agent_metadata(current_config)
41
46
  metadata = {
42
47
  "name" => Socket.gethostname,
43
48
  "type" => "fluentd",
44
49
  "rawConfig" => current_config,
45
- "version" => Fluent::VERSION,
50
+ "version" => create_go_semver(Fluent::VERSION),
46
51
  "edition" => "community".freeze,
47
52
  }
48
53
  if system_config.workers.to_i > 1
@@ -27,9 +27,25 @@ module Fluent::Plugin
27
27
  @emit_records_metrics.cmetrics.to_msgpack
28
28
  },
29
29
  'retry_count' => ->(){
30
- throw(:skip) unless instance_variable_defined?(:@buffer) && !@buffer.nil? && @buffer.is_a?(::Fluent::Plugin::Buffer)
30
+ throw(:skip) if @num_errors_metrics.get.nil?
31
31
  @num_errors_metrics.cmetrics.to_msgpack
32
32
  },
33
+ 'write_count' => ->(){
34
+ throw(:skip) if @write_count_metrics.get.nil?
35
+ @write_count_metrics.cmetrics.to_msgpack
36
+ },
37
+ 'rollback_count' => ->(){
38
+ throw(:skip) if @rollback_count_metrics.get.nil?
39
+ @rollback_count_metrics.cmetrics.to_msgpack
40
+ },
41
+ 'flush_time_count' => ->(){
42
+ throw(:skip) if @flush_time_count_metrics.get.nil?
43
+ @flush_time_count_metrics.cmetrics.to_msgpack
44
+ },
45
+ 'slow_flush_count' => ->(){
46
+ throw(:skip) if @slow_flush_count_metrics.get.nil?
47
+ @slow_flush_count_metrics.cmetrics.to_msgpack
48
+ },
33
49
  }
34
50
 
35
51
  def get_monitor_info(pe, opts = {})
@@ -17,10 +17,11 @@ require 'net/http'
17
17
  require 'monitor'
18
18
  require 'time'
19
19
  require 'fluent/version'
20
- require 'fluent/config/element'
21
- require 'fluent/plugin/metrics'
20
+ require 'fluent/env'
22
21
  require "fluent/plugin/input"
22
+ require "serverengine"
23
23
  require_relative "calyptia_monitoring_ext"
24
+ require_relative "calyptia_monitoring_buffer_ext"
24
25
  require_relative "calyptia_monitoring_calyptia_api_requester"
25
26
 
26
27
  module Fluent
@@ -31,7 +32,7 @@ module Fluent
31
32
  class CreateAgentError < Fluent::ConfigError; end
32
33
  class UpdateAgentError < Fluent::ConfigError; end
33
34
 
34
- helpers :timer, :storage
35
+ helpers :timer, :storage, :child_process
35
36
 
36
37
  RPC_CONFIG_DUMP_ENDPOINT = "/api/config.getDump".freeze
37
38
  DEFAULT_STORAGE_TYPE = 'local'
@@ -52,6 +53,8 @@ module Fluent
52
53
  config_param :rate, :time, default: 30
53
54
  desc 'Setup pending metrics capacity size'
54
55
  config_param :pending_metrics_size, :size, default: DEFAULT_PENDING_METRICS_SIZE
56
+ desc 'Specify Fluentd config file path for RPC not to be available case'
57
+ config_param :fluentd_conf_path, :string, default: nil
55
58
  end
56
59
 
57
60
  def multi_workers_ready?
@@ -67,6 +70,7 @@ module Fluent
67
70
 
68
71
  def configure(conf)
69
72
  super
73
+
70
74
  config = conf.elements.select{|e| e.name == 'storage' }.first
71
75
  @storage_agent = storage_create(usage: 'calyptia_monitoring_agent', conf: config, default_type: DEFAULT_STORAGE_TYPE)
72
76
  end
@@ -83,6 +87,43 @@ module Fluent
83
87
  confs.join
84
88
  end
85
89
 
90
+ def get_masked_conf_from_conf_file
91
+ return "" unless File.exist?(@cloud_monitoring.fluentd_conf_path) # check file existence.
92
+
93
+ conf = ""
94
+ callback = ->(status) {
95
+ if status && status.success?
96
+ #nop
97
+ elsif status
98
+ log.warn "config dumper exits with error code", prog: prog, status: status.exitstatus, signal: status.termsig
99
+ else
100
+ log.warn "config dumper unexpectedly exits without exit status", prog: prog
101
+ end
102
+ }
103
+ spawn_command, arguments = if Fluent.windows?
104
+ [::ServerEngine.ruby_bin_path, File.join(File.dirname(__FILE__), "calyptia_config_dumper.rb")]
105
+ else
106
+ [File.join(File.dirname(__FILE__), "calyptia_config_dumper.rb")]
107
+ end
108
+
109
+ retval = child_process_execute(:exec_calyptia_config_dumper, spawn_command, arguments: arguments, immediate: true,
110
+ env: {"FLUENT_CONFIG_PATH" => @cloud_monitoring.fluentd_conf_path}, parallel: true, mode: [:read_with_stderr],
111
+ on_exit_callback: callback) do |io|
112
+ io.set_encoding(Encoding::ASCII_8BIT)
113
+ conf = io.read
114
+ end
115
+ unless retval.nil?
116
+ begin
117
+ Timeout.timeout(10) do
118
+ sleep 0.1 until !conf.empty?
119
+ end
120
+ rescue Timeout::Error
121
+ log.warn "cannot retrive configuration contents on #{@cloud_monitoring.fluentd_conf_path} within 10 seconds."
122
+ end
123
+ end
124
+ conf
125
+ end
126
+
86
127
  def start
87
128
  super
88
129
 
@@ -93,13 +134,16 @@ module Fluent
93
134
  end
94
135
  raise Fluent::ConfigError, "cmetrics plugin should be used to collect metrics on Calyptia Cloud" unless enabled_cmetrics
95
136
  @monitor_agent = Fluent::Plugin::CalyptiaMonitoringExtInput.new
137
+ @monitor_agent_buffer = Fluent::Plugin::CalyptiaMonitoringBufferExtInput.new
96
138
  @api_requester = Fluent::Plugin::CalyptiaAPI::Requester.new(@cloud_monitoring.endpoint,
97
139
  @cloud_monitoring.api_key,
98
140
  log,
99
141
  fluentd_worker_id)
100
- if check_config_sending_usability
101
- @current_config = get_current_config_from_rpc
102
- end
142
+ @current_config = if !@cloud_monitoring.fluentd_conf_path.nil?
143
+ get_masked_conf_from_conf_file
144
+ elsif check_config_sending_usability
145
+ get_current_config_from_rpc
146
+ end
103
147
 
104
148
  if @cloud_monitoring.rate < 30
105
149
  log.warn "High frequency events ingestion is not supported. Set up 30s as ingestion interval"
@@ -222,6 +266,12 @@ module Fluent
222
266
  buffer += v
223
267
  end
224
268
  }
269
+ @monitor_agent_buffer.plugins_info_all(opts).each {|record|
270
+ metrics = record["metrics"]
271
+ metrics.each_pair do |k, v|
272
+ buffer += v
273
+ end
274
+ }
225
275
  if buffer.empty?
226
276
  log.debug "No initialized metrics is found. Trying to send cmetrics on the next tick."
227
277
  else
@@ -4,8 +4,10 @@
4
4
  </metrics>
5
5
  enable_input_metrics <%= @enable_input_metrics %>
6
6
  enable_size_metrics <%= @enable_size_metrics %>
7
+ <%- unless @disable_rpc -%>
7
8
  rpc_endpoint <%= @rpc_endpoint %>
8
9
  enable_get_dump <%= @enable_get_dump %>
10
+ <%- end -%>
9
11
  <system>
10
12
  <source>
11
13
  @type calyptia_monitoring
@@ -15,6 +17,9 @@
15
17
  endpoint <%= @endpoint %>
16
18
  <%- end -%>
17
19
  api_key <%= @api_key %>
20
+ <%- if @fluentd_conf_path -%>
21
+ fluentd_conf_path <%= @fluentd_conf_path %>
22
+ <%- end -%>
18
23
  </cloud_monitoring>
19
24
  <storage>
20
25
  @type local
@@ -192,6 +192,37 @@ TEXT
192
192
  path #{storage_dir}/agent_state
193
193
  </storage>
194
194
  </source>
195
+ TEXT
196
+ assert_equal(expected, dumped_config)
197
+ end
198
+
199
+ test "with api_key and fluentd_config_path" do
200
+ storage_dir = Dir.tmpdir
201
+ conf_dir = Dir.tmpdir
202
+ conf_path = File.join(conf_dir, "fluent.conf")
203
+ dumped_config = capture_stdout do
204
+ CalyptiaConfigGenerator.new(["YOUR_API_KEY", "--storage_agent_token_dir", storage_dir, "--fluentd-conf-path", conf_path]).call
205
+ end
206
+ expected =<<TEXT
207
+ <system>
208
+ <metrics>
209
+ @type cmetrics
210
+ </metrics>
211
+ enable_input_metrics true
212
+ enable_size_metrics false
213
+ <system>
214
+ <source>
215
+ @type calyptia_monitoring
216
+ @id input_caplyptia_monitoring
217
+ <cloud_monitoring>
218
+ api_key YOUR_API_KEY
219
+ fluentd_conf_path #{conf_path}
220
+ </cloud_monitoring>
221
+ <storage>
222
+ @type local
223
+ path #{storage_dir}/agent_state
224
+ </storage>
225
+ </source>
195
226
  TEXT
196
227
  assert_equal(expected, dumped_config)
197
228
  end
@@ -0,0 +1,29 @@
1
+ require "helper"
2
+ require "logger"
3
+ require "fluent/plugin/calyptia_monitoring_calyptia_api_requester"
4
+
5
+ class CalyptiaMonitoringMachineIdTest < Test::Unit::TestCase
6
+ API_KEY = 'YOUR_API_KEY'.freeze
7
+ API_ENDPOINT = "https://cloud-api.calyptia.com".freeze
8
+
9
+ setup do
10
+ @log = Logger.new($stdout)
11
+ worker_id = [1,2,3,4,5,6,7,8,9,10,11].sample
12
+ @api_requester = Fluent::Plugin::CalyptiaAPI::Requester.new(API_ENDPOINT,
13
+ API_KEY,
14
+ @log,
15
+ worker_id)
16
+ end
17
+
18
+ data("rc" => ["1.14.0.rc", "1.14.0-rc"],
19
+ "rc2" => ["1.14.0.rc2", "1.14.0-rc2"],
20
+ "alpha" => ["1.14.0.alpha", "1.14.0-alpha"],
21
+ "beta" => ["1.14.0.beta", "1.14.0-beta"],
22
+ "pre" => ["1.14.0.pre", "1.14.0-pre"],
23
+ )
24
+ def test_create_go_semver(data)
25
+ version, expected = data
26
+ actual = @api_requester.create_go_semver(version)
27
+ assert_equal expected, actual
28
+ end
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-calyptia-monitoring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.rc7
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Hatake
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-13 00:00:00.000000000 Z
11
+ date: 2021-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.13.0
61
+ version: 1.14.0
62
62
  - - "<"
63
63
  - !ruby/object:Gem::Version
64
64
  version: '2'
@@ -68,7 +68,7 @@ dependencies:
68
68
  requirements:
69
69
  - - ">="
70
70
  - !ruby/object:Gem::Version
71
- version: 1.13.0
71
+ version: 1.14.0
72
72
  - - "<"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '2'
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - ">="
80
80
  - !ruby/object:Gem::Version
81
- version: 0.1.0.rc3
81
+ version: 0.1.1
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: 0.1.0.rc3
88
+ version: 0.1.1
89
89
  description: Monitoring Fluentd via Calyptia Cloud
90
90
  email:
91
91
  - hatake@calyptia.com
@@ -102,6 +102,8 @@ files:
102
102
  - bin/calyptia-config-generator
103
103
  - fluent-plugin-calyptia-monitoring.gemspec
104
104
  - lib/fluent/command/config_generator.rb
105
+ - lib/fluent/plugin/calyptia_config_dumper.rb
106
+ - lib/fluent/plugin/calyptia_monitoring_buffer_ext.rb
105
107
  - lib/fluent/plugin/calyptia_monitoring_calyptia_api_requester.rb
106
108
  - lib/fluent/plugin/calyptia_monitoring_ext.rb
107
109
  - lib/fluent/plugin/calyptia_monitoring_machine_id.rb
@@ -109,13 +111,14 @@ files:
109
111
  - templates/calyptia-conf.erb
110
112
  - test/command/test_config_generator.rb
111
113
  - test/helper.rb
114
+ - test/plugin/test_calyptia_monitoring_calyptia_api_requester.rb
112
115
  - test/plugin/test_calyptia_montoring_machine_id.rb
113
116
  - test/plugin/test_in_calyptia_monitoring.rb
114
117
  homepage: https://github.com/calyptia/fluent-plugin-calyptia-monitoring
115
118
  licenses:
116
119
  - Apache-2.0
117
120
  metadata: {}
118
- post_install_message:
121
+ post_install_message:
119
122
  rdoc_options: []
120
123
  require_paths:
121
124
  - lib
@@ -126,16 +129,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
129
  version: '0'
127
130
  required_rubygems_version: !ruby/object:Gem::Requirement
128
131
  requirements:
129
- - - ">"
132
+ - - ">="
130
133
  - !ruby/object:Gem::Version
131
- version: 1.3.1
134
+ version: '0'
132
135
  requirements: []
133
- rubygems_version: 3.2.15
134
- signing_key:
136
+ rubygems_version: 3.2.22
137
+ signing_key:
135
138
  specification_version: 4
136
139
  summary: Monitoring Fluentd via Calyptia Cloud
137
140
  test_files:
138
141
  - test/command/test_config_generator.rb
139
142
  - test/helper.rb
143
+ - test/plugin/test_calyptia_monitoring_calyptia_api_requester.rb
140
144
  - test/plugin/test_calyptia_montoring_machine_id.rb
141
145
  - test/plugin/test_in_calyptia_monitoring.rb