-
Notifications
You must be signed in to change notification settings - Fork 32
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 txByNonce #2930
trace txByNonce #2930
Conversation
[goreleaser]
WalkthroughThe changes enhance the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Handler
participant Service
Client->>Handler: Call GetTxHashByNonce
Handler->>Handler: Start tracing span "txByNonce"
Handler->>Service: GetSubmissionStatus with tracing context
Service-->>Handler: Return submission status
Handler-->>Client: Return transaction hash
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
PR Summary
Introduced OpenTelemetry tracing to the GetTxHashByNonce
function in services/rfq/relayer/relapi/handler.go
to enhance observability.
- Added tracing span in
services/rfq/relayer/relapi/handler.go
forGetTxHashByNonce
. - Set attributes for
chain_id
andnonce
within the tracing span. - Ensured the span ends with any error that occurs.
- Passed context to
GetSubmissionStatus
to propagate tracing information.
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- services/rfq/relayer/relapi/handler.go (3 hunks)
Additional comments not posted (6)
services/rfq/relayer/relapi/handler.go (6)
7-7
: Import statement for OpenTelemetry is correct.The addition of the
attribute
package is necessary for setting attributes on the tracing span.
266-266
: Tracing span initiation is correct.The tracing span is correctly started using
h.metrics.Tracer().Start(c, "txByNonce")
, and the context is derived from this span.
267-270
: Error handling and span ending is correct.The deferred function correctly ends the span and handles any errors using
metrics.EndSpanWithErr(span, err)
.
281-282
: Setting attributes on the tracing span is correct.Attributes for
chain_id
andnonce
are correctly set on the tracing span to provide relevant contextual information.Also applies to: 288-288
290-290
: Usage of tracing context is correct.The tracing context is correctly used when calling
GetSubmissionStatus
, ensuring that the tracing data is propagated through the call.
Line range hint
292-299
:
Error handling is correct.The error handling correctly returns appropriate HTTP responses for both success and failure scenarios when retrieving the transaction hash.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2930 +/- ##
===================================================
- Coverage 25.68180% 25.68046% -0.00134%
===================================================
Files 771 771
Lines 55588 55587 -1
Branches 80 80
===================================================
- Hits 14276 14275 -1
Misses 39827 39827
Partials 1485 1485
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
[goreleaser]
Description
A clear and concise description of the features you're adding in this pull request.
Additional context
Add any other context about the problem you're solving.
Metadata
Summary by CodeRabbit
New Features
Improvements