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

🛤️ Tracking: Plugin Logging #933

Open
2 of 5 tasks
j-lanson opened this issue Feb 17, 2025 · 0 comments
Open
2 of 5 tasks

🛤️ Tracking: Plugin Logging #933

j-lanson opened this issue Feb 17, 2025 · 0 comments
Assignees
Labels
product: hc Relates to the core "hc" binary product: plugin Relates to one or more hipcheck-maintained plugins product: rust-sdk Relates to the Rust plugin SDK tracking-issue This issue tracks a larger task. type: enhancement New feature or request type: ui UI-related changes that should get heightened review.

Comments

@j-lanson
Copy link
Collaborator

j-lanson commented Feb 17, 2025

The goal is to provide some structure to plugin logging so that we can control it from the HC core. We will update plugin requirements to take a --log-level=<DEBUG/INFO/ETC> flag if they want to participate, and they will have to print out the logs in a JSON string format that we define, which includes the log level and parent/module. We then need to spawn a handler in HC core to listen for stderr, parse the JSON as it finds it, and forwards to the HC core logging subscriber. We first need to ensure this last part is possible, so it is the first subtask. Within HC core when we receive these messages, we can use tracing again to force the parent module to be plugin::<PLUGIN_NAME> so we can control whether the message gets printed with HC_LOG.
 

  • Investigate how we can collect stderr handles for each plugin subprocess in HC core
  • Replace log crate with tracing crate and subscriber in plugins through SDK
  • SDK tracing subscriber adds plugin parent, formats logs in JSON, prints to stderr, document format requirements
  • Introduce --log-level= cmdline flag for plugins and docment
  • Update Command::spawn in main to handle stderr output from plugins
@j-lanson j-lanson added product: hc Relates to the core "hc" binary product: plugin Relates to one or more hipcheck-maintained plugins product: rust-sdk Relates to the Rust plugin SDK tracking-issue This issue tracks a larger task. type: enhancement New feature or request type: ui UI-related changes that should get heightened review. labels Feb 17, 2025
@KirilldogU KirilldogU self-assigned this Feb 17, 2025
@j-lanson j-lanson moved this to In Progress in Hipcheck Product Roadmap Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: hc Relates to the core "hc" binary product: plugin Relates to one or more hipcheck-maintained plugins product: rust-sdk Relates to the Rust plugin SDK tracking-issue This issue tracks a larger task. type: enhancement New feature or request type: ui UI-related changes that should get heightened review.
Projects
Status: In Progress
Status: Todo
Development

No branches or pull requests

2 participants