Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shim for collecting logs #50

Merged
merged 2 commits into from Feb 23, 2020
Merged

Add shim for collecting logs #50

merged 2 commits into from Feb 23, 2020

Conversation

alexellis
Copy link
Member

@alexellis alexellis commented Feb 23, 2020

Signed-off-by: Alex Ellis (OpenFaaS Ltd) alexellis2@gmail.com

Description

Add shim for collecting logs

Motivation and Context

Experimental / WIP

faas-cli store deploy figlet --name f2

sudo journalctl -t openfaas-fn:f2
-- Logs begin at Wed 2020-02-19 21:46:03 GMT, end at Sun 2020-02-23 16:56:42 GMT. --
Feb 23 16:55:56 alexx openfaas-fn:f2[16011]: 2020/02/23 16:55:56 Version: 0.13.0        SHA: fa93655d90d1518b04e7cfca7d7548d7d133a34e
Feb 23 16:55:56 alexx openfaas-fn:f2[16011]: 2020/02/23 16:55:56 Read/write timeout: 5s, 5s. Port: 8080
Feb 23 16:55:56 alexx openfaas-fn:f2[16011]: 2020/02/23 16:55:56 Writing lock-file to: /tmp/.lock
Feb 23 16:55:56 alexx openfaas-fn:f2[16011]: 2020/02/23 16:55:56 Metrics server. Port: 8081
Feb 23 16:56:09 alexx openfaas-fn:f2[16011]: 2020/02/23 16:56:09 Forking fprocess.
Feb 23 16:56:09 alexx openfaas-fn:f2[16011]: 2020/02/23 16:56:09 Wrote 60 Bytes - Duration: 0.006864 seconds

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
The collect command redirects function logs to the journal for
viewing on journalctl. faas-cli logs is not implemented as of
yet. View logs with journalctl -t openfaas-fn:FN_NAME_HERE.

Tested on Dell XPS with Ubuntu Linux. The approach takes
inspiration from the Stellar project.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
@alexellis alexellis merged commit 2307fc7 into master Feb 23, 2020
@alexellis alexellis deleted the openfaasltd/add-logs branch February 23, 2020 19:54
@martindekov
Copy link
Contributor

I see the build fails here:

Server returned unexpected status code: 404 - error finding function figlet.: Get http://faasd-provider:8081/system/function/figlet?namespace=: dial tcp: i/o timeout

Not sure why faas-cli invokes the figlet function with this URL:

http://faasd-provider:8081/system/function/figlet?namespace=

I think this might be related with how the faas-cli invokes functions when no namespace is specified, or how the faasd handles the request. I will try to replicate both suggestions.

@alexellis
Copy link
Member Author

It's a timing issue I think. It's intermittent - so is downloading the CLI (failing often in this project 🤔)

Thanks for looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants