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

Add params for client instrumentation #2428

Merged
merged 7 commits into from
Apr 2, 2024
Merged

Conversation

trajan0x
Copy link
Contributor

@trajan0x trajan0x commented Apr 2, 2024

Description

  • Add params to tracing for easier finding
  • Add ids for easier trace finding (these can be found in alchemy dash)

Future work

  • Investigate using this to convert all requests into searchable traces. @aureliusbtc curious for your thoughts on this

Misc:

Staged in #2425

Summary by CodeRabbit

  • New Features

    • Introduced new metrics names for enhanced block-related tracking.
    • Enhanced HTTP instrumentation with the ability to track request IDs for improved monitoring and debugging.
  • Enhancements

    • Improved client functionality with additional string conversion utilities and expanded tracing attributes for contract calls and log filtering.

Copy link
Contributor

coderabbitai bot commented Apr 2, 2024

Warning

Rate Limit Exceeded

@trajan0x has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 15 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 93474c2 and cbf58be.

Walkthrough

The recent update introduces enhancements in metrics and HTTP instrumentation, alongside modifications to the Ethereum client functionality. Key changes include the addition of new block-related metric names, improved HTTP request tracking through JSON parsing, and enhanced contract call tracing capabilities. These adjustments aim to refine data collection and analysis, offering more granular insights into blockchain interactions and performance metrics.

Changes

Files Change Summary
core/metrics/consistentnames.go
core/metrics/instrumentation/http.go
Added block-related metrics, improved HTTP instrumentation with JSON parsing for request IDs.
ethergo/client/client.go Enhanced Ethereum client with new tracing attributes, functions for data conversion, and method modifications for better traceability.

🐰✨
In the realm of code, where changes abide,
A rabbit hops through, with eyes open wide.
Metrics and traces, in harmony dance,
Enhancing the flow, with every glance.
With each leap and bound, improvements are sown,
In the digital fields, where seeds of code are grown.
🌟🐾

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?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added go Pull requests that update Go code size/xs labels Apr 2, 2024
Copy link

cloudflare-workers-and-pages bot commented Apr 2, 2024

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: cbf58be
Status:🚫  Build failed.

View logs

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 47.10586%. Comparing base (1ea21df) to head (cbf58be).
Report is 2 commits behind head on master.

Files Patch % Lines
ethergo/client/client.go 88.88889% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##              master       #2428         +/-   ##
===================================================
+ Coverage   46.93787%   47.10586%   +0.16799%     
===================================================
  Files            383         387          +4     
  Lines          29228       29387        +159     
  Branches          83          83                 
===================================================
+ Hits           13719       13843        +124     
- Misses         14048       14080         +32     
- Partials        1461        1464          +3     
Flag Coverage Δ
core 64.50580% <ø> (ø)
ethergo 60.40824% <88.88889%> (-0.11613%) ⬇️
git-changes-action 53.94265% <ø> (ø)
promexporter 75.91241% <ø> (?)
rfq 29.09708% <ø> (ø)
screener-api 62.80488% <ø> (ø)
sin-executor 63.79310% <ø> (+1.72413%) ⬆️
stiprelayer 3.33333% <ø> (ø)
tools 21.98661% <ø> (ø)

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review Status

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 1ea21df and 93474c2.
Files ignored due to path filters (24)
  • agents/go.mod is excluded by !**/*.mod
  • agents/go.sum is excluded by !**/*.sum
  • committee/go.mod is excluded by !**/*.mod
  • committee/go.sum is excluded by !**/*.sum
  • contrib/promexporter/go.mod is excluded by !**/*.mod
  • contrib/promexporter/go.sum is excluded by !**/*.sum
  • core/go.mod is excluded by !**/*.mod
  • core/go.sum is excluded by !**/*.sum
  • ethergo/go.mod is excluded by !**/*.mod
  • ethergo/go.sum is excluded by !**/*.sum
  • services/cctp-relayer/go.mod is excluded by !**/*.mod
  • services/cctp-relayer/go.sum is excluded by !**/*.sum
  • services/explorer/go.mod is excluded by !**/*.mod
  • services/explorer/go.sum is excluded by !**/*.sum
  • services/omnirpc/go.mod is excluded by !**/*.mod
  • services/omnirpc/go.sum is excluded by !**/*.sum
  • services/rfq/go.mod is excluded by !**/*.mod
  • services/rfq/go.sum is excluded by !**/*.sum
  • services/scribe/go.mod is excluded by !**/*.mod
  • services/scribe/go.sum is excluded by !**/*.sum
  • services/stiprelayer/go.mod is excluded by !**/*.mod
  • services/stiprelayer/go.sum is excluded by !**/*.sum
  • sin-executor/go.mod is excluded by !**/*.mod
  • sin-executor/go.sum is excluded by !**/*.sum
Files selected for processing (3)
  • core/metrics/consistentnames.go (1 hunks)
  • core/metrics/instrumentation/http.go (4 hunks)
  • ethergo/client/client.go (4 hunks)
Additional Context Used
GitHub Check Runs (1)
Lint (core) failure (4)

core/metrics/instrumentation/http.go: [failure] 121-121:
func (*captureTransport).trackID is unused (unused)

Additional comments not posted (9)
core/metrics/consistentnames.go (1)

18-23: The addition of BlockHash, FromBlock, and ToBlock metric names is clear and follows the existing naming conventions. These will provide valuable insights into block processing.

core/metrics/instrumentation/http.go (3)

7-7: The addition of github.com/valyala/fastjson is justified for efficient JSON parsing in the RoundTrip method.


36-37: The addition of the IDSpanName constant is appropriate for naming spans associated with request IDs, enhancing traceability.


103-110: The modifications to the RoundTrip method for extracting and tracking an id from the request body are well-implemented and align with the objective of enhancing HTTP instrumentation.

ethergo/client/client.go (5)

18-18: The addition of the reflect package is justified for use in the nillableToString function to handle nil interface values effectively.


125-126: The modification to the startSpan method to accept an additional opts parameter enhances its flexibility and utility for tracing.


144-164: The addition of toStrings and nillableToString functions is well-implemented, providing useful utilities for converting data types for tracing attributes.


136-136: The modifications to the CallContract and PendingCallContract methods to include additional attributes in tracing are appropriate and enhance traceability.


297-305: The addition of the queryToTraceParams function effectively enhances the tracing capabilities of the FilterLogs method by converting ethereum.FilterQuery to trace parameters.

core/metrics/instrumentation/http.go Outdated Show resolved Hide resolved
@trajan0x trajan0x changed the title Add params for client insturmentation Add params for client instrumentation Apr 2, 2024
@trajan0x trajan0x merged commit 0578d48 into master Apr 2, 2024
66 of 68 checks passed
@trajan0x trajan0x deleted the fix/instrumenet-client-params branch April 2, 2024 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code size/s
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant