fluent-plugin-kubernetes_metadata_filter 2.11.1 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/Gemfile.lock +25 -25
  4. data/README.md +5 -52
  5. data/doc/benchmark/5m-1-2500lps-256b-baseline-01/cpu.png +0 -0
  6. data/doc/benchmark/5m-1-2500lps-256b-baseline-01/latency.png +0 -0
  7. data/doc/benchmark/5m-1-2500lps-256b-baseline-01/loss.png +0 -0
  8. data/doc/benchmark/5m-1-2500lps-256b-baseline-01/mem.png +0 -0
  9. data/doc/benchmark/5m-1-2500lps-256b-baseline-01/readme.md +88 -0
  10. data/doc/benchmark/5m-1-2500lps-256b-baseline-01/results.html +127 -0
  11. data/doc/benchmark/5m-1-2500lps-256b-kube-01-01/cpu.png +0 -0
  12. data/doc/benchmark/5m-1-2500lps-256b-kube-01-01/latency.png +0 -0
  13. data/doc/benchmark/5m-1-2500lps-256b-kube-01-01/loss.png +0 -0
  14. data/doc/benchmark/5m-1-2500lps-256b-kube-01-01/mem.png +0 -0
  15. data/doc/benchmark/5m-1-2500lps-256b-kube-01-01/readme.md +97 -0
  16. data/doc/benchmark/5m-1-2500lps-256b-kube-01-01/results.html +136 -0
  17. data/doc/benchmark/5m-1-2500lps-256b-kube-01-marshal-02/cpu.png +0 -0
  18. data/doc/benchmark/5m-1-2500lps-256b-kube-01-marshal-02/latency.png +0 -0
  19. data/doc/benchmark/5m-1-2500lps-256b-kube-01-marshal-02/loss.png +0 -0
  20. data/doc/benchmark/5m-1-2500lps-256b-kube-01-marshal-02/mem.png +0 -0
  21. data/doc/benchmark/5m-1-2500lps-256b-kube-01-marshal-02/readme.md +97 -0
  22. data/doc/benchmark/5m-1-2500lps-256b-kube-01-marshal-02/results.html +136 -0
  23. data/fluent-plugin-kubernetes_metadata_filter.gemspec +3 -3
  24. data/lib/fluent/plugin/filter_kubernetes_metadata.rb +33 -103
  25. data/lib/fluent/plugin/kubernetes_metadata_cache_strategy.rb +2 -2
  26. data/lib/fluent/plugin/kubernetes_metadata_common.rb +1 -16
  27. data/lib/fluent/plugin/kubernetes_metadata_stats.rb +16 -0
  28. data/lib/fluent/plugin/kubernetes_metadata_util.rb +0 -20
  29. data/lib/fluent/plugin/kubernetes_metadata_watch_pods.rb +1 -1
  30. data/test/plugin/test_filter_kubernetes_metadata.rb +23 -420
  31. metadata +23 -6
  32. data/test/plugin/test_utils.rb +0 -56
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8ed17c405e64607d3fee4b581345f32388a7b1f52db9633d83e6863f6da5358
4
- data.tar.gz: e5d6002813b1ffb266b43eda059a2f7a6b050bb69162b52a48cf68e5bf116e7d
3
+ metadata.gz: 1d866c3ad5e90fce69d2f0d2f1e988cfbafe87ec8be406f9f694fba19ed2c89b
4
+ data.tar.gz: e952f47b62639f3afc4227647407fca4cbbbce166d97867894fb1e3f7402724c
5
5
  SHA512:
6
- metadata.gz: c39196e160ffbf56e328f1b4baf2ce61cafbb3152e1c1bfc109a445a78083ed4bd25f28f81356472dffb975a2905cd90ef951f33ba1777572e1b3c86810323cd
7
- data.tar.gz: 99377e8dbf5b6f95259b02ea923d22c1195fb582ac89ede2734fe29200305543e6916113ee49ec7c1fe6a4a839882038925925c724d662d27b5ef34f7bdeaf9e
6
+ metadata.gz: 294b181f0cf88d4b70f3dd1e5d840b3c13e0a0c8a9adde9f970cc6d12797ccb2a2e7cb49bf411d12665dd58c7e70138ee29b258af6dce4d7d18e67ba782c466f
7
+ data.tar.gz: 1b5865080a46ee7a8f7c634f7154070ff751eb9bea51f974f922cfcd7c13945ee8ae1aff15ff08f79239718126c192efce3c6b9292928d749250c586912d1f64
data/.gitignore CHANGED
@@ -7,7 +7,6 @@ vendor/
7
7
  InstalledFiles
