Skip to content
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(async_work): add async work duration and panic metrics #458

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

csfldf
Copy link
Collaborator

@csfldf csfldf commented Jan 24, 2024

feat(async_work): add async work duration and panic metrics

@csfldf csfldf self-assigned this Jan 24, 2024
@@ -116,6 +116,17 @@ func (aws *AsyncWorkers) handleWork(ctx context.Context, workName string, work *
defer func() {
if r := recover(); r != nil {
handleErr = fmt.Errorf("recover from %v", r)

metricErr := EmitCustomizedAsyncedMetrics(ctx,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will workName always be a valid metric-name? will it contain some non-supported characters?

Copy link
Collaborator Author

@csfldf csfldf Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to existing EmitAsyncedMetrics, I add another function EmitCustomizedAsyncedMetrics in this pr. And it accepts metric name as parameter. I use specified metric "name async_work_duration_ms" and "async_work_panic" in this pr and they are both valid names.

Copy link

codecov bot commented Jan 24, 2024

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (3c06012) 54.80% compared to head (39871f8) 54.78%.

Files Patch % Lines
pkg/util/asyncworker/async_workers.go 37.50% 14 Missing and 1 partial ⚠️
pkg/util/asyncworker/helpers.go 62.50% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #458      +/-   ##
==========================================
- Coverage   54.80%   54.78%   -0.02%     
==========================================
  Files         499      499              
  Lines       54534    54571      +37     
==========================================
+ Hits        29888    29898      +10     
- Misses      21419    21441      +22     
- Partials     3227     3232       +5     
Flag Coverage Δ
unittest 54.78% <47.50%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@csfldf csfldf added workflow/need-review review: test succeeded, need to review workflow/merge-ready merge-ready: code is ready and can be merged labels Jan 24, 2024
@csfldf csfldf merged commit 6f92275 into kubewharf:main Jan 24, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
workflow/merge-ready merge-ready: code is ready and can be merged workflow/need-review review: test succeeded, need to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants