fluent-plugin-containiq 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0ac5cbe86d69c5a71b112445037390c8b2aa3711b0e1a8c9d403a4d0bb1c5f8
4
- data.tar.gz: a67d1f017e124ad161fda905faac98bed490c678405312bd5a82a01ee114e0b8
3
+ metadata.gz: 3887ee226b158277ad98bb86a53a3b9f77f5bd4ece17832f40b2f63e32b8209d
4
+ data.tar.gz: b2edcafdaf2fd9b0e781fe4f76ebc0c74e182e226ba02dd6eeb79453029feb12
5
5
  SHA512:
6
- metadata.gz: 60f894974ff6ce7b229d857e69521f341402a473932d2c23c07ad2862ef56ffdd1c3947ff87dcadac6a0a84f5d558b6c1d5af90dedddc5c505abdb5a683a81a7
7
- data.tar.gz: baf145db919d170b7c0c8979c9f4c77f28a7c0d5d110faf044d723e6c01c85980bc49c35d74bf0ccb8569335838cfb4a3eea196d25eb0c47f8ad3bf70648636c
6
+ metadata.gz: a91f7c8f01f9ade710de5019729e28d8bd67e2a7571b9897f36b97fefa24bed5a4260359dd4b67f70c0ec4900f19481c6366075913a90c0562de34f31a3f78e4
7
+ data.tar.gz: c0940944e1a8c756db22f9deb7184124b6f308beeb2c9e69c2fc993a0035ca7cac2ef3c8b254a6150e9ad21dcb321c6c9bc419d1ff89650a76882868af5c00d9
@@ -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-containiq"
6
- spec.version = "1.0.1"
6
+ spec.version = "1.0.2"
7
7
  spec.authors = ["ContainIQ"]
8
8
  spec.email = ["matt@containiq.com"]
9
9
 
@@ -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: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ContainIQ
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-28 00:00:00.000000000 Z
11
+ date: 2021-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-http-persistent
@@ -143,6 +143,7 @@ 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
149
  homepage: https://www.containiq.com/