8
8
  _yardoc
9
9
  coverage
10
- doc/
11
10
  lib/bundler/man
12
11
  pkg
13
12
  rdoc
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-kubernetes_metadata_filter (2.11.1)
5
- fluentd (>= 0.14.0, < 1.15)
4
+ fluent-plugin-kubernetes_metadata_filter (3.1.1)
5
+ fluentd (>= 0.14.0, < 1.16)
6
6
  kubeclient (>= 4.0.0, < 5.0.0)
7
7
  lru_redux
8
8
 
@@ -25,28 +25,28 @@ GEM
25
25
  docile (1.4.0)
26
26
  domain_name (0.5.20190701)
27
27
  unf (>= 0.0.5, < 1.0.0)
28
- escape_utils (1.2.1)
28
+ escape_utils (1.2.2)
29
29
  ffi (1.15.5)
30
30
  ffi-compiler (1.0.1)
31
31
  ffi (>= 1.0.0)
32
32
  rake
33
- fluentd (1.14.6)
33
+ fluentd (1.15.2)
34
34
  bundler
35
35
  cool.io (>= 1.4.5, < 2.0.0)
36
36
  http_parser.rb (>= 0.5.1, < 0.9.0)
37
37
  msgpack (>= 1.3.1, < 2.0.0)
38
- serverengine (>= 2.2.5, < 3.0.0)
38
+ serverengine (>= 2.3.0, < 3.0.0)
39
39
  sigdump (~> 0.2.2)
40
40
  strptime (>= 0.2.4, < 1.0.0)
41
41
  tzinfo (>= 1.0, < 3.0)
42
42
  tzinfo-data (~> 1.0)
43
43
  webrick (>= 1.4.2, < 1.8.0)
44
44
  yajl-ruby (~> 1.0)
45
- github-linguist (7.17.0)
45
+ github-linguist (7.21.0)
46
46
  charlock_holmes (~> 0.7.7)
47
47
  escape_utils (~> 1.2.0)
48
48
  mini_mime (~> 1.0)
49
- rugged (>= 0.25.1)
49
+ rugged (~> 1.0)
50
50
  hashdiff (1.0.1)
51
51
  http (4.4.1)
52
52
  addressable (~> 2.3)
@@ -62,7 +62,7 @@ GEM
62
62
  http_parser.rb (0.8.0)
63
63
  jsonpath (1.1.2)
64
64
  multi_json
65
- kubeclient (4.9.3)
65
+ kubeclient (4.10.0)
66
66
  http (>= 3.0, < 5.0)
67
67
  jsonpath (~> 1.0)
68
68
  recursive-open-struct (~> 1.1, >= 1.1.1)
@@ -73,38 +73,38 @@ GEM
73
73
  mime-types-data (3.2022.0105)
74
74
  mini_mime (1.1.2)
75
75
  minitest (4.7.5)
76
- msgpack (1.5.2)
76
+ msgpack (1.5.6)
77
77
  multi_json (1.15.0)
78
78
  netrc (0.11.0)
79
- parallel (1.21.0)
80
- parser (3.0.2.0)
79
+ parallel (1.22.1)
80
+ parser (3.1.2.0)
81
81
  ast (~> 2.4.1)
82
82
  power_assert (2.0.1)
83
- public_suffix (4.0.6)
84
- rainbow (3.0.0)
83
+ public_suffix (4.0.7)
84
+ rainbow (3.1.1)
85
85
  rake (13.0.6)
86
86
  recursive-open-struct (1.1.3)
87
- regexp_parser (2.1.1)
87
+ regexp_parser (2.5.0)
88
88
  rest-client (2.1.0)
89
89
  http-accept (>= 1.7.0, < 2.0)
