-
Notifications
You must be signed in to change notification settings - Fork 6.6k
feat: adds various OCI metrics #25493
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
base: master
Are you sure you want to change the base?
feat: adds various OCI metrics #25493
Conversation
Signed-off-by: Patroklos Papapetrou <[email protected]>
🔴 Preview Environment stopped on BunnyshellSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
Signed-off-by: Patroklos Papapetrou <[email protected]>
Signed-off-by: Patroklos Papapetrou <[email protected]>
Signed-off-by: Patroklos Papapetrou <[email protected]>
Signed-off-by: Patroklos Papapetrou <[email protected]>
blakepettersson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #25493 +/- ##
==========================================
+ Coverage 62.45% 62.57% +0.11%
==========================================
Files 351 352 +1
Lines 49490 49622 +132
==========================================
+ Hits 30910 31049 +139
+ Misses 15621 15616 -5
+ Partials 2959 2957 -2 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Patroklos Papapetrou <[email protected]>
util/oci/client.go
Outdated
|
|
||
| // TestRepo verifies that the remote OCI repo can be connected to. | ||
| func (c *nativeOCIClient) TestRepo(ctx context.Context) (bool, error) { | ||
| defer c.OnTestRepo(c.repoURL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QQ: Do we need to first store this and then defer the execution of the function? like
| defer c.OnTestRepo(c.repoURL) | |
| f := c.OnTestRepo(c.repoURL) | |
| defer f() |
OnExtract, OnResolveRevision, OnDigestMetadata, OnGetTags, OnTestRepo seem to all return functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct :) addressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one remaining issue - in https://github.com/argoproj/argo-cd/pull/25493/files#diff-6234b055bc4370846988146ad1e76d381f6004c001407b881d1450f6fba2748eR55-R61 when processMetricFunc gets called startTime gets initiated.
In order to correctly calculate the span (ObserveOCIRequestDuration) between the start of the method and the very end of the method, we need to first get the initial function (e.g c.OnTestRepo(c.repoURL)). The actual execution of the returned function needs to happen at the very end of the method call with a defer
Signed-off-by: Patroklos Papapetrou <[email protected]>
Checklist:
closes #25378