fluent-plugin-containiq 0.0.8 → 1.0.3
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/fluent-plugin-containiq.gemspec +3 -3
- data/k8s/Gemfile +1 -1
- data/k8s/fluentd-daemonset.yaml +17 -0
- data/lib/fluent/plugin/out_containiq.rb +5 -0
- data/pull_request_template.md +31 -0
- data/test/plugin/test_out_containiq.rb +5 -5
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9eb2580e1dbbf929f72140634b9608e27f9de36e865bbff1187c441900b7c248
|
4
|
+
data.tar.gz: '0973ed78eb6d706c8f027b1f5cb6e78433132f6c953df689c450c2a81056cd66'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f51bbd0f492685931ac2ccd0e3411c5197cf587688ed0b42b57bb3238fe44ff02211fbb1299f893d4154cc5f2014d9bd51eadadaca145db4efa71e2d343a452a
|
7
|
+
data.tar.gz: d5bf4349adcdfc72e5735e86f92587dc0246e6e11ba2df10ac770e75ecd03bf929b9ea2d947c181d7e22b730b9f40b9edb15e9b92c2dc4c495aefd961d8677a9
|
@@ -3,13 +3,13 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = "fluent-plugin-containiq"
|
6
|
-
spec.version = "
|
6
|
+
spec.version = "1.0.3"
|
7
7
|
spec.authors = ["ContainIQ"]
|
8
8
|
spec.email = ["matt@containiq.com"]
|
9
9
|
|
10
10
|
spec.summary = "Fluentd output plugin that pushes logs to ContainIQ"
|
11
11
|
spec.description = "Fluentd output plugin that pushes logs to ContainIQ"
|
12
|
-
spec.homepage = "https://
|
12
|
+
spec.homepage = "https://www.containiq.com/"
|
13
13
|
spec.license = "Apache-2.0"
|
14
14
|
|
15
15
|
test_files, files = `git ls-files -z`.split("\x0").partition do |f|
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
23
|
spec.add_dependency 'net-http-persistent', '~> 4.0.1'
|
24
|
-
spec.add_development_dependency "bundler", "~> 2.
|
24
|
+
spec.add_development_dependency "bundler", "~> 2.3.7"
|
25
25
|
spec.add_development_dependency "rake", "~> 13.0.6"
|
26
26
|
spec.add_development_dependency "test-unit", "~> 3.4.7"
|
27
27
|
spec.add_development_dependency "webmock", "~> 3.14.0"
|
data/k8s/Gemfile
CHANGED
data/k8s/fluentd-daemonset.yaml
CHANGED
@@ -4,6 +4,14 @@ metadata:
|
|
4
4
|
name: containiq
|
5
5
|
---
|
6
6
|
apiVersion: v1
|
7
|
+
kind: ConfigMap
|
8
|
+
metadata:
|
9
|
+
name: cluster-config
|
10
|
+
namespace: containiq
|
11
|
+
data:
|
12
|
+
cluster-name: your-cluster-name
|
13
|
+
---
|
14
|
+
apiVersion: v1
|
7
15
|
kind: ServiceAccount
|
8
16
|
metadata:
|
9
17
|
name: fluentd
|
@@ -82,6 +90,15 @@ spec:
|
|
82
90
|
value: 'true'
|
83
91
|
- name: FLUENT_KUBERNETES_METADATA_SKIP_MASTER_URL
|
84
92
|
value: 'true'
|
93
|
+
- name: FLUENT_CONTAINER_TAIL_EXCLUDE_PATH
|
94
|
+
value: /var/log/containers/fluent*
|
95
|
+
- name: FLUENT_CONTAINER_TAIL_PARSER_TYPE
|
96
|
+
value: /^(?<time>.+) (?<stream>stdout|stderr)( (?<logtag>.))? (?<log>.*)$/
|
97
|
+
- name: CLUSTER_NAME
|
98
|
+
valueFrom:
|
99
|
+
configMapKeyRef:
|
100
|
+
name: cluster-config
|
101
|
+
key: cluster-name
|
85
102
|
resources:
|
86
103
|
limits:
|
87
104
|
memory: 200Mi
|
@@ -71,8 +71,13 @@ module Fluent::Plugin
|
|
71
71
|
def encode_chunk(chunk)
|
72
72
|
records = []
|
73
73
|
bulk_size = 0
|
74
|
+
cluster_name = ENV["CLUSTER_NAME"]
|
75
|
+
if cluster_name.nil?
|
76
|
+
cluster_name = "default"
|
77
|
+
end
|
74
78
|
chunk.each { |tag, time, record|
|
75
79
|
record['timestamp'] ||= Time.at(time).iso8601(3)
|
80
|
+
record['cluster'] ||= cluster_name
|
76
81
|
|
77
82
|
begin
|
78
83
|
json_record = Yajl.dump(record)
|
@@ -0,0 +1,31 @@
|
|
1
|
+
## Change description
|
2
|
+
|
3
|
+
> Description here
|
4
|
+
|
5
|
+
## Type of change
|
6
|
+
- [ ] Bug fix (fixes an issue)
|
7
|
+
- [ ] New feature (adds functionality)
|
8
|
+
- [ ] Other (repo management, deps, refactor, etc)
|
9
|
+
|
10
|
+
## Related issues
|
11
|
+
|
12
|
+
> Fix [#1]()
|
13
|
+
|
14
|
+
## Checklists
|
15
|
+
|
16
|
+
### Development
|
17
|
+
|
18
|
+
- [ ] Lint rules pass locally
|
19
|
+
- [ ] Application changes have been tested thoroughly
|
20
|
+
|
21
|
+
### Security
|
22
|
+
|
23
|
+
- [ ] Security impact of change has been considered
|
24
|
+
- [ ] Code follows company security practices and guidelines
|
25
|
+
|
26
|
+
### Code review
|
27
|
+
|
28
|
+
- [ ] Pull request has a descriptive title and context useful to a reviewer. Screenshots or screencasts are attached as necessary
|
29
|
+
- [ ] "Ready for review" label attached and reviewers assigned when applicable
|
30
|
+
- [ ] Changes have been reviewed by at least one other contributor when applicable
|
31
|
+
- [ ] Pull request linked to task tracker where applicable
|
@@ -12,6 +12,7 @@ class ContainiqOutputTest < Test::Unit::TestCase
|
|
12
12
|
end
|
13
13
|
|
14
14
|
@@ENDPOINT_URL = "https://mock-endpoint"
|
15
|
+
@@CLUSTER_NAME = "default"
|
15
16
|
@@API_KEY = 1234
|
16
17
|
|
17
18
|
sub_test_case "configuration" do
|
@@ -87,10 +88,9 @@ class ContainiqOutputTest < Test::Unit::TestCase
|
|
87
88
|
driver.run do
|
88
89
|
driver.feed('output.test', time.to_i, {'message' => 'Test message'})
|
89
90
|
end
|
90
|
-
|
91
91
|
assert_requested(
|
92
92
|
:post, @@ENDPOINT_URL, times: 1,
|
93
|
-
body: "[{\"message\":\"Test message\",\"timestamp\":\"#{time.strftime('%Y-%m-%dT%H:%M:%S.000%:z')}\"}]"
|
93
|
+
body: "[{\"message\":\"Test message\",\"timestamp\":\"#{time.strftime('%Y-%m-%dT%H:%M:%S.000%:z' )}\",\"cluster\":\"default\"}]"
|
94
94
|
)
|
95
95
|
assert_equal(1, driver.formatted.size)
|
96
96
|
end
|
@@ -116,9 +116,9 @@ class ContainiqOutputTest < Test::Unit::TestCase
|
|
116
116
|
assert_requested(
|
117
117
|
:post, @@ENDPOINT_URL, times: 1,
|
118
118
|
body: "[\
|
119
|
-
{\"message\":\"Test message 1\",\"timestamp\":\"#{time_isoformat}\"},\
|
120
|
-
{\"message\":\"Test message 2\",\"timestamp\":\"#{time_isoformat}\"},\
|
121
|
-
{\"message\":\"Test message 3\",\"timestamp\":\"#{time_isoformat}\"}]"
|
119
|
+
{\"message\":\"Test message 1\",\"timestamp\":\"#{time_isoformat}\",\"cluster\":\"default\"},\
|
120
|
+
{\"message\":\"Test message 2\",\"timestamp\":\"#{time_isoformat}\",\"cluster\":\"default\"},\
|
121
|
+
{\"message\":\"Test message 3\",\"timestamp\":\"#{time_isoformat}\",\"cluster\":\"default\"}]"
|
122
122
|
)
|
123
123
|
assert_equal(3, driver.formatted.size)
|
124
124
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-containiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ContainIQ
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-http-persistent
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: 2.3.7
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
40
|
+
version: 2.3.7
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,9 +143,10 @@ files:
|
|
143
143
|
- k8s/plugins/parser_kubernetes.rb
|
144
144
|
- k8s/plugins/parser_multiline_kubernetes.rb
|
145
145
|
- lib/fluent/plugin/out_containiq.rb
|
146
|
+
- pull_request_template.md
|
146
147
|
- test/helper.rb
|
147
148
|
- test/plugin/test_out_containiq.rb
|
148
|
-
homepage: https://
|
149
|
+
homepage: https://www.containiq.com/
|
149
150
|
licenses:
|
150
151
|
- Apache-2.0
|
151
152
|
metadata: {}
|