90
90
  http-cookie (>= 1.0.2, < 2.0)
91
91
  mime-types (>= 1.16, < 4.0)
92
92
  netrc (~> 0.8)
93
93
  rexml (3.2.5)
94
- rr (3.0.8)
95
- rubocop (1.22.3)
94
+ rr (3.0.9)
95
+ rubocop (1.28.2)
96
96
  parallel (~> 1.10)
97
- parser (>= 3.0.0.0)
97
+ parser (>= 3.1.0.0)
98
98
  rainbow (>= 2.2.2, < 4.0)
99
99
  regexp_parser (>= 1.8, < 3.0)
100
100
  rexml
101
- rubocop-ast (>= 1.12.0, < 2.0)
101
+ rubocop-ast (>= 1.17.0, < 2.0)
102
102
  ruby-progressbar (~> 1.7)
103
103
  unicode-display_width (>= 1.4.0, < 3.0)
104
- rubocop-ast (1.12.0)
105
- parser (>= 3.0.1.1)
104
+ rubocop-ast (1.17.0)
105
+ parser (>= 3.1.1.0)
106
106
  ruby-progressbar (1.11.0)
107
- rugged (1.2.0)
107
+ rugged (1.4.3)
108
108
  serverengine (2.3.0)
109
109
  sigdump (~> 0.2.2)
110
110
  sigdump (0.2.4)
@@ -113,21 +113,21 @@ GEM
113
113
  simplecov-html (~> 0.11)
114
114
  simplecov_json_formatter (~> 0.1)
115
115
  simplecov-html (0.12.3)
116
- simplecov_json_formatter (0.1.3)
116
+ simplecov_json_formatter (0.1.4)
117
117
  strptime (0.2.5)
118
118
  test-unit (3.0.9)
119
119
  power_assert
120
120
  test-unit-rr (1.0.5)
121
121
  rr (>= 1.1.1)
122
122
  test-unit (>= 2.5.2)
123
- tzinfo (2.0.4)
123
+ tzinfo (2.0.5)
124
124
  concurrent-ruby (~> 1.0)
125
- tzinfo-data (1.2022.1)
125
+ tzinfo-data (1.2022.3)
126
126
  tzinfo (>= 1.0.0)
127
127
  unf (0.1.4)
128
128
  unf_ext
129
129
  unf_ext (0.0.8.2)
130
- unicode-display_width (2.1.0)
130
+ unicode-display_width (2.2.0)
131
131
  vcr (6.0.0)
132
132
  webmock (3.14.0)
133
133
  addressable (>= 2.8.0)
data/README.md CHANGED
@@ -7,8 +7,7 @@
7
7
 
8
8
  The Kubernetes metadata plugin filter enriches container log records with pod and namespace metadata.
9
9
 
10
- This plugin derives basic metadata about the container that emitted a given log record using the source of the log record. Records from journald provide metadata about the
11
- container environment as named fields. Records from JSON files encode metadata about the container in the file name. The initial metadata derived from the source is used
10
+ This plugin derives basic metadata about the container that emitted a given log record using the source of the log record. Records from kubernetes containers encode metadata about the container in the file name. The initial metadata derived from the source is used
12
11
  to lookup additional metadata about the container's associated pod and namespace (e.g. UUIDs, labels, annotations) when the kubernetes_url is configured. If the plugin cannot
13
12
  authoritatively determine the namespace of the container emitting a log record, it will use an 'orphan' namespace ID in the metadata. This behaviors supports multi-tenant systems
14
13
  that rely on the authenticity of the namespace for proper log isolation.
@@ -46,14 +45,6 @@ This must use named capture groups for `container_name`, `pod_name`, `namespace`
46
45
  * `cache_size` - size of the cache of Kubernetes metadata to reduce requests to the API server (default: `1000`)
47
46
  * `cache_ttl` - TTL in seconds of each cached element. Set to negative value to disable TTL eviction (default: `3600` - 1 hour)
48
47
  * `watch` - set up a watch on pods on the API server for updates to metadata (default: `true`)
