-
Notifications
You must be signed in to change notification settings - Fork 30
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
trace [SLT-330] #3264
trace [SLT-330] #3264
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,11 +137,18 @@ | |
} | ||
|
||
func (r *receiptsProxyImpl) processRequest(ctx context.Context, rpcRequest rpc.Request, requestID []byte) (resp omniHTTP.Response, err error) { | ||
ctx, span := r.handler.Tracer().Start(ctx, "proxyrequest") | ||
defer func() { | ||
metrics.EndSpanWithErr(span, err) | ||
}() | ||
|
||
mixins.TxSubmitMixin(ctx, r.handler, rpcRequest) | ||
|
||
req := r.client.NewRequest() | ||
body, err := json.Marshal(rpcRequest) | ||
|
||
span.AddEvent("request marshaled", trace.WithAttributes(attribute.String("body", string(body)))) | ||
|
||
Comment on lines
+150
to
+151
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Improve test coverage for the added tracing event. The new tracing event in lines 150-151 is not covered by tests. Adding tests can ensure that this functionality is working correctly and help detect any issues early. Would you like help in creating tests for this code? 🧰 Tools🪛 GitHub Check: codecov/patch
|
||
//nolint: exhaustive | ||
switch client.RPCMethod(rpcRequest.Method) { | ||
case client.TransactionReceiptByHashMethod: | ||
|
@@ -192,6 +199,8 @@ | |
return nil, fmt.Errorf("could not get response from RPC %s: %w", r.proxyURL, err) | ||
} | ||
|
||
span.AddEvent("response returned", trace.WithAttributes(attribute.String("body", string(resp.Body())))) | ||
|
||
Comment on lines
+202
to
+203
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add tests for the new tracing event to improve test coverage. The tracing event added in lines 202-203 is not covered by tests, according to the static analysis tools. Please consider adding unit tests to cover this new functionality and enhance code reliability. Do you need assistance in writing tests for this code? 🧰 Tools🪛 GitHub Check: codecov/patch
|
||
return resp, nil | ||
} | ||
} |
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.
Increase test coverage for the new tracing code in
processRequest
.The tracing code added in lines 140-143 is not currently covered by tests, as indicated by the static analysis tools. Adding unit tests will help ensure that the tracing functionality works as expected and improve the reliability of the code.
Would you like assistance in writing unit tests for this code?
🧰 Tools
🪛 GitHub Check: codecov/patch