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 <shankeerthan1995@gmail.com>
kakkoyun
left a comment
There was a problem hiding this comment.
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.
| uploadDebugInfoAttemptsTotal: uploadDebugInfoAttemptsTotal, | |
| debugInfoUploadAttemptsTotal: uploadDebugInfoAttemptsTotal, |
There was a problem hiding this comment.
| uploadDebugInfoAttemptsTotal: uploadDebugInfoAttemptsTotal, | |
| debugInfoUploadAttemptsTotal: uploadDebugInfoAttemptsTotal, |
There was a problem hiding this comment.
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.
| uploadDebugInfoErrorsTotal: *uploadDebugInfoErrorsTotal, | |
| debugInfoUploadErrorsTotal: *uploadDebugInfoErrorsTotal, |
pkg/debuginfo/store.go
Outdated
| validationErrorsTotal: *validationErrorsTotal, | ||
| uploadDebugInfoAttemptsTotal: uploadDebugInfoAttemptsTotal, | ||
| uploadDebugInfoErrorsTotal: *uploadDebugInfoErrorsTotal, | ||
| uploadDebugInfoDuration: uploadDebugInfoDuration, |
There was a problem hiding this comment.
| uploadDebugInfoDuration: uploadDebugInfoDuration, | |
| debugInfoUploadDuration: uploadDebugInfoDuration, |
pkg/debuginfo/store.go
Outdated
| // 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.
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.
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.
We should encapsulate this in metadata types and files rather than here.
There was a problem hiding this comment.
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
Could you please clarify this?
There was a problem hiding this comment.
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.
@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 <shankeerthan1995@gmail.com>
|
@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 shankeerthan1995@gmail.com