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

HTTP endpoint to tail job logs, stdout, and stderr #277

Closed
jippi opened this issue Oct 13, 2015 · 17 comments
Closed

HTTP endpoint to tail job logs, stdout, and stderr #277

jippi opened this issue Oct 13, 2015 · 17 comments
Labels
theme/api HTTP API and SDK issues type/enhancement

Comments

@jippi
Copy link
Contributor

jippi commented Oct 13, 2015

Would be a nice addition for easy debugging

I realise non-nomad version of this would be to pipe everything to syslog or similar, but it requires a few more moving parts

@cbednarski
Copy link
Contributor

@jippi Thanks for the suggestion. We would like to support this because it is a super convenient way to debug things on a small cluster. In a large scale environment we recommend using centralized logging.

@ghost
Copy link

ghost commented Oct 20, 2015

+1 On a side note, having the ability to shove this output somewhere in the job definition (like logspout with docker) for 12 factor apps would be nice.

@cbednarski cbednarski mentioned this issue Nov 20, 2015
@fernandezvara
Copy link

I would point to heka, since the docker log input allows to get all the logs with a simple configuration setting.

http://hekad.readthedocs.org/en/v0.10.0b1/config/inputs/docker_log.html

If you don't like to get the container name as log source, you can add any information you need from the environment variables. (Adding a name_from_env_var, like 'TASK_NAME' will return the value if found instead of the container name).

That way you have a centralized log easily without over configuration.

Hope this helps.

@cbednarski
Copy link
Contributor

From #475

Currently it seems there is no way to view the out put of a job other than using docker logs (if you are scheduling docker) on a individual container. it would be awesome if the logs were made available via a stream or something, this would also make for a useful ui feature in that you can see your jobs get allocated and see there output, perhaps even see the logs of all of the instances of a task in the same stream just tag for each instance.

@cbednarski
Copy link
Contributor

+1 On a side note, having the ability to shove this output somewhere in the job definition (like logspout with docker) for 12 factor apps would be nice.

@rvm2015 Our expectation is that you will have a log shipping agent setup on the host, or co-scheduled in your task group. Can you give us some specific examples of configuration you need to specify that is currently not available in Nomad?

@cbednarski cbednarski changed the title HTTP endpoint to tail job stdout and stderr HTTP endpoint to tail job logs, stdout, and stderr Nov 20, 2015
@supernomad
Copy link

@cbednarski I cannot speak for @rvm2015 however a simple use case for this would be getting the logs for said shipping agent without having to go to a node that is somewhere on your cluster to get them.

Also there are a lot of times where logs coming out of stdout/stderr or much different than the ones coming out via log files. This can be invaluable when trying to debug why an application seemingly inexplicably died.

@diptanu
Copy link
Contributor

diptanu commented Jan 20, 2016

@supernomad Our logging feature, coming with Nomad 0.3 will allow you to stream logs and view the file system of an allocation with Nomad cli. You won't need to go to a Node to stream logs out of the tasks running on allocations in that Node.

The UX is going to be something like this -

nomad logs <allod-id> <task-name> --stdout --follow
nomad alloc-fs-list <alloc-id> /path/to/dir/
nomad alloc-fs-cat <alloc-id> /path/to/file
nomad alloc-fs-stat <alloc-id> /path/to/file

Hope this works for you?

@supernomad
Copy link

@diptanu That will work perfectly, but I have two questions. First would there be a way to get the logs from all active allocations? Also, is there any kind of timeline on 0.3?

@diptanu
Copy link
Contributor

diptanu commented Jan 23, 2016

@supernomad Yes, you can get logs from all allocations which are still present on the nomad clients.

And regarding 0.3, very soon! We are getting into the crunch mode to get the release out.

@sheerun
Copy link
Contributor

sheerun commented Apr 14, 2016

@diptanu I'd prefer --follow flag to be added to fs cat instead to stream logs in custom locations as well.

@jrg72
Copy link

jrg72 commented Jun 15, 2016

Would there be any possibility this could be added to nomad? I'm trying to debug a particularly difficult issue with the Rkt driver and it would be very helpful to have this output while trying to determine if the problem is the ACI or the driver. Thank you.

@dadgar
Copy link
Contributor

dadgar commented Jun 15, 2016

Still on the roadmap! But won't be in 0.4.0

@type0lang
Copy link

+1. here i have a failed task with 0 stderr or stdout

nomad logs -stderr e3e3d705

@dadgar
Copy link
Contributor

dadgar commented Sep 13, 2016

Ah this is actually done! /v1/client/fs/logs.

@type0lang You may have that if it never produce logs because it failed to start (see nomad alloc-status) or the allocation may have been garbage collected

@dadgar dadgar closed this as completed Sep 13, 2016
@sheerun
Copy link
Contributor

sheerun commented Sep 13, 2016

@dadgar Ideally nomad logs would allow streaming any file, not only stderr / stdout. Sometimes logs are written in separate files, and sometimes we'd like to stream results / progress.

@dadgar
Copy link
Contributor

dadgar commented Sep 13, 2016

You can do that using nomad fs command. If you do -f it will follow the
file.
On Tue, Sep 13, 2016 at 12:27 PM Adam Stankiewicz [email protected]
wrote:

@dadgar https://github.com/dadgar Ideally nomad logs would allow
streaming any file, not only stderr / stdout. Sometimes logs are written in
separate files, and sometimes we'd like to stream results / progress.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#277 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_9ams8PFUussE8epiXDaUA-e6wlNfxks5qpvkNgaJpZM4GOCJj
.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/api HTTP API and SDK issues type/enhancement
Projects
None yet
Development

No branches or pull requests

9 participants