49
- * *DEPRECATED*`de_dot` - replace dots in labels and annotations with configured `de_dot_separator`, required for Datadog and ElasticSearch 2.x compatibility (default: `true`)
50
- * *DEPRECATED*`de_dot_separator` - separator to use if `de_dot` is enabled (default: `_`)
51
- * *DEPRECATED*`de_slash` - replace slashes in labels and annotations with configured `de_slash_separator`, required for Datadog compatibility (default: `false`)
52
- * *DEPRECATED*`de_slash_separator` - separator to use if `de_slash` is enabled (default: `__`)
53
- * *DEPRECATED* `use_journal` - If false, messages are expected to be formatted and tagged as if read by the fluentd in\_tail plugin with wildcard filename. If true, messages are expected to be formatted as if read from the systemd journal. The `MESSAGE` field has the full message. The `CONTAINER_NAME` field has the encoded k8s metadata (see below). The `CONTAINER_ID_FULL` field has the full container uuid. This requires docker to use the `--log-driver=journald` log driver. If unset (the default), the plugin will use the `CONTAINER_NAME` and `CONTAINER_ID_FULL` fields
54
- if available, otherwise, will use the tag in the `tag_to_kubernetes_name_regexp` format.
55
- * `container_name_to_kubernetes_regexp` - The regular expression used to extract the k8s metadata encoded in the journal `CONTAINER_NAME` field default: See [code](https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter/blob/master/lib/fluent/plugin/filter_kubernetes_metadata.rb#L68)
56
- * This corresponds to the definition [in the source](https://github.com/kubernetes/kubernetes/blob/release-1.6/pkg/kubelet/dockertools/docker.go#L317)
57
48
  * `annotation_match` - Array of regular expressions matching annotation field names. Matched annotations are added to a log record.
58
49
  * `allow_orphans` - Modify the namespace and namespace id to the values of `orphaned_namespace_name` and `orphaned_namespace_id`
59
50
  when true (default: `true`)
@@ -67,10 +58,13 @@ when true (default: `true`)
67
58
  * `skip_container_metadata` - Skip some of the container data of the metadata. The metadata will not contain the container_image and container_image_id fields.
68
59
  * `skip_master_url` - Skip the master_url field from the metadata.
69
60
  * `skip_namespace_metadata` - Skip the namespace_id field from the metadata. The fetch_namespace_metadata function will be skipped. The plugin will be faster and cpu consumption will be less.
61
+ * `stats_interval` - The interval to display cache stats (default: 30s). Set to 0 to disable stats collection and logging
70
62
  * `watch_retry_interval` - The time interval in seconds for retry backoffs when watch connections fail. (default: `10`)
63
+ * `open_timeout` - The time in seconds to wait for a connection to kubernetes service. (default: `3`)
64
+ * `read_timeout` - The time in seconds to wait for a read from kubernetes service. (default: `10`)
71
65
 
72
66
 
73
- Reading from the JSON formatted log files with `in_tail` and wildcard filenames while respecting the CRI-o log format with the same config you need the fluent-plugin "multi-format-parser":
67
+ Reading from a JSON formatted log files with `in_tail` and wildcard filenames while respecting the CRI-o log format with the same config you need the fluent-plugin "multi-format-parser":
74
68
 
75
69
  ```
76
70
  fluent-gem install fluent-plugin-multi-format-parser
@@ -111,35 +105,6 @@ The config block could look like this:
111
105
  </match>
112
106
  ```
113
107
 
114
- Reading from the systemd journal (requires the fluentd `fluent-plugin-systemd` and `systemd-journal` plugins, and requires docker to use the `--log-driver=journald` log driver):
115
- ```
116
- <source>
117
- @type systemd
118
- path /run/log/journal
119
- pos_file journal.pos
120
- tag journal
121
- read_from_head true
122
- </source>
123
-
124
- # probably want to use something like fluent-plugin-rewrite-tag-filter to
125
- # retag entries from k8s
126
- <match journal>
127
- @type rewrite_tag_filter
128
- rewriterule1 CONTAINER_NAME ^k8s_ kubernetes.journal.container
129
- ...
130
- </match>
131
-
132
- <filter kubernetes.**>
133
- @type kubernetes_metadata
134
- use_journal true
135
- </filter>
136
-
137
- <match **>
138
- @type stdout
139
- </match>
140
- ```
141
-
142
-
143
108
  ## Environment variables for Kubernetes
144
109
 
145
110
  If the name of the Kubernetes node the plugin is running on is set as
@@ -199,18 +164,6 @@ Then output becomes as belows
199
164
  }
200
165
  ```
201
166
 
202
- If using journal input, from docker configured with `--log-driver=journald`, the input looks like the `journalctl -o export` format:
203
- ```
204
- # The stream identification is encoded into the PRIORITY field as an
205
- # integer: 6, or github.com/coreos/go-systemd/journal.Info, marks stdout,
206
- # while 3, or github.com/coreos/go-systemd/journal.Err, marks stderr.
207
- PRIORITY=6
208
- CONTAINER_ID=b6cbb6e73c0a
209
- CONTAINER_ID_FULL=b6cbb6e73c0ad63ab820e4baa97cdc77cec729930e38a714826764ac0491341a
210
- CONTAINER_NAME=k8s_registry.a49f5318_docker-registry-1-hhoj0_default_ae3a9bdc-1f66-11e6-80a2-fa163e2fff3a_799e4035
211
- MESSAGE=172.17.0.1 - - [21/May/2016:16:52:05 +0000] "GET /healthz HTTP/1.1" 200 0 "" "Go-http-client/1.1"
212
- ```
213
-
214
167
  ## Contributing
215
168
 
216
169
  1. Fork it
@@ -0,0 +1,88 @@
1
+
2
+ # collector Functionl Benchmark Results
3
+ ## Options
4
+ * Image: quay.io/openshift-logging/fluentd:1.14.6
5
+ * Total Log Stressors: 1
6
+ * Lines Per Second: 2500
7
+ * Run Duration: 5m
8
+ * Payload Source: synthetic
9
+
10
+ ## Latency of logs collected based on the time the log was generated and ingested
11
+
12
+ Total Msg| Size | Elapsed (s) | Mean (s)| Min(s) | Max (s)| Median (s)
13
+ ---------|------|-------------|---------|--------|--------|---
14
+ 705733|256|5m0s|16.929|1.826|36.399|14.956
15
+
16
+ ![](cpu.png)
17
+
18
+ ![](mem.png)
19
+
20
+ ![](latency.png)
21
+
22
+ ![](loss.png)
23
+
24
+ ## Percent logs lost between first and last collected sequence ids
25
+ Stream | Min Seq | Max Seq | Purged | Collected | Percent Collected |
26
+ -------| ---------| --------| -------|-----------|--------------|
27
+ | functional.0.0000000000000000DBCED7977B8F643F|0|716850|0|705733|98.4%
28
+
29
+
30
+ ## Config
31
+
32
+ ```
33
+
34
+ <system>
35
+ log_level debug
36
+ </system>
37
+
38
+ <source>
39
+ @type tail
40
+ @id container-input
41
+ path /var/log/pods/testhack-clwn63sc_*/loader-*/*
42
+ exclude_path ["/var/log/pods/**/*/*.gz","/var/log/pods/**/*/*.tmp"]
43
+ pos_file "/var/lib/fluentd/pos/containers-app"
44
+ refresh_interval 5
45
+ rotate_wait 5
46
+ tag kubernetes.*
47
+ read_from_head "true"
48
+ <parse>
49
+ @type regexp
50
+ expression /^(?<@timestamp>[^\s]+) (?<stream>stdout|stderr) (?<logtag>[F|P]) (?<message>.*)$/
51
+ time_format '%Y-%m-%dT%H:%M:%S.%N%:z'
52
+ keep_time_key true
53
+ </parse>
54
+ </source>
55
+
56
+ <filter kubernetes.**>
57
+ @type concat
58
+ key message
59
+ partial_key logtag
60
+ partial_value P
61
+ separator ''
62
+ </filter>
63
+
64
+ <match **>
65
+ @type forward
66
+ heartbeat_type none
67
+ keepalive true
68
+
69
+ <buffer>
70
+ flush_mode interval
71
+ flush_interval 5s
72
+ flush_at_shutdown true
73
+ flush_thread_count 2
74
+ retry_type exponential_backoff
75
+ retry_wait 1s
76
+ retry_max_interval 60s
77
+ retry_forever true
78
+ overflow_action block
79
+ </buffer>
80
+
81
+ <server>
82
+ host 0.0.0.0
83
+ port 24224
84
+ </server>
85
+ </match>
86
+
87
+ ```
88
+
@@ -0,0 +1,127 @@
1
+
2
+ <html>
3
+ <div>
4
+ <div><b>Options</b><div>
5
+ <div>Image: quay.io/openshift-logging/fluentd:1.14.6</div>
6
+ <div>Total Log Stressors: 1</div>
7
+ <div>Lines Per Second: 2500</div>
8
+ <div>Run Duration: 5m</div>
9
+ <div>Payload Source: synthetic</div>
10
+ </div>
11
+ <div>
12
+ Latency of logs collected based on the time the log was generated and ingested
13
+ </div>
14
+ <table border="1">
15
+ <tr>
16
+ <th>Total</th>
17
+ <th>Size</th>
18
+ <th>Elapsed</th>
19
+ <th>Mean</th>
20
+ <th>Min</th>
21
+ <th>Max</th>
22
+ <th>Median</th>
23
+ </tr>
24
+ <tr>
25
+ <th>Msg</th>
26
+ <th></th>
27
+ <th>(s)</th>
28
+ <th>(s)</th>
29
+ <th>(s)</th>
30
+ <th>(s)</th>
31
+ <th>(s)</th>
32
+ </tr>
33
+ <tr>
34
+ <td>705733</td>
35
+ <td>256</td>
36
+ <td>5m0s</td>
37
+ <td>16.929</td>
38
+ <td>1.826</td>
39
+ <td>36.399</td>
40
+ <td>14.956</td>
41
+ </tr>
42
+ </table>
43
+ <div>
44
+ <img src="cpu.png">
45
+ </div>
46
+ <div>
47
+ <img src="mem.png">
48
+ </div>
49
+ <div>
50
+ <img src="latency.png">
51
+ </div>
52
+ <div>
53
+ <img src="loss.png">
54
+ </div>
55
+ <div>
56
+ <table border="1">
57
+ <tr>
58
+ <th>Stream</th>
59
+ <th>Min Seq</th>
60
+ <th>Max Seq</th>
61
+ <th>Purged</th>
62
+ <th>Collected</th>
63
+ <th>Percent Collected</th>
64
+ </tr>
65
+ <tr>
66
+ <tr><td>functional.0.0000000000000000DBCED7977B8F643F</td><td>0</td><td>716850</td><td>0</td><td>705733</td><td>98.4%</td><tr>
67
+ </table>
68
+ </div>
69
+ <div>
70
+ <code style="display:block;white-space:pre-wrap">
71
+
72
+ &lt;system&gt;
73
+ log_level debug
74
+ &lt;/system&gt;
75
+
76
+ &lt;source&gt;
77
+ @type tail
78
+ @id container-input
79
+ path /var/log/pods/testhack-clwn63sc_*/loader-*/*
80
+ exclude_path [&#34;/var/log/pods/**/*/*.gz&#34;,&#34;/var/log/pods/**/*/*.tmp&#34;]
81
+ pos_file &#34;/var/lib/fluentd/pos/containers-app&#34;
82
+ refresh_interval 5
83
+ rotate_wait 5
84
+ tag kubernetes.*
85
+ read_from_head &#34;true&#34;
86
+ &lt;parse&gt;
87
+ @type regexp
88
+ expression /^(?&lt;@timestamp&gt;[^\s]+) (?&lt;stream&gt;stdout|stderr) (?&lt;logtag&gt;[F|P]) (?&lt;message&gt;.*)$/
89
+ time_format &#39;%Y-%m-%dT%H:%M:%S.%N%:z&#39;
90
+ keep_time_key true
91
+ &lt;/parse&gt;
92
+ &lt;/source&gt;
93
+
94
+ &lt;filter kubernetes.**&gt;
95
+ @type concat
96
+ key message
97
+ partial_key logtag
98
+ partial_value P
99
+ separator &#39;&#39;
100
+ &lt;/filter&gt;
101
+
102
+ &lt;match **&gt;
103
+ @type forward
104
+ heartbeat_type none
105
+ keepalive true
106
+
107
+ &lt;buffer&gt;
108
+ flush_mode interval
109
+ flush_interval 5s
110
+ flush_at_shutdown true
111
+ flush_thread_count 2
112
+ retry_type exponential_backoff
113
+ retry_wait 1s
114
+ retry_max_interval 60s
115
+ retry_forever true
116
+ overflow_action block
117
+ &lt;/buffer&gt;
118
+
119
+ &lt;server&gt;
120
+ host 0.0.0.0
121
+ port 24224
122
+ &lt;/server&gt;
123
+ &lt;/match&gt;
124
+
125
+ </code>
126
+ </div>
127
+ </html>
@@ -0,0 +1,97 @@
1
+
2
+ # collector Functionl Benchmark Results
3
+ ## Options
4
+ * Image: quay.io/openshift-logging/fluentd:1.14.6
5
+ * Total Log Stressors: 1
6
+ * Lines Per Second: 2500
7
+ * Run Duration: 5m
8
+ * Payload Source: synthetic
9
+
10
+ ## Latency of logs collected based on the time the log was generated and ingested
11
+
12
+ Total Msg| Size | Elapsed (s) | Mean (s)| Min(s) | Max (s)| Median (s)
13
+ ---------|------|-------------|---------|--------|--------|---
14
+ 606542|256|5m0s|32.779|1.295|75.390|31.641
15
+
16
+ ![](cpu.png)
17
+
18
+ ![](mem.png)
19
+
20
+ ![](latency.png)
21
+
22
+ ![](loss.png)
23
+
24
+ ## Percent logs lost between first and last collected sequence ids
25
+ Stream | Min Seq | Max Seq | Purged | Collected | Percent Collected |
26
+ -------| ---------| --------| -------|-----------|--------------|
27
+ | loader-0|0|606541|0|606542|100.0%
28
+
29
+
30
+ ## Config
31
+
32
+ ```
33
+ <system>
34
+ log_level debug
35
+ </system>
36
+
37
+ <source>
38
+ @type tail
39
+ @id container-input
40
+ path /var/log/pods/testhack-cyvquhgi_*/loader-*/*
41
+ exclude_path ["/var/log/pods/**/*/*.gz","/var/log/pods/**/*/*.tmp"]
42
+ pos_file "/var/lib/fluentd/pos/containers-app"
43
+ refresh_interval 5
44
+ rotate_wait 5
45
+ tag kubernetes.*
46
+ read_from_head "true"
47
+ <parse>
48
+ @type regexp
49
+ expression /^(?<@timestamp>[^\s]+) (?<stream>stdout|stderr) (?<logtag>[F|P]) (?<message>.*)$/
50
+ time_format '%Y-%m-%dT%H:%M:%S.%N%:z'
51
+ keep_time_key true
52
+ </parse>
53
+ </source>
54
+
55
+ <filter kubernetes.**>
56
+ @type concat
57
+ key message
58
+ partial_key logtag
59
+ partial_value P
60
+ separator ''
61
+ </filter>
62
+
63
+ <filter kubernetes.**>
64
+ @id kubernetes-metadata
65
+ @type kubernetes_metadata
66
+ kubernetes_url 'https://kubernetes.default.svc'
67
+ annotation_match ["^containerType\.logging\.openshift\.io\/.*$"]
68
+ allow_orphans false
69
+ cache_size '1000'
70
+ use_journal 'nil'
71
+ ssl_partial_chain 'true'
72
+ </filter>
73
+
74
+ <match **>
75
+ @type forward
76
+ heartbeat_type none
77
+ keepalive true
78
+
79
+ <buffer>
80
+ flush_mode interval
81
+ flush_interval 5s
82
+ flush_at_shutdown true
83
+ flush_thread_count 2
84
+ retry_type exponential_backoff
85
+ retry_wait 1s
86
+ retry_max_interval 60s
87
+ retry_forever true
88
+ overflow_action block
89
+ </buffer>
90
+
91
+ <server>
92
+ host 0.0.0.0
93
+ port 24224
94
+ </server>
95
+ </match>
96
+ ```
97
+