-
Notifications
You must be signed in to change notification settings - Fork 245
feat(tracing): adding tracing to DA client #2968
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: cian/add-tracing-part-4
Are you sure you want to change the base?
Conversation
|
Claude finished @chatton's task in 1m 53s —— View job Code Review CompleteI've completed a comprehensive review of the tracing implementation for the DA client. Overall, this is a well-structured and clean implementation with good test coverage. Below are my findings organized by focus area. 1. Code Quality & Architecture ✅Strengths:
Issues: Minor: Inconsistent attribute namingLocation: The attribute naming is inconsistent:
Recommendation: Standardize on a consistent prefix pattern. Suggest: // Retrieve should use:
attribute.Int("namespace.length", len(namespace))
// instead of:
attribute.Int("ns.length", len(namespace))2. Error Handling & Resilience ✅Strengths:
Issues: Critical: Namespace conversion may panic on invalid UTF-8Location: attribute.String("da.namespace", string(namespace))Converting arbitrary byte slices to strings can produce invalid UTF-8, which may cause issues in some tracing backends. Namespaces are binary data, not necessarily UTF-8 strings. Recommendation: // Use hex encoding for binary data
attribute.String("da.namespace", hex.EncodeToString(namespace))
// Or use binary attribute if supported
attribute.String("da.namespace_hex", hex.EncodeToString(namespace))Minor: Custom submitError type is unnecessaryLocation: The Recommendation: // In Submit method, line 41:
span.RecordError(fmt.Errorf("DA submit failed: %s", res.Message))
// Instead of:
span.RecordError(&submitError{msg: res.Message})
// Remove the submitError type entirelyMinor: Missing height attribute on errorLocation: On success, the DA height is recorded as an attribute ( Recommendation: res := t.inner.Submit(ctx, data, gasPrice, namespace, options)
if res.Code != datypes.StatusSuccess {
span.RecordError(fmt.Errorf("DA submit failed: %s", res.Message))
span.SetStatus(codes.Error, res.Message)
if res.Height > 0 {
span.SetAttributes(attribute.Int64("da.height", int64(res.Height)))
}
} else {
span.SetAttributes(attribute.Int64("da.height", int64(res.Height)))
}3. Security ✅Strengths:
Considerations:
4. Performance & Resource Efficiency
|
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## cian/add-tracing-part-4 #2968 +/- ##
===========================================================
+ Coverage 57.76% 57.83% +0.06%
===========================================================
Files 97 98 +1
Lines 9306 9397 +91
===========================================================
+ Hits 5376 5435 +59
- Misses 3326 3358 +32
Partials 604 604
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Overview