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

Fixes issue #23 #26

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fixes issue #23 #26

wants to merge 4 commits into from

Conversation

imron
Copy link
Contributor

@imron imron commented Sep 7, 2018

This addresses issue #23

@imron
Copy link
Contributor Author

imron commented Dec 4, 2018

Added a download-log command to download a log file from the server.

The command requires a --serverHost and a --logfile parameter, and will stream the entire log to stdout. --start and --end can optionally be provided to limit the time to a specific period. logfiles that don't begin with a / are assumed to be relative to /var/log/scalyr-agent-2

Example usage (assuming scalyr_server and scalyr_readlog_token env vars are set):

./scalyr download-log --serverHost scalyr-agent-2-4k9c5 --logfile agent.callgrind

@janithkv
Copy link
Contributor

@imron , I am assuming this PR is still valid ?

Just a general comment,
Should we make this more general as just --download option and allow a --query parameter instead of restricting this to downloading log files ? We could also limit the downloads to a max size maybe?

The real power of the feature seems to be the ability to support continuationToken. But I might be missing context

@imron
Copy link
Contributor Author

imron commented Mar 27, 2020

It is still valid, but in my local version I've also added a delay option to avoid making too many continuation requests in a short period of time.

For context, the main purpose of this feature for me was to help when doing remote profiling of the agent on a customer's network.

The agent has an option to dynamically enable code profiling, which is output as a callgraph file and uploaded as a log file of the customer's account. If they give us access to that file, then I use this feature to download the callgraph file for analysis. This helps remove customer support roundtrips during debug and analysis, because the customer only needs to enable the profiling flag, and I can do all the rest without their intervention.

The continuationToken support is definitely an important part of this (I needed to download the entire file), but I don't think it's worth adding a --query parameter because there is already a query command that does more or less the same thing - except it doesn't have continuationToken support.

The downloadLog command was really just a shortcut for myself so I didn't need to keep manually constructing a query. I'd like to see it hang around as a specific command (it simplifies my use case) but it's probably worth extending the query command to support continuation tokens.

@imron
Copy link
Contributor Author

imron commented Mar 27, 2020

Also, I've just realized that the original PR only included commit 030a8f4, but then because it was never merged, and because it was done on master, master now includes the downloadLog feature from my current branch also.

@janithkv
Copy link
Contributor

@imron , agreed, could you update the PR with the local changes and then update the README also? We can get this merged in :)

@imron
Copy link
Contributor Author

imron commented Apr 1, 2020

Done and done.

Copy link
Contributor

@janithkv janithkv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sry about the delay in approval .

@imron
Copy link
Contributor Author

imron commented Apr 16, 2020

No worries. It seems I don't have write access to this repository, so someone else will need to merge it in.

@imron
Copy link
Contributor Author

imron commented Jul 24, 2020

Any update on this? It will soon be my last day at scalyr (31 July), and it might be a good idea to merge before then.

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.

2 participants