Feature implementation from commits 68da54d..f7d81db#1
Conversation
…try#7411) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…p/dup` with new/old metrics (open-telemetry#7356) Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
…metry#7417) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…n-telemetry#7419) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…n-telemetry#7420) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
| wantRecording: logtest.Recording{ | ||
| logtest.Scope{Name: name}: []logtest.Record{ | ||
| buildRecord(log.StringValue(""), time.Time{}, log.SeverityWarn, nil), | ||
| want: logtest.Recording{ |
There was a problem hiding this comment.
🐛 Correctness Issue
Incorrect field name causing test failure.
The test case uses 'wantRecording' but the test function expects 'want', which would cause the test to fail.
Current Code (Diff):
- wantRecording: logtest.Recording{
+ want: logtest.Recording{📝 Committable suggestion
‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀
| want: logtest.Recording{ | |
| want: logtest.Recording{ |
| s.requestBodySize.Inst().Record(ctx, md.RequestSize, opts["new"].MeasurementOption()) | ||
| s.requestDuration.Inst().Record(ctx, md.ElapsedTime/1000, opts["new"].MeasurementOption()) |
There was a problem hiding this comment.
🐛 Correctness Issue
Nil pointer dereference risk.
Removing null checks for requestBodySize and requestDuration could cause runtime panics if HTTPClient is directly instantiated
Current Code (Diff):
+ if s.requestBodySize == nil || s.requestDuration == nil {
+ // This will happen if an HTTPClient{} is used instead of NewHTTPClient().
+ return
+ }
+
s.requestBodySize.Inst().Record(ctx, md.RequestSize, opts["new"].MeasurementOption())
s.requestDuration.Inst().Record(ctx, md.ElapsedTime/1000, opts["new"].MeasurementOption())📝 Committable suggestion
‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀
| s.requestBodySize.Inst().Record(ctx, md.RequestSize, opts["new"].MeasurementOption()) | |
| s.requestDuration.Inst().Record(ctx, md.ElapsedTime/1000, opts["new"].MeasurementOption()) | |
| if s.requestBodySize == nil || s.requestDuration == nil { | |
| // This will happen if an HTTPClient{} is used instead of NewHTTPClient(). | |
| return | |
| } | |
| s.requestBodySize.Inst().Record(ctx, md.RequestSize, opts["new"].MeasurementOption()) | |
| s.requestDuration.Inst().Record(ctx, md.ElapsedTime/1000, opts["new"].MeasurementOption()) |
| s.requestBodySizeHistogram.Inst().Record(ctx, md.RequestSize, *recordOpts...) | ||
| s.responseBodySizeHistogram.Inst().Record(ctx, md.ResponseSize, *recordOpts...) | ||
| s.requestDurationHistogram.Inst().Record(ctx, md.ElapsedTime/1000.0, o) |
There was a problem hiding this comment.
🐛 Correctness Issue
Potential Null Pointer Exception.
Removed null checks for histogram objects could cause application crashes if any histogram object is null when accessed
Current Code (Diff):
- s.requestBodySizeHistogram.Inst().Record(ctx, md.RequestSize, *recordOpts...)
- s.responseBodySizeHistogram.Inst().Record(ctx, md.ResponseSize, *recordOpts...)
- s.requestDurationHistogram.Inst().Record(ctx, md.ElapsedTime/1000.0, o)📝 Committable suggestion
‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀
| s.requestBodySizeHistogram.Inst().Record(ctx, md.RequestSize, *recordOpts...) | |
| s.responseBodySizeHistogram.Inst().Record(ctx, md.ResponseSize, *recordOpts...) | |
| s.requestDurationHistogram.Inst().Record(ctx, md.ElapsedTime/1000.0, o) | |
| if s.requestBodySizeHistogram != nil { | |
| s.requestBodySizeHistogram.Inst().Record(ctx, md.RequestSize, *recordOpts...) | |
| } | |
| if s.responseBodySizeHistogram != nil { | |
| s.responseBodySizeHistogram.Inst().Record(ctx, md.ResponseSize, *recordOpts...) | |
| } | |
| if s.requestDurationHistogram != nil { | |
| s.requestDurationHistogram.Inst().Record(ctx, md.ElapsedTime/1000.0, o) | |
| } |
This PR contains changes from a range of commits from the original repository.
Commit Range:
68da54d..f7d81dbFiles Changed: 82 (42 programming files)
Programming Ratio: 51.2%
Commits included:
... and 5 more commits