firecracker
firecracker copied to clipboard
Use component defined metrics
Design doc and more details here: github.com/andreeaflorescu/metrics-proposal.
This is particularly important for devices, so that we can break the dependency on the Firecracker specific logger
implementation. This can be achieved by having devices define their own metrics and take a dependency only on a Metric
trait that can be defined in vmm-sys-util
.
I believe this was solved by using the *Events traits, like SerialEvents
and RtcEvents
This is not resolved by using SerialEvents and RtcEvents, but that was indeed a good start.
The proposal was about restructuring how we are defining metrics to fix a few problems:
- Remove lazy_static, and move to a design where metrics are defined as an object on the Vmm. For the Firecracker case though we might need to have an
App
that contains bothVmm
and theApi
since both can use metrics, and should be able to have access to them. - Be able to run tests in parallel by not relying on a central metric object. If metrics are defined per component, then each unit test can initialize their own metric object, and thus the metrics are local to the test instead of being globally defined.
Here is the proposal, I see the link from the issue is no longer valid: https://github.com/andreeaflorescu/metrics-proposal
This approach can also be used to fix the problem that you are mentioning in #2893
Good point.
This approach can also be used to fix the problem that you are mentioning in https://github.com/firecracker-microvm/firecracker/pull/2893
In order to fully fix the thread-safety issues, multiple other issues need to be solved. Created a related issue: https://github.com/firecracker-microvm/firecracker/issues/2899