Refactor logging to remove logger, use fluentd with kubernetes filter (#380)

Remove the `logger` container from the logging daemonset. 

Remove the outgoing call from the poolmgr to the logger.  Use Fluentd's Kubernetes filter to add function name and UID to influx metadata.  

This means fluentd now figures out when to start collecting function logs on its own, without being informed by poolmgr.  This is great for other execution strategies, and for autoscaling, where fission isn't in direct control of function pod creation.

Also adds an integration test to make sure logging keeps working.
This commit is contained in:
prithviramesh
2017-11-14 18:08:57 -08:00
committed by Soam Vasani
parent 74e05ba3a1
commit 8b40ad0b33
13 changed files with 126 additions and 310 deletions
+8 -7
View File
@@ -96,14 +96,15 @@ func (influx InfluxDB) GetLogs(filter LogFilter) ([]LogEntry, error) {
log.Fatal(err)
}
logEntries = append(logEntries, LogEntry{
//The attributes of the LogEntry are selected as relative to their position in InfluxDB's line protocol response
Timestamp: t,
Container: row[2].(string),
FuncName: row[3].(string),
FuncUid: row[4].(string),
Message: strings.TrimSuffix(row[5].(string), "\n"),
Namespace: row[6].(string),
Pod: row[7].(string),
Stream: row[8].(string),
Container: row[2].(string), //docker_container_id
FuncName: row[8].(string), //kubernetes_labels_functionName
FuncUid: row[3].(string), //funcuid
Message: strings.TrimSuffix(row[17].(string), "\n"), //log field
Namespace: row[14].(string), //kubernetes_namespace_name
Pod: row[15].(string), //kubernetes_pod_name
Stream: row[18].(string), //stream
})
}
}