-
Notifications
You must be signed in to change notification settings - Fork 13
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
refactor: remove dynamic labels from metrics #629
Conversation
WalkthroughThe recent changes enhance the clarity and specificity of telemetry metrics across various components. Key modifications include renaming functions and metric keys for better alignment with their purpose, streamlining telemetry reporting, and removing unnecessary imports. These adjustments collectively improve code maintainability and readability while preserving existing functionalities. Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant S as Server
participant T as Telemetry
C->>S: Initiate Operation
S->>T: Log Metrics
T-->>S: Acknowledge
S-->>C: Return Response
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- telemetry/metrics.go (1 hunks)
- x/crosschain/keeper/bridge_call_in.go (2 hunks)
- x/crosschain/keeper/bridge_call_out.go (1 hunks)
- x/crosschain/keeper/msg_server.go (1 hunks)
- x/crosschain/keeper/oracle.go (1 hunks)
- x/crosschain/keeper/outgoing_pool.go (1 hunks)
- x/crosschain/keeper/send_to_fx.go (2 hunks)
- x/crosschain/legacy/precompile_events.go (2 hunks)
- x/migrate/keeper/msg_server.go (2 hunks)
Files skipped from review due to trivial changes (4)
- x/crosschain/keeper/msg_server.go
- x/crosschain/keeper/oracle.go
- x/crosschain/legacy/precompile_events.go
- x/migrate/keeper/msg_server.go
Additional comments not posted (10)
telemetry/metrics.go (2)
26-26
: LGTM!The update aligns with the new function naming and logic.
15-21
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
SetGaugeLabelsWithDenom
match the new signature.Verification successful
Function usage verified and matches the new signature.
The function calls to
SetGaugeLabelsWithDenom
in the codebase correctly use the new signature.
x/crosschain/keeper/bridge_call_out.go
x/crosschain/keeper/outgoing_pool.go
x/crosschain/keeper/send_to_fx.go
telemetry/metrics.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `SetGaugeLabelsWithDenom` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go -A 5 $'SetGaugeLabelsWithDenom'Length of output: 1892
x/crosschain/keeper/send_to_fx.go (1)
32-47
: LGTM!The changes improve observability by adding telemetry counters and gauges.
x/crosschain/keeper/bridge_call_in.go (2)
41-45
: LGTM!The changes enhance clarity and maintainability by using consistent metric labels.
92-94
: LGTM!The changes enhance clarity and maintainability by using consistent metric labels.
x/crosschain/keeper/bridge_call_out.go (2)
66-71
: Simplified telemetry tracking improves clarity and efficiency.The removal of the
tokenLabels
slice and direct usage of telemetry labels improves the readability and maintainability of the code.
71-77
: Telemetry label adjustments enhance specificity.The changes to the telemetry labels, such as explicitly naming the module label as
"module"
, enhance the clarity and specificity of the metrics.x/crosschain/keeper/outgoing_pool.go (3)
64-67
: Improved telemetry metric naming enhances clarity.The change from
types.MetricsKeyOutgoingTx
to"outgoing_tx_amount"
for the gauge label and"outgoing_tx"
for the counter label improves the readability and specificity of the metrics.
67-67
: Function call adjustment improves granularity.The change from
SetGaugeLabelsWithCoin
toSetGaugeLabelsWithDenom
, which takes the denomination and the amount as separate parameters, enhances the granularity of the outgoing transaction metrics.
69-74
: Simplified telemetry labels enhance standardization.The update to use more straightforward label names, such as changing
types.MetricsLabelModule
to"module"
andtypes.MetricsLabelToken
to"denom"
, simplifies the code and standardizes the label usage across the telemetry reporting.
mg |
Summary by CodeRabbit