Closed jonatasbaldin closed 4 years ago
Hi @jonatasbaldin
OpenFaaS is not Kubernetes, and whilst we try to maintain a common user-experience where we can. The OpenFaaS CLI works with multiple backends such as Swarm, AWS Lambda and Hashicorp Nomad.
There may also be other Kubernetes log providers such as ELK and Loki, which may again have different semantics.
With that in mind, I'll move this issue to the correct repo (openfaas/faas-cli) and ping the author of the feature @LucasRoesler for his input.
Alex
Hey @alexellis, thanks for the answer :)
I understand that they are different tools and will probably have different experiences, it's just that I got a bit confused by the defaults, and maybe other users have as well.
Anyway, I would love the input from @LucasRoesler. If this proposal is suitable, I'd be keen to get involved in implementing it π€
Cheers π»
@alexellis and @jonatasbaldin I do not have an issue with changing the default. But... as Alex said, other systems have their own defaults, Loki defaults to 1hr ago. I can't find clear documentation on elasticsearch, but the Kibana UI uses 15 mins as the default.
It would be ideal to provide a consistent experience and have the clearly documented, to avoid surprises for users. Perhaps we can find out if/what the default experience in ELK is and then make a decision on a better default and then also clean up the docs. Even just finding and setting that default in the CLI will make it much clearer to users.
ELK experience is the Kibana UI, isn't it? Or is there a different default that I should look for?
I think once we settle in a default I could update whatever is necessary (CLI, docs, faas-netes).
Would you like to keep the 5 minutes or change it?
I think ELK would be the Kibana UI, I believe it is 15 mins. But if someone has more experience with it and can confirm, that would be good.
I think the argument could be made for any of 5min, 15min, or 1hr and I think increasing the default makes sense. 15mins probably is a nice balance. @alexellis any feelings on this?
The easiest way to do this is to define a default in the CLI, so that It will then apply to all backends.
Some quick comments -
So unless there are strong performance reasons or other, setting the default to 15 minutes is probably going to be familiar to a lot of admins.
Closing as inactive. Thanks all for your comments.
/lock
Expected Behaviour
When using
faas-cli logs
without any time flag, like--since
, expect the same behaviour askubectl logs
ordocker logs
, which is to show all the logs.Current Behaviour
The current behaviour of
faas-cli logs
in Kubernetes, without any time flag, is to output the latest 5 minutes of logs, as defined here.Possible Solution
The solution is to define the default log output from
faas-cli logs
to all logs (when no time flag is used).Steps to Reproduce (for bugs)
Using OpenFaaS with Kubernetes, do the following:
write_debug
enabled)faas-cli logs <fn-name>
, the logs should appearfaas-cli logs <fn-name>
, the logs won't appear anymorekubectl logs deployment/<fn-name> -n openfaas-fn
, the logs should appearContext
As an new user to OpenFaaS and coming from K8S, I expect the same behaviour in the tooling β at least in some aspects. With
logs
, for example, I was really confused whenkubectl logs
was "working" butfaas-cli logs
"wasn't".