fluent-plugin-metrics-cmetrics 0.1.0.rc3 → 0.1.0
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 +1 -1
- data/lib/fluent/plugin/cmetrics/version.rb +1 -1
- data/lib/fluent/plugin/metrics_cmetrics.rb +17 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b6130aa625bfc82f47c9bb4bfaf7791dc8a87804b0000c6d91465f8e80f05b8
|
4
|
+
data.tar.gz: f7e1eb86348886962946888ec9625590cc32bd617cdb65008fe5d1347df1d551
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d5c0566a4209f4f70990b923b17e3dbbed6dea5221d6c1386e57f99c090496c195c445616bd81bbe034bb9cc158db4592b4ff8fdbb5aa3c35d9939aaf43d056
|
7
|
+
data.tar.gz: cd12911dcbbb9ace4b6e4ad2f6fb1ceab2dfb4757b6dfad1cb4343b545bc1704ba7f27c2b1905523741d45d4b4d4385bfe5390c4bee5af562d21c091fdca981e
|
@@ -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
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
30
|
spec.add_runtime_dependency("cmetrics", ["~> 0.1.9"])
|
31
|
-
spec.add_runtime_dependency("fluentd", [">= 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,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-metrics-cmetrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Hatake
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cmetrics
|
@@ -30,7 +30,7 @@ dependencies:
|
|
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:
|