-
Notifications
You must be signed in to change notification settings - Fork 227
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
feat: add metrics for debuginfo #1704
base: main
Are you sure you want to change the base?
Conversation
1. errors and attempts for uploading debuginfo 2. errors and attempts for updating metadata 3. time taken for uploading debuginfo, updating metdata, and, exists check Signed-off-by: shankeerthan-kasilingam <[email protected]>
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.
Looking good. Thanks for handling this.
I think we can be more consistent with the variable naming.
And as far as I can tell, we don't increment error metrics every error returns. Let's make sure we cover everything.
You might also want to consider extracting validation logic to the helper function fro ease of instrumenting.
pkg/debuginfo/store.go
Outdated
metadataUpdateDuration: metadataUpdateDuration, | ||
validationAttemptsTotal: validationAttemptsTotal, | ||
validationErrorsTotal: *validationErrorsTotal, | ||
uploadDebugInfoAttemptsTotal: uploadDebugInfoAttemptsTotal, |
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.
uploadDebugInfoAttemptsTotal: uploadDebugInfoAttemptsTotal, | |
debugInfoUploadAttemptsTotal: uploadDebugInfoAttemptsTotal, |
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.
uploadDebugInfoAttemptsTotal: uploadDebugInfoAttemptsTotal, | |
debugInfoUploadAttemptsTotal: uploadDebugInfoAttemptsTotal, |
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.
Thanks for the suggestion. I'll make the changes.
pkg/debuginfo/store.go
Outdated
validationAttemptsTotal: validationAttemptsTotal, | ||
validationErrorsTotal: *validationErrorsTotal, | ||
uploadDebugInfoAttemptsTotal: uploadDebugInfoAttemptsTotal, | ||
uploadDebugInfoErrorsTotal: *uploadDebugInfoErrorsTotal, |
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.
uploadDebugInfoErrorsTotal: *uploadDebugInfoErrorsTotal, | |
debugInfoUploadErrorsTotal: *uploadDebugInfoErrorsTotal, |
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.
+1. will make the changes
pkg/debuginfo/store.go
Outdated
validationErrorsTotal: *validationErrorsTotal, | ||
uploadDebugInfoAttemptsTotal: uploadDebugInfoAttemptsTotal, | ||
uploadDebugInfoErrorsTotal: *uploadDebugInfoErrorsTotal, | ||
uploadDebugInfoDuration: uploadDebugInfoDuration, |
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.
uploadDebugInfoDuration: uploadDebugInfoDuration, | |
debugInfoUploadDuration: uploadDebugInfoDuration, |
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.
will make the changes
pkg/debuginfo/store.go
Outdated
@@ -253,7 +329,9 @@ func (s *Store) upload(ctx context.Context, buildID, hash string, r io.Reader) e | |||
|
|||
// At this point we know that we received a better version of the debug information file, | |||
// so let the client upload it. | |||
|
|||
defer func(begin time.Time) { |
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.
I don't think this is semantically correct. There are lots of other operations happening in the rest of the method.
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.
yes. thanks for correcting it. I think I cannot use defer
here. I'll update the PR
pkg/debuginfo/store.go
Outdated
|
||
validationAttemptsTotal prometheus.Counter | ||
validationErrorsTotal prometheus.CounterVec | ||
metadataUpdateDuration prometheus.Histogram |
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.
We should encapsulate this in metadata types and files rather than here.
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.
A small doubt on this. I think We can move metadataUpdateDuration
to metadata.go and encapsulate inside ObjectStoreMetadata struct
. I'm not sure this comment for validationAttemptsTotal
and validationErrorsTotal
. Currently validation metrics are around this
Line 302 in 573a48d
if err := elfutils.ValidateFile(objFile); err != nil { |
Could you please clarify this?
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.
Maybe we don't need those at all. Considering we'll always try to validate these files, maybe just having the duration is enough. What do you think?
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.
@ksankeerth, I think we can get rid of additional validation attempts and error metrics. And add additional reason ("validation") to the actual action metrics (e.g upload).
nice. It's clear now. I'll update the PR
Thanks for reviewing the PR. I'll check the comments and update the PR |
Just some clarifications needed on this(sorry if it's a dump question). Line 85 in 573a48d
Line 88 in 573a48d
Two error metrics are used here. I increase the error metrics with reason before return if it's related to the metrics we measure. Is this correct? or in any places did i increase error metrics irrelevantly? (may be this location Line 321 in 573a48d
|
If I'm going to extract validation logic to a function, Can I extract the below code inside a function in store.go? Lines 302 to 327 in 573a48d
|
@ksankeerth, I think we can get rid of additional validation attempts and error metrics. And add additional reason ("validation") to the actual action metrics (e.g upload). |
You can extract it. I would prefer the metadata update logic outside the function on the call site, though. |
Signed-off-by: shankeerthan-kasilingam <[email protected]>
@kakkoyun I have done following changes
Please check the new changes.Thanks |
Hi Parca team,
I tried to fix #1275. Not sure I have covered everything mentioned in #1275. Please check and let me know if anything else to be added in this PR.
I have added metrics for..
I'm not sure what exactly I have to do for below metrics. Will you be able to guide me?
Fixes #1275
Signed-off-by: shankeerthan-kasilingam [email protected]