fluent-plugin-metrics-cmetrics 0.1.0.rc3 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos-test.yml +0 -3
- data/.github/workflows/ubuntu-test.yml +0 -3
- data/.github/workflows/windows-test.yml +0 -3
- data/fluent-plugin-metrics-cmetrics.gemspec +2 -2
- data/lib/fluent/plugin/cmetrics/version.rb +1 -1
- data/lib/fluent/plugin/metrics_cmetrics.rb +17 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad64645abdd36ef6d6950fa565d744b2849f74b6255b571dae5e21ce13df8d24
|
4
|
+
data.tar.gz: a3cdc9fdef5e8443c4a8b6593cc626436ced183a5d6ba9d598b29607f6a042a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f762355693fd0d556aac69ad88419db69c1e16a1d0707239dacc8888e1334d6d83f111ddd59a9ee2b0adec98e29b660782f582963f095f4be35efff2b280b991
|
7
|
+
data.tar.gz: a6a4a82c626cfb3e5703ee51f958866fc4eb39a5763b7fc16091c67fd6441cf650a9d75ee4a7e64f01aa5d97cf0f98f70796703cd22b9aa937acf97783e46ea4
|
@@ -24,9 +24,6 @@ jobs:
|
|
24
24
|
uses: ruby/setup-ruby@v1
|
25
25
|
with:
|
26
26
|
ruby-version: ${{ matrix.ruby-version }}
|
27
|
-
- name: Set up Gemfile.local to use developing metrics plugin mechanism
|
28
|
-
run: |
|
29
|
-
echo 'gem "fluentd", github: "cosmo0920/fluentd", branch: "implement-metrics-plugin"' > Gemfile.local
|
30
27
|
- name: Run bundle install
|
31
28
|
run: bundle install
|
32
29
|
- name: Run the default task
|
@@ -24,9 +24,6 @@ jobs:
|
|
24
24
|
uses: ruby/setup-ruby@v1
|
25
25
|
with:
|
26
26
|
ruby-version: ${{ matrix.ruby-version }}
|
27
|
-
- name: Set up Gemfile.local to use developing metrics plugin mechanism
|
28
|
-
run: |
|
29
|
-
echo 'gem "fluentd", github: "cosmo0920/fluentd", branch: "implement-metrics-plugin"' > Gemfile.local
|
30
27
|
- name: Run bundle install
|
31
28
|
run: bundle install
|
32
29
|
- name: Run the default task
|
@@ -24,9 +24,6 @@ jobs:
|
|
24
24
|
uses: ruby/setup-ruby@v1
|
25
25
|
with:
|
26
26
|
ruby-version: ${{ matrix.ruby-version }}
|
27
|
-
- name: Set up Gemfile.local to use developing metrics plugin mechanism
|
28
|
-
run: |
|
29
|
-
echo 'gem "fluentd", github: "cosmo0920/fluentd", branch: "implement-metrics-plugin"' > Gemfile.local
|
30
27
|
- name: Run bundle install
|
31
28
|
run: ridk exec bundle install
|
32
29
|
- name: Run the default task
|
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
-
spec.add_runtime_dependency("cmetrics", ["
|
31
|
-
spec.add_runtime_dependency("fluentd", [">= 0.
|
30
|
+
spec.add_runtime_dependency("cmetrics", [">= 0.2.0"])
|
31
|
+
spec.add_runtime_dependency("fluentd", [">= 0.14.0", "< 2"])
|
32
32
|
|
33
33
|
spec.add_development_dependency("rake", ["~> 13.0"])
|
34
34
|
spec.add_development_dependency("test-unit", ["~> 3.4"])
|
@@ -23,13 +23,16 @@ module Fluent
|
|
23
23
|
class CMetricsMetrics < Metrics
|
24
24
|
Fluent::Plugin.register_metrics('cmetrics', self)
|
25
25
|
|
26
|
-
attr_reader :cmetrics
|
26
|
+
attr_reader :cmetrics, :_subsystem # _subsystem for testing.
|
27
|
+
|
28
|
+
config_param :enable_calyptia_metrics_mapping, :bool, default: true
|
27
29
|
|
28
30
|
def initialize
|
29
31
|
super
|
30
32
|
@cmetrics = nil
|
31
33
|
@default_labels_keys = []
|
32
34
|
@default_labels_values = []
|
35
|
+
@_subsystem = nil
|
33
36
|
end
|
34
37
|
|
35
38
|
def configure(conf)
|
@@ -60,6 +63,9 @@ module Fluent
|
|
60
63
|
end
|
61
64
|
|
62
65
|
def create(namespace:, subsystem:, name:, help_text:, labels: {})
|
66
|
+
if @enable_calyptia_metrics_mapping
|
67
|
+
subsystem = calyptia_metrics_subsystem_mapper(subsystem)
|
68
|
+
end
|
63
69
|
@cmetrics.create(namespace, subsystem, name, help_text, @labels_keys)
|
64
70
|
# Add specified in #create label(s) as static label(s).
|
65
71
|
unless labels.empty?
|
@@ -69,6 +75,16 @@ module Fluent
|
|
69
75
|
end
|
70
76
|
end
|
71
77
|
|
78
|
+
def calyptia_metrics_subsystem_mapper(subsystem)
|
79
|
+
case subsystem.to_s
|
80
|
+
when "buffer"
|
81
|
+
# Calyptia's service should handle buffer metrics as storage.
|
82
|
+
subsystem = "storage"
|
83
|
+
end
|
84
|
+
@_subsystem = subsystem
|
85
|
+
subsystem
|
86
|
+
end
|
87
|
+
|
72
88
|
def multi_workers_ready?
|
73
89
|
true
|
74
90
|
end
|
metadata
CHANGED
@@ -1,36 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-metrics-cmetrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Hatake
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cmetrics
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.2.0
|
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.
|
26
|
+
version: 0.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: fluentd
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.14.0
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: '2'
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
43
|
+
version: 0.14.0
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '2'
|
@@ -109,9 +109,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: 2.4.0
|
110
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
111
|
requirements:
|
112
|
-
- - "
|
112
|
+
- - ">="
|
113
113
|
- !ruby/object:Gem::Version
|
114
|
-
version:
|
114
|
+
version: '0'
|
115
115
|
requirements: []
|
116
116
|
rubygems_version: 3.2.22
|
117
117
|
signing_key:
|