Add nydusd_image_info metric mapping daemons to served images#739
Open
Fricounet wants to merge 1 commit intocontainerd:mainfrom
Open
Add nydusd_image_info metric mapping daemons to served images#739Fricounet wants to merge 1 commit intocontainerd:mainfrom
Fricounet wants to merge 1 commit intocontainerd:mainfrom
Conversation
Add a new gauge metric mapping daemon IDs to served image references. For dedicated daemons this is 1:1, for shared daemons it is 1:N. The metric is collected on AddRafsInstance and deleted on RemoveRafsInstance. DestroyDaemon now also cleans up any remaining RAFS instances to handle error/forced-shutdown paths where individual Umount calls were skipped.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #739 +/- ##
==========================================
+ Coverage 22.02% 24.42% +2.39%
==========================================
Files 130 132 +2
Lines 11931 12249 +318
==========================================
+ Hits 2628 2992 +364
+ Misses 8960 8893 -67
- Partials 343 364 +21
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Currently, there's no way to map a daemon id to an image ref using the prometheus metrics which makes debugging a bit cumbersome.
Add a new Prometheus gauge metric
nydusd_image_infothat maps nydus daemon IDsto the image references they serve. For dedicated daemons this is a 1:1 mapping;
for shared daemons it is 1:N.
Related Issues
None.
Change Details
nydusd_image_infogauge with labels{daemon_id, image_ref}, set to 1for each active daemon-to-image association.
AddRafsInstanceand deleted inRemoveRafsInstance.DestroyDaemonnow callsRemoveRafsInstancefor any remaining RAFS instancesbefore
UmountRafsInstances, covering error/forced-shutdown paths whereindividual
Umountcalls were skipped.Test Results
Tested locally, metrics are added as expected and cleaned up when the image is removed:
Change Type
Self-Checklist