MGMT-21387: Add metrics for just the assisted service API calls#67
Conversation
Ideally this should be nearly the whole request, but if there is a difference we want to know about it. Also skew the buckets toward the smaller end since we don't expect many 10s or longer requests https://issues.redhat.com/browse/MGMT-21387
|
@carbonin: This pull request references MGMT-21387 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughConsolidates metrics into a dedicated metrics package, updates histogram buckets, adds API_CALL_LATENCY, centralizes API call timing via a new internal _api_call wrapper, and adjusts imports accordingly without changing public method signatures or runtime behavior. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant InventoryClient
participant _api_call
participant SDK_Function
participant Metrics
Caller->>InventoryClient: get_cluster(...)/list_clusters(...)/...
InventoryClient->>_api_call: _api_call(func, *args)
_api_call->>Metrics: API_CALL_LATENCY.labels(api_method).time()
_api_call->>SDK_Function: asyncio.to_thread(func, *args)
SDK_Function-->>_api_call: result
_api_call-->>InventoryClient: result
InventoryClient-->>Caller: result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (5)
🧰 Additional context used🧬 Code Graph Analysis (2)server.py (2)
service_client/assisted_service_api.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (7)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: carbonin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@carbonin: This pull request references MGMT-21387 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/retest |
8463fc5
into
openshift-assisted:master
Ideally this should be nearly the whole request, but if there is a difference we want to know about it.
Also skew the buckets toward the smaller end since we don't expect many 10s or longer requests
https://issues.redhat.com/browse/MGMT-21387
Summary by CodeRabbit
New Features
Refactor
Chores