Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

add 'onefuzz debug log tail' #401

Merged
5 commits merged into from
Jan 4, 2021
Merged

Conversation

bmc-msft
Copy link
Contributor

@bmc-msft bmc-msft commented Dec 17, 2020

Adds onefuzz debug log tail <keyword>, which enables performing the same component in onefuzz debug log keyword <keyword> in a loop.

Optimizations:

  • only returns the N records at a time (default 1000)
  • each query only returns records that occur after the latest record received.
  • If no results are returned, waits 10s before retrying
  • Increases the wait time by 1.5x until the wait time is larger than 60s

Using --filter provides the ability to filter each record that comes back via jmespath.

Example uses:

Monitor any log messages (which ignores metrics) for a given job_id GUID

onefuzz debug logs tail bf4efdfd-685c-444a-81c5-d911477433ae --filter message

Log the job_id and task_id for each new unique report:

onefuzz debug logs tail new_unique_report --filter '[customDimensions.job_id, customDimensions.task_id]'

Log the job_id and task_id for each new unique report only for the specific job_id:

onefuzz debug logs tail "new_unique_report d5bcd4d2-4dab-49d5-a215-66db94fb0309" --filter '[customDimensions.job_id, customDimensions.task_id]'

src/cli/onefuzz/debug.py Outdated Show resolved Hide resolved
src/cli/onefuzz/debug.py Outdated Show resolved Hide resolved
@ghost
Copy link

ghost commented Jan 4, 2021

Hello @bmc-msft!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit f8f7e28 into microsoft:main Jan 4, 2021
@bmc-msft bmc-msft deleted the add-debug-log-tail branch January 20, 2021 11:11
@ghost ghost locked as resolved and limited conversation to collaborators Apr 17, 2021
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants