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

Tracing filter #3971

Conversation

JonathanWoollett-Light
Copy link
Contributor

@JonathanWoollett-Light JonathanWoollett-Light commented Jul 17, 2023

Changes

Add the FilterFn layer to support filtering by crate, module and span.
With tracing::instrument spans wrap functions, this would
support filtering to specific functions.

Reason

...

Status

Passes all tests except test_api_requests_logs. If the filter function is simply changed to always return true it passes this test, implying the issue relates to the filter being incorrect. I was thinking the filter level doesn't get updated from the default (Warn) to Info in time to print the log message, but adding a timeout between the API request to update the log level and the following API request where it expects to see the log doesn't appear to make any difference.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following
Developer Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@JonathanWoollett-Light JonathanWoollett-Light force-pushed the tracing-final branch 11 times, most recently from b280f78 to 07ee5c5 Compare July 18, 2023 15:33
@JonathanWoollett-Light JonathanWoollett-Light marked this pull request as ready for review July 18, 2023 15:37
@JonathanWoollett-Light JonathanWoollett-Light added Priority: Medium Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Enhancement Indicates new feature requests labels Jul 18, 2023
@JonathanWoollett-Light JonathanWoollett-Light force-pushed the tracing-final branch 14 times, most recently from 201fd3d to 77e333b Compare July 19, 2023 13:59
@JonathanWoollett-Light JonathanWoollett-Light force-pushed the tracing-final branch 13 times, most recently from 041ab1a to 05f8294 Compare August 13, 2023 23:36
@JonathanWoollett-Light
Copy link
Contributor Author

Blocked on #3808

@JonathanWoollett-Light JonathanWoollett-Light added Status: Blocked Indicates that an issue or pull request cannot currently be worked on and removed Status: Awaiting review Indicates that a pull request is ready to be reviewed labels Aug 14, 2023
@JonathanWoollett-Light JonathanWoollett-Light marked this pull request as draft August 14, 2023 00:00
@JonathanWoollett-Light JonathanWoollett-Light changed the title Tracing final Tracing filter Aug 14, 2023
@JonathanWoollett-Light JonathanWoollett-Light mentioned this pull request Aug 14, 2023
9 tasks
@JonathanWoollett-Light JonathanWoollett-Light force-pushed the tracing-final branch 4 times, most recently from d82168a to d6870c1 Compare August 17, 2023 13:42
Re-exports logging macros from `logger` to allow more atomic changes
in `logger`.

Signed-off-by: Jonathan Woollett-Light <[email protected]>
Jonathan Woollett-Light added 2 commits August 18, 2023 11:28
Replaces `log` with `tracing` and the custom logger with
`tracing_subscriber::Fmt`.

Adding support for re-configuring the logger at run-time and
removing the old logger format.

Signed-off-by: Jonathan Woollett-Light <[email protected]>
Add the ` FilterFn` layer to support filtering by crates, modules and
spans. With `tracing::instrument` spans wrap functions, this would
support filtering to specific functions.

Signed-off-by: Jonathan Woollett-Light <[email protected]>
@JonathanWoollett-Light
Copy link
Contributor Author

Moved to feature branch to store work for historical reference https://github.com/firecracker-microvm/firecracker/tree/feature/tokio-tracing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled Status: Blocked Indicates that an issue or pull request cannot currently be worked on Type: Enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants