fluent-plugin-calyptia-monitoring 0.1.0.rc4 → 0.1.0.rc8
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 +4 -4
- data/README.md +25 -0
- data/bin/calyptia-config-generator +5 -0
- data/fluent-plugin-calyptia-monitoring.gemspec +1 -1
- data/lib/fluent/command/config_generator.rb +136 -0
- data/lib/fluent/plugin/calyptia_monitoring_calyptia_api_requester.rb +6 -6
- data/lib/fluent/plugin/calyptia_monitoring_machine_id.rb +4 -7
- data/lib/fluent/plugin/in_calyptia_monitoring.rb +2 -2
- data/templates/calyptia-conf.erb +23 -0
- data/test/command/test_config_generator.rb +199 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 071d15721bdabcee712ce74be5d1f7125458e97f79f88c8e1b30927d353a9f04
|
4
|
+
data.tar.gz: 8704372a766aeb87d7993cf7e42ff0b2a07b6927398a25ee125bda03d035315d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c8c50b693112a46959ee857d356a53957957fd1823eb4d98773765e7f3141535e0c3aac3e17e4cba80d930aea0f8b33e5174105955dfef0cb2d01a341ad05d1
|
7
|
+
data.tar.gz: 59a2cb53277e5bc524f5e18a534764252a523d94c3ce5b9e3fdd46214f5a61bb191398255fbcd99f858dc335ebd22f3537ba4b23fc76734bfb2720381dc7aa79
|
data/README.md
CHANGED
@@ -56,6 +56,9 @@ And enabling RPC and configDump endpoint is required if sending Fluentd configur
|
|
56
56
|
# If users want to use multi workers feature which corresponds to logical number of CPUs, please comment out this line.
|
57
57
|
# workers "#{require 'etc'; Etc.nprocessors}"
|
58
58
|
enable_input_metrics true
|
59
|
+
# This record size measuring settings might impact for performance.
|
60
|
+
# Please be careful for high loaded environment to turn on.
|
61
|
+
enable_size_metrics true
|
59
62
|
<metrics>
|
60
63
|
@type cmetrics
|
61
64
|
</metrics>
|
@@ -81,6 +84,28 @@ And enabling RPC and configDump endpoint is required if sending Fluentd configur
|
|
81
84
|
</source>
|
82
85
|
```
|
83
86
|
|
87
|
+
## Calyptia Monitoring API config generator
|
88
|
+
|
89
|
+
Usage:
|
90
|
+
|
91
|
+
```
|
92
|
+
Usage: calyptia-config-generator api_key [options]
|
93
|
+
|
94
|
+
Output plugin config definitions
|
95
|
+
|
96
|
+
Arguments:
|
97
|
+
api_key: Specify your API_KEY
|
98
|
+
|
99
|
+
Options:
|
100
|
+
--endpoint URL API Endpoint URL (default: nil, and if omitted, using default endpoint)
|
101
|
+
--rpc-endpoint URL Specify RPC Endpoint URL (default: 127.0.0.1:24444)
|
102
|
+
--disable-input-metrics Disable Input plugin metrics. Input metrics is enabled by default
|
103
|
+
--enable-size-metrics Enable event size metrics. Size metrics is disabled by default.
|
104
|
+
--disable-get-dump Disable RPC getDump procedure. getDump is enabled by default.
|
105
|
+
--storage-agent-token-dir DIR
|
106
|
+
Specify accesible storage token dir. (default: /path/to/accesible/dir)
|
107
|
+
```
|
108
|
+
|
84
109
|
## Copyright
|
85
110
|
|
86
111
|
* Copyright(c) 2021- Hiroshi Hatake
|
@@ -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.
|
6
|
+
spec.version = "0.1.0.rc8"
|
7
7
|
spec.authors = ["Hiroshi Hatake"]
|
8
8
|
spec.email = ["hatake@calyptia.com"]
|
9
9
|
|
@@ -0,0 +1,136 @@
|
|
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 "erb"
|
17
|
+
require "optparse"
|
18
|
+
require "pathname"
|
19
|
+
require "fluent/plugin"
|
20
|
+
require "fluent/env"
|
21
|
+
require "fluent/engine"
|
22
|
+
require "fluent/system_config"
|
23
|
+
require "fluent/config/element"
|
24
|
+
require 'fluent/version'
|
25
|
+
|
26
|
+
class CalyptiaConfigGenerator
|
27
|
+
def initialize(argv = ARGV)
|
28
|
+
@argv = argv
|
29
|
+
@api_key = nil
|
30
|
+
@endpoint = nil
|
31
|
+
@enable_input_metrics = true
|
32
|
+
@enable_size_metrics = false
|
33
|
+
@enable_get_dump = true
|
34
|
+
@rpc_endpoint = "127.0.0.1:24444"
|
35
|
+
@storage_agent_token_dir = default_storage_dir
|
36
|
+
|
37
|
+
prepare_option_parser
|
38
|
+
end
|
39
|
+
|
40
|
+
def default_storage_dir
|
41
|
+
if Fluent.windows?
|
42
|
+
"C:/path/to/accesible/dir"
|
43
|
+
else
|
44
|
+
"/path/to/accesible/dir"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def call
|
49
|
+
parse_options!
|
50
|
+
|
51
|
+
puts dump_configuration_for_calyptia
|
52
|
+
end
|
53
|
+
|
54
|
+
def dump_configuration_for_calyptia
|
55
|
+
dumped = ""
|
56
|
+
template = template_path("calyptia-conf.erb").read
|
57
|
+
|
58
|
+
dumped <<
|
59
|
+
if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
|
60
|
+
ERB.new(template, trim_mode: "-")
|
61
|
+
else
|
62
|
+
ERB.new(template, nil, "-")
|
63
|
+
end.result(binding)
|
64
|
+
dumped
|
65
|
+
end
|
66
|
+
private
|
67
|
+
|
68
|
+
def prepare_option_parser
|
69
|
+
@parser = OptionParser.new
|
70
|
+
@parser.version = Fluent::VERSION
|
71
|
+
@parser.banner = <<BANNER
|
72
|
+
Usage: #{$0} api_key [options]
|
73
|
+
|
74
|
+
Generate Calyptia monitoring plugin config definitions
|
75
|
+
|
76
|
+
Arguments:
|
77
|
+
\tapi_key: Specify your API_KEY
|
78
|
+
|
79
|
+
Options:
|
80
|
+
BANNER
|
81
|
+
@parser.on("--endpoint URL", "API Endpoint URL (default: nil, and if omitted, using default endpoint)") do |s|
|
82
|
+
@endpoint = s
|
83
|
+
end
|
84
|
+
@parser.on("--rpc-endpoint URL", "Specify RPC Endpoint URL (default: 127.0.0.1:24444)") do |s|
|
85
|
+
@rpc_endpoint = s
|
86
|
+
end
|
87
|
+
@parser.on("--disable-input-metrics", "Disable Input plugin metrics. Input metrics is enabled by default") do
|
88
|
+
@enable_input_metrics = false
|
89
|
+
end
|
90
|
+
@parser.on("--enable-size-metrics", "Enable event size metrics. Size metrics is disabled by default.") do
|
91
|
+
@enable_size_metrics = true
|
92
|
+
end
|
93
|
+
@parser.on("--disable-get-dump", "Disable RPC getDump procedure. getDump is enabled by default.") do
|
94
|
+
@enable_get_dump = false
|
95
|
+
end
|
96
|
+
@parser.on("--storage-agent-token-dir DIR", "Specify accesible storage token dir. (default: #{default_storage_dir})") do |s|
|
97
|
+
@storage_agent_token_dir = s
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def usage(message = nil)
|
102
|
+
puts @parser.to_s
|
103
|
+
puts
|
104
|
+
puts "Error: #{message}" if message
|
105
|
+
exit(false)
|
106
|
+
end
|
107
|
+
|
108
|
+
def parse_options!
|
109
|
+
@parser.parse!(@argv)
|
110
|
+
|
111
|
+
raise "Must specify api_key" unless @argv.size == 1
|
112
|
+
|
113
|
+
host, port = @rpc_endpoint.split(':')
|
114
|
+
if @enable_get_dump && (!host || !port)
|
115
|
+
puts "Error: invalid rpc_endpoint format. Specify `host:port' form."
|
116
|
+
exit(false)
|
117
|
+
end
|
118
|
+
|
119
|
+
@api_key, = @argv
|
120
|
+
@options = {
|
121
|
+
api_key: @api_key,
|
122
|
+
endpoint: @endpoint,
|
123
|
+
rpc_endpoint: @rpc_endpoint,
|
124
|
+
input_metrics: @enable_input_metrics,
|
125
|
+
size_metrics: @enable_size_metrics,
|
126
|
+
enable_get_dump: @enable_get_dump,
|
127
|
+
storage_agent_token_dir: @storage_agent_token_dir,
|
128
|
+
}
|
129
|
+
rescue => e
|
130
|
+
usage(e)
|
131
|
+
end
|
132
|
+
|
133
|
+
def template_path(name)
|
134
|
+
(Pathname(__dir__) + "../../../templates/#{name}").realpath
|
135
|
+
end
|
136
|
+
end
|
@@ -51,10 +51,10 @@ module Fluent::Plugin
|
|
51
51
|
metadata
|
52
52
|
end
|
53
53
|
|
54
|
-
# POST /
|
54
|
+
# POST /v1/agents
|
55
55
|
# Authorization: X-Project-Token
|
56
56
|
def create_agent(current_config)
|
57
|
-
url = URI("#{@endpoint}/
|
57
|
+
url = URI("#{@endpoint}/v1/agents")
|
58
58
|
|
59
59
|
https = if proxy = proxies
|
60
60
|
proxy_uri = URI.parse(proxy)
|
@@ -75,10 +75,10 @@ module Fluent::Plugin
|
|
75
75
|
return [response.code, agent, machine_id]
|
76
76
|
end
|
77
77
|
|
78
|
-
# PATCH /
|
78
|
+
# PATCH /v1/agents/:agent_id
|
79
79
|
# Authorization: X-Agent-Token
|
80
80
|
def update_agent(current_config, agent, machine_id)
|
81
|
-
url = URI("#{@endpoint}/
|
81
|
+
url = URI("#{@endpoint}/v1/agents/#{agent['id']}")
|
82
82
|
|
83
83
|
https = if proxy = proxies
|
84
84
|
proxy_uri = URI.parse(proxy)
|
@@ -100,10 +100,10 @@ module Fluent::Plugin
|
|
100
100
|
return [response.code, body]
|
101
101
|
end
|
102
102
|
|
103
|
-
# POST /
|
103
|
+
# POST /v1/agents/:agent_id/metrics
|
104
104
|
# Authorization: X-Agent-Token
|
105
105
|
def add_metrics(metrics, agent_token, agent_id)
|
106
|
-
url = URI("#{@endpoint}/
|
106
|
+
url = URI("#{@endpoint}/v1/agents/#{agent_id}/metrics")
|
107
107
|
|
108
108
|
https = if proxy = proxies
|
109
109
|
proxy_uri = URI.parse(proxy)
|
@@ -56,8 +56,7 @@ module Fluent::Plugin
|
|
56
56
|
@log.info "MachineID is not retrived from ioreg. Using UUID instead."
|
57
57
|
"#{SecureRandom.uuid}:#{@worker_id}"
|
58
58
|
else
|
59
|
-
#
|
60
|
-
"#{SecureRandom.hex(10)}_#{o.strip}:#{@worker_id}"
|
59
|
+
"#{o.strip}:#{@worker_id}"
|
61
60
|
end
|
62
61
|
end
|
63
62
|
|
@@ -65,15 +64,14 @@ module Fluent::Plugin
|
|
65
64
|
machine_id = ""
|
66
65
|
begin
|
67
66
|
machine_id = File.read(DBUS_MACHINE_ID_PATH).strip
|
68
|
-
rescue Errno::
|
67
|
+
rescue Errno::ENOENT
|
69
68
|
machine_id = File.read(ETC_MACHINE_ID_PATH).strip rescue ""
|
70
69
|
end
|
71
70
|
if machine_id.empty?
|
72
71
|
@log.info "MachineID is not retrived from #{DBUS_MACHINE_ID_PATH} or #{ETC_MACHINE_ID_PATH}. Using UUID instead."
|
73
72
|
"#{SecureRandom.uuid}:#{@worker_id}"
|
74
73
|
else
|
75
|
-
#
|
76
|
-
"#{SecureRandom.hex(10)}_#{machine_id}:#{@worker_id}"
|
74
|
+
"#{machine_id}:#{@worker_id}"
|
77
75
|
end
|
78
76
|
end
|
79
77
|
|
@@ -88,8 +86,7 @@ module Fluent::Plugin
|
|
88
86
|
@log.info "MachineID is not retrived from Registry. Using UUID instead."
|
89
87
|
"#{SecureRandom.uuid}:#{@worker_id}"
|
90
88
|
else
|
91
|
-
#
|
92
|
-
"#{SecureRandom.hex(10)}_#{machine_id}:#{@worker_id}"
|
89
|
+
"#{machine_id}:#{@worker_id}"
|
93
90
|
end
|
94
91
|
end
|
95
92
|
end
|
@@ -45,7 +45,7 @@ module Fluent
|
|
45
45
|
|
46
46
|
config_section :cloud_monitoring, multi: false, required: true do
|
47
47
|
desc 'The endpoint for Monitoring API HTTP request, e.g. http://example.com/api'
|
48
|
-
config_param :endpoint, :string, default: "https://cloud-
|
48
|
+
config_param :endpoint, :string, default: "https://cloud-api.calyptia.com"
|
49
49
|
desc 'The API KEY for Monitoring API HTTP request'
|
50
50
|
config_param :api_key, :string, secret: true
|
51
51
|
desc 'Emit monitoring values interval. (minimum interval is 30 seconds.)'
|
@@ -114,7 +114,7 @@ module Fluent
|
|
114
114
|
|
115
115
|
def create_agent(current_config)
|
116
116
|
code, agent, machine_id = @api_requester.create_agent(current_config)
|
117
|
-
if
|
117
|
+
if code.to_s.start_with?("2")
|
118
118
|
@storage_agent.put(:agent, agent)
|
119
119
|
@storage_agent.put(:machine_id, machine_id)
|
120
120
|
return true
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<system>
|
2
|
+
<metrics>
|
3
|
+
@type cmetrics
|
4
|
+
</metrics>
|
5
|
+
enable_input_metrics <%= @enable_input_metrics %>
|
6
|
+
enable_size_metrics <%= @enable_size_metrics %>
|
7
|
+
rpc_endpoint <%= @rpc_endpoint %>
|
8
|
+
enable_get_dump <%= @enable_get_dump %>
|
9
|
+
<system>
|
10
|
+
<source>
|
11
|
+
@type calyptia_monitoring
|
12
|
+
@id input_caplyptia_monitoring
|
13
|
+
<cloud_monitoring>
|
14
|
+
<%- if @endpoint -%>
|
15
|
+
endpoint <%= @endpoint %>
|
16
|
+
<%- end -%>
|
17
|
+
api_key <%= @api_key %>
|
18
|
+
</cloud_monitoring>
|
19
|
+
<storage>
|
20
|
+
@type local
|
21
|
+
path <%= @storage_agent_token_dir %>/agent_state
|
22
|
+
</storage>
|
23
|
+
</source>
|
@@ -0,0 +1,199 @@
|
|
1
|
+
require 'helper'
|
2
|
+
require 'tmpdir'
|
3
|
+
require 'fluent/command/config_generator'
|
4
|
+
|
5
|
+
class TestCalyptiaConfigGenerator < Test::Unit::TestCase
|
6
|
+
def stringio_stdout
|
7
|
+
out = StringIO.new
|
8
|
+
$stdout = out
|
9
|
+
yield
|
10
|
+
out.string.force_encoding('utf-8')
|
11
|
+
ensure
|
12
|
+
$stdout = STDOUT
|
13
|
+
end
|
14
|
+
|
15
|
+
def default_storage_dir
|
16
|
+
if Fluent.windows?
|
17
|
+
"C:/path/to/accesible/dir"
|
18
|
+
else
|
19
|
+
"/path/to/accesible/dir"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
sub_test_case "generate configuration" do
|
24
|
+
test "with only api_key" do
|
25
|
+
dumped_config = capture_stdout do
|
26
|
+
CalyptiaConfigGenerator.new(["YOUR_API_KEY"]).call
|
27
|
+
end
|
28
|
+
expected =<<TEXT
|
29
|
+
<system>
|
30
|
+
<metrics>
|
31
|
+
@type cmetrics
|
32
|
+
</metrics>
|
33
|
+
enable_input_metrics true
|
34
|
+
enable_size_metrics false
|
35
|
+
rpc_endpoint 127.0.0.1:24444
|
36
|
+
enable_get_dump true
|
37
|
+
<system>
|
38
|
+
<source>
|
39
|
+
@type calyptia_monitoring
|
40
|
+
@id input_caplyptia_monitoring
|
41
|
+
<cloud_monitoring>
|
42
|
+
api_key YOUR_API_KEY
|
43
|
+
</cloud_monitoring>
|
44
|
+
<storage>
|
45
|
+
@type local
|
46
|
+
path #{default_storage_dir}/agent_state
|
47
|
+
</storage>
|
48
|
+
</source>
|
49
|
+
TEXT
|
50
|
+
assert_equal(expected, dumped_config)
|
51
|
+
end
|
52
|
+
|
53
|
+
test "with api_key and enable_input_metrics" do
|
54
|
+
dumped_config = capture_stdout do
|
55
|
+
CalyptiaConfigGenerator.new(["YOUR_API_KEY", "--disable-input-metrics"]).call
|
56
|
+
end
|
57
|
+
expected =<<TEXT
|
58
|
+
<system>
|
59
|
+
<metrics>
|
60
|
+
@type cmetrics
|
61
|
+
</metrics>
|
62
|
+
enable_input_metrics false
|
63
|
+
enable_size_metrics false
|
64
|
+
rpc_endpoint 127.0.0.1:24444
|
65
|
+
enable_get_dump true
|
66
|
+
<system>
|
67
|
+
<source>
|
68
|
+
@type calyptia_monitoring
|
69
|
+
@id input_caplyptia_monitoring
|
70
|
+
<cloud_monitoring>
|
71
|
+
api_key YOUR_API_KEY
|
72
|
+
</cloud_monitoring>
|
73
|
+
<storage>
|
74
|
+
@type local
|
75
|
+
path #{default_storage_dir}/agent_state
|
76
|
+
</storage>
|
77
|
+
</source>
|
78
|
+
TEXT
|
79
|
+
assert_equal(expected, dumped_config)
|
80
|
+
end
|
81
|
+
|
82
|
+
test "with api_key and rpc-endpoint" do
|
83
|
+
dumped_config = capture_stdout do
|
84
|
+
CalyptiaConfigGenerator.new(["YOUR_API_KEY", "--rpc-endpoint", "localhost:24445"]).call
|
85
|
+
end
|
86
|
+
expected =<<TEXT
|
87
|
+
<system>
|
88
|
+
<metrics>
|
89
|
+
@type cmetrics
|
90
|
+
</metrics>
|
91
|
+
enable_input_metrics true
|
92
|
+
enable_size_metrics false
|
93
|
+
rpc_endpoint localhost:24445
|
94
|
+
enable_get_dump true
|
95
|
+
<system>
|
96
|
+
<source>
|
97
|
+
@type calyptia_monitoring
|
98
|
+
@id input_caplyptia_monitoring
|
99
|
+
<cloud_monitoring>
|
100
|
+
api_key YOUR_API_KEY
|
101
|
+
</cloud_monitoring>
|
102
|
+
<storage>
|
103
|
+
@type local
|
104
|
+
path #{default_storage_dir}/agent_state
|
105
|
+
</storage>
|
106
|
+
</source>
|
107
|
+
TEXT
|
108
|
+
assert_equal(expected, dumped_config)
|
109
|
+
end
|
110
|
+
|
111
|
+
test "with api_key and enable_size_metrics" do
|
112
|
+
dumped_config = capture_stdout do
|
113
|
+
CalyptiaConfigGenerator.new(["YOUR_API_KEY", "--enable-size-metrics"]).call
|
114
|
+
end
|
115
|
+
expected =<<TEXT
|
116
|
+
<system>
|
117
|
+
<metrics>
|
118
|
+
@type cmetrics
|
119
|
+
</metrics>
|
120
|
+
enable_input_metrics true
|
121
|
+
enable_size_metrics true
|
122
|
+
rpc_endpoint 127.0.0.1:24444
|
123
|
+
enable_get_dump true
|
124
|
+
<system>
|
125
|
+
<source>
|
126
|
+
@type calyptia_monitoring
|
127
|
+
@id input_caplyptia_monitoring
|
128
|
+
<cloud_monitoring>
|
129
|
+
api_key YOUR_API_KEY
|
130
|
+
</cloud_monitoring>
|
131
|
+
<storage>
|
132
|
+
@type local
|
133
|
+
path #{default_storage_dir}/agent_state
|
134
|
+
</storage>
|
135
|
+
</source>
|
136
|
+
TEXT
|
137
|
+
assert_equal(expected, dumped_config)
|
138
|
+
end
|
139
|
+
|
140
|
+
test "with api_key and disable_get_dump" do
|
141
|
+
dumped_config = capture_stdout do
|
142
|
+
CalyptiaConfigGenerator.new(["YOUR_API_KEY", "--disable-get-dump"]).call
|
143
|
+
end
|
144
|
+
expected =<<TEXT
|
145
|
+
<system>
|
146
|
+
<metrics>
|
147
|
+
@type cmetrics
|
148
|
+
</metrics>
|
149
|
+
enable_input_metrics true
|
150
|
+
enable_size_metrics false
|
151
|
+
rpc_endpoint 127.0.0.1:24444
|
152
|
+
enable_get_dump false
|
153
|
+
<system>
|
154
|
+
<source>
|
155
|
+
@type calyptia_monitoring
|
156
|
+
@id input_caplyptia_monitoring
|
157
|
+
<cloud_monitoring>
|
158
|
+
api_key YOUR_API_KEY
|
159
|
+
</cloud_monitoring>
|
160
|
+
<storage>
|
161
|
+
@type local
|
162
|
+
path #{default_storage_dir}/agent_state
|
163
|
+
</storage>
|
164
|
+
</source>
|
165
|
+
TEXT
|
166
|
+
assert_equal(expected, dumped_config)
|
167
|
+
end
|
168
|
+
|
169
|
+
test "with api_key and storage_agent_token_dir" do
|
170
|
+
storage_dir = Dir.tmpdir
|
171
|
+
dumped_config = capture_stdout do
|
172
|
+
CalyptiaConfigGenerator.new(["YOUR_API_KEY", "--storage_agent_token_dir", storage_dir]).call
|
173
|
+
end
|
174
|
+
expected =<<TEXT
|
175
|
+
<system>
|
176
|
+
<metrics>
|
177
|
+
@type cmetrics
|
178
|
+
</metrics>
|
179
|
+
enable_input_metrics true
|
180
|
+
enable_size_metrics false
|
181
|
+
rpc_endpoint 127.0.0.1:24444
|
182
|
+
enable_get_dump true
|
183
|
+
<system>
|
184
|
+
<source>
|
185
|
+
@type calyptia_monitoring
|
186
|
+
@id input_caplyptia_monitoring
|
187
|
+
<cloud_monitoring>
|
188
|
+
api_key YOUR_API_KEY
|
189
|
+
</cloud_monitoring>
|
190
|
+
<storage>
|
191
|
+
@type local
|
192
|
+
path #{storage_dir}/agent_state
|
193
|
+
</storage>
|
194
|
+
</source>
|
195
|
+
TEXT
|
196
|
+
assert_equal(expected, dumped_config)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
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.
|
4
|
+
version: 0.1.0.rc8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Hatake
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -89,7 +89,8 @@ dependencies:
|
|
89
89
|
description: Monitoring Fluentd via Calyptia Cloud
|
90
90
|
email:
|
91
91
|
- hatake@calyptia.com
|
92
|
-
executables:
|
92
|
+
executables:
|
93
|
+
- calyptia-config-generator
|
93
94
|
extensions: []
|
94
95
|
extra_rdoc_files: []
|
95
96
|
files:
|
@@ -98,11 +99,15 @@ files:
|
|
98
99
|
- LICENSE
|
99
100
|
- README.md
|
100
101
|
- Rakefile
|
102
|
+
- bin/calyptia-config-generator
|
101
103
|
- fluent-plugin-calyptia-monitoring.gemspec
|
104
|
+
- lib/fluent/command/config_generator.rb
|
102
105
|
- lib/fluent/plugin/calyptia_monitoring_calyptia_api_requester.rb
|
103
106
|
- lib/fluent/plugin/calyptia_monitoring_ext.rb
|
104
107
|
- lib/fluent/plugin/calyptia_monitoring_machine_id.rb
|
105
108
|
- lib/fluent/plugin/in_calyptia_monitoring.rb
|
109
|
+
- templates/calyptia-conf.erb
|
110
|
+
- test/command/test_config_generator.rb
|
106
111
|
- test/helper.rb
|
107
112
|
- test/plugin/test_calyptia_montoring_machine_id.rb
|
108
113
|
- test/plugin/test_in_calyptia_monitoring.rb
|
@@ -130,6 +135,7 @@ signing_key:
|
|
130
135
|
specification_version: 4
|
131
136
|
summary: Monitoring Fluentd via Calyptia Cloud
|
132
137
|
test_files:
|
138
|
+
- test/command/test_config_generator.rb
|
133
139
|
- test/helper.rb
|
134
140
|
- test/plugin/test_calyptia_montoring_machine_id.rb
|
135
141
|
- test/plugin/test_in_calyptia_monitoring.rb
|