Add function log aggregation and persistence using Fluentd and InfluxDB. Fluentd and a helper sidecar run as a daemonset. The poolmgr sets up logging for each function pod, using the helper sidecar. Fluentd forwards logs to InfluxDB, which is run as a deployment and service. The client CLI directly queries InfluxDB for logs. Fluentd supports many outputs besides InfluxDB, so we aren't very tied to InfluxDB. The setup is somewhat manual, which we should be able to improve by integrating this into the helm chart. Diagram of component interactions: https://cloud.githubusercontent.com/assets/202578/23100399/b0e3ea00-f6ba-11e6-8f2f-6588cfef2e84.png
48 lines
1008 B
Plaintext
48 lines
1008 B
Plaintext
<match fluent.**>
|
|
type null
|
|
</match>
|
|
|
|
<source>
|
|
type tail
|
|
format json
|
|
time_key time
|
|
path /var/log/fission/*.log
|
|
time_format %Y-%m-%dT%H:%M:%S.%NZ
|
|
tag fission.*
|
|
read_from_head true
|
|
refresh_interval 5
|
|
</source>
|
|
|
|
<match fission.**>
|
|
type record_reformer
|
|
enable_ruby false
|
|
tag log
|
|
<record>
|
|
namespace ${tag_parts[4]}
|
|
pod ${tag_parts[5]}
|
|
container ${tag_parts[6]}
|
|
funcname ${tag_parts[7]}
|
|
funcuid ${tag_parts[8]}
|
|
</record>
|
|
</match>
|
|
|
|
<match **>
|
|
@type influxdb
|
|
host "#{ENV['INFLUXDB_ADDRESS']}"
|
|
port "#{ENV['INFLUXDB_PORT']}"
|
|
dbname "#{ENV['INFLUXDB_DBNAME']}"
|
|
user "#{ENV['INFLUXDB_USERNAME']}"
|
|
password "#{ENV['INFLUXDB_PASSWD']}"
|
|
use_ssl false
|
|
time_precision s
|
|
tag_keys ["funcuid", "pod"]
|
|
sequence_tag _seq
|
|
buffer_type file
|
|
buffer_path /var/log/fission/fluentd.buffer
|
|
buffer_chunk_limit 128m
|
|
buffer_queue_limit 256
|
|
flush_interval 5
|
|
retry_limit 10
|
|
retry_wait 1.0
|
|
num_threads 2
|
|
</match> |