Invoke docker actions with "--log-driver=fluentd --log-opt fluentd-address=hostIP" to collect real time logs from action containers
@sidfl15 are you suggesting this as an alternative way to drain action logs from their containers?
FYI @perryibm
Yeah, Using the docker's log driver, it would be easier for draining logs to centralized logging service in a distributed environment. (In case of fluentd driver--> drain it to fluentd deamon running on a separate host) For example, people using openwhisk with swift or other frameworks to make serverless applications would like to collect all the logs using fluentd or something. While running a action, if we can specify which log driver to use as an option would be great.
You may be interested in this as an example of how to drain your activation logs to an external sink: http://jamesthom.as/blog/2016/10/31/serverless-logs-with-elasticsearch/.
Thanks for the blog, using logstash is one way, but for using different log drivers from docker would give flexibility for all kinds of users. Moreover, with the option i am suggesting, there is no need to poll etc. It would be great if you can add the functionality.
I'll defer to @perryibm to comment - there are performance, stability and correctness reasons we dropped the docker driver.
In the past, we have tried several log drivers and have run into promptness issues. When output has to pass through docker itself and the volume of data is large, the output can be delayed significantly causing the invoker to be stalled. There is no guarantee after an action is finished that Docker has necessarily made the output available and the more complex the log driver, the greater the expected and actual delay. In a multi-tenant system that will be under a heavy and churning load, this problem can become severe and we ended up looking directly at the file system (/var/docker) to get the logs in the fastest possible manner so that writeback and end-to-end latency can be minimized.
Other issues with log-driver include memory leaks and interference with docker's global lock. There is a general pattern where the more logic has to run in docker, the slower basic docker operations can become. When we were using other log drivers and the system was under heavy load by churning containers as fast as possible, docker ps could take several seconds to respond making administrative tasks on the invoker unacceptably slow. It's possible that fluentd+docker1.12 no longer has these issues but it would be a very significant change that would require a lot of correctness (under load) and performance testing to prove no performance degradation.
Thank you for explaining the details. I guess for draining the logs to fluentd deamon, i would find some other way or instrumenting couchdb.
Not sure if you still need a solutions, but we do exactly this (set --log-driver etc) by using the extra-args config at https://github.com/apache/incubator-openwhisk/blob/d7c9fd661a8a5b339f20b3f549bfa4fa47124706/core/invoker/src/main/resources/application.conf#L55
(can we close this?)
I think that replies of Perry and Tyson are sufficient to close this issue. Please reopen if needed