Skip to content

Conversation

tzulingk
Copy link
Contributor

@tzulingk tzulingk commented Aug 19, 2025

Overview:

Details:

Rename dynamo_component_concurrent_requests to dynamo_component_inflight_requests so that it matches the corresponding frontend metric.

Where should the reviewer start?

push_handler.rs

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

DIS-350 fix: dynamo_frontend_* & dynamo_components_* not sync'ed

Summary by CodeRabbit

  • Refactor

    • Renamed metric from dynamo_component_concurrent_requests to dynamo_component_inflight_requests.
    • Updated public metric identifier and usage to inflight_requests.
    • Migrated Grafana dashboard queries to dynamo_component_* metrics and the dynamo_endpoint label.
  • Documentation

    • Updated READMEs and example outputs to reflect the inflight_requests metric.
  • Tests

    • Renamed test helpers and references to align with inflight_requests terminology.

to dynamo_component_inflight_requests so that it matches the correspond frontend metric.
Copy link
Contributor

coderabbitai bot commented Aug 19, 2025

Walkthrough

Renamed the “concurrent_requests” metric to “inflight_requests” across runtime metrics, public constants, ingress handler fields/constructor, docs, examples, and tests. Updated Grafana dashboard queries to the dynamo_component_* namespace and dynamo_endpoint label; one errors panel label key appears misspelled.

Changes

Cohort / File(s) Summary of edits
Docs: Metrics READMEs
deploy/metrics/README.md, lib/runtime/examples/system_metrics/README.md
Updated metric name from dynamo_component_concurrent_requests to dynamo_component_inflight_requests; adjusted sample/help text accordingly.
Grafana dashboard queries
deploy/metrics/grafana_dashboards/grafana-dynamo-dashboard.json
Switched PromQL metrics to dynamo_component_* and label endpoint→dynamo_endpoint; updated five panels; errors query label has “dynamendpoint” typo.
Runtime metrics constant
lib/runtime/src/metrics/prometheus_names.rs
Renamed public constant work_handler::CONCURRENT_REQUESTS → INFLIGHT_REQUESTS (“concurrent_requests” → “inflight_requests”).
Ingress WorkHandler metrics
lib/runtime/src/pipeline/network/ingress/push_handler.rs
Renamed WorkHandlerMetrics field and constructor parameter concurrent_requests → inflight_requests; increment/decrement sites updated.
Runtime tests
lib/runtime/src/metrics.rs
Adjusted expected metric enum/name from CONCURRENT_REQUESTS to INFLIGHT_REQUESTS in post-activity test.
Examples integration test (comments only)
lib/runtime/examples/system_metrics/tests/integration_test.rs
Updated comments to reference inflight_requests; no logic changes.
Router e2e tests
tests/router/test_router_e2e_with_mockers.py
Renamed helper function send_concurrent_requests → send_inflight_requests; updated call sites; signature and behavior unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

I count the clouds of packets in flight,
Not “concurrent” now—new names in sight.
Dashboards blink with endpoint light,
A tiny typo? I twitch—alright.
Ears up, paws poised, metrics tight—
This rabbit charts the traffic’s night. 🐇📊

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.


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.

❤️ 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>, please review it.
    • 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.
  • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

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

🔭 Outside diff range comments (1)
deploy/metrics/grafana_dashboards/grafana-dynamo-dashboard.json (1)

1000-1004: Fix label typo in PromQL (breaks the errors panel).

The label key is misspelled as dynamendpoint; should be dynamo_endpoint. As-is, the panel won’t return data.

Apply this diff:

-          "expr": "rate(dynamo_component_errors_total{dynamendpoint=\"generate\"}[1m])",
+          "expr": "rate(dynamo_component_errors_total{dynamo_endpoint=\"generate\"}[1m])",
🧹 Nitpick comments (3)
lib/runtime/src/metrics/prometheus_names.rs (1)

112-112: Add a deprecated alias for the renamed constant

Renaming the public constant from CONCURRENT_REQUESTS to INFLIGHT_REQUESTS is a breaking change for any external consumers. No internal references to CONCURRENT_REQUESTS were found in the codebase, so this only affects downstream users. To smooth the migration:

• In lib/runtime/src/metrics/prometheus_names.rs (around line 112), add:

#[deprecated(
    since = "X.Y.Z",
    note = "Please use `INFLIGHT_REQUESTS` instead"
)]
pub const CONCURRENT_REQUESTS: &str = INFLIGHT_REQUESTS;

• In your CHANGELOG.md, under “Breaking Changes,” note that CONCURRENT_REQUESTS has been renamed to INFLIGHT_REQUESTS.

Let me know if you’d like me to open a follow-up PR to add the alias and update the changelog.

tests/router/test_router_e2e_with_mockers.py (1)

284-337: Helper rename is consistent; optional micro-improvement for readiness probe.

The function name matches the new terminology. Optionally, consider moving the initial sleep in send_request_with_retry to occur after the first failed attempt to avoid delaying the very first probe, but this is non-blocking.

lib/runtime/examples/system_metrics/tests/integration_test.rs (1)

145-173: Optionally assert presence (non-negativity) of inflight_requests

Even if we don’t require it to be >0, asserting that the metric exists and is non-negative gives extra confidence without flakiness.

Apply this diff inside verify_ingress_metrics_greater_than_0, after the existing loop:

   for metric_name in &metrics_to_verify {
     let line = metrics_content
       .lines()
       .find(|l| l.contains(metric_name) && !l.contains("#"))
       .unwrap_or_else(|| panic!("{} metric not found", metric_name));

     let value = extract_metric_value(line);
     assert!(
       value > 0.0,
       "{} should be greater than 0, got: {}",
       metric_name,
       value
     );
     println!("{}: {}", metric_name, value);
   }

+  // inflight_requests can be 0 at rest, but should exist and be non-negative.
+  if let Some(line) = metrics_content
+    .lines()
+    .find(|l| l.contains("inflight_requests") && !l.contains('#'))
+  {
+    let inflight = extract_metric_value(line);
+    assert!(
+      inflight >= 0.0,
+      "inflight_requests should be >= 0, got: {}",
+      inflight
+    );
+    println!("inflight_requests: {}", inflight);
+  } else {
+    panic!("inflight_requests metric not found");
+  }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 80d8aa1 and bc615eb.

📒 Files selected for processing (8)
  • deploy/metrics/README.md (1 hunks)
  • deploy/metrics/grafana_dashboards/grafana-dynamo-dashboard.json (5 hunks)
  • lib/runtime/examples/system_metrics/README.md (2 hunks)
  • lib/runtime/examples/system_metrics/tests/integration_test.rs (2 hunks)
  • lib/runtime/src/metrics.rs (1 hunks)
  • lib/runtime/src/metrics/prometheus_names.rs (1 hunks)
  • lib/runtime/src/pipeline/network/ingress/push_handler.rs (6 hunks)
  • tests/router/test_router_e2e_with_mockers.py (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
lib/runtime/src/metrics.rs (1)
lib/runtime/src/metrics/prometheus_names.rs (1)
  • build_metric_name (10-12)
🪛 LanguageTool
deploy/metrics/README.md

[grammar] ~43-~43: There might be a mistake here.
Context: ...quests currently being processed (gauge) - dynamo_component_request_bytes_total: Total bytes received in requests (coun...

(QB_NEW_EN)

⏰ 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). (5)
  • GitHub Check: Mirror Repository to GitLab
  • GitHub Check: pre-merge-rust (lib/runtime/examples)
  • GitHub Check: pre-merge-rust (lib/bindings/python)
  • GitHub Check: pre-merge-rust (.)
  • GitHub Check: Build and Test - dynamo
🔇 Additional comments (9)
lib/runtime/examples/system_metrics/README.md (1)

65-65: Metric rename looks consistent and correct.

The gauge name and example output align with the new inflight terminology and label set.

Also applies to: 83-85

deploy/metrics/README.md (1)

43-43: Docs sync with rename is correct.

The component metric list now references inflight_requests; description remains accurate.

tests/router/test_router_e2e_with_mockers.py (1)

146-153: Call sites updated to new helper name — LGTM.

Both tests now call send_inflight_requests; arguments unchanged and consistent.

Also applies to: 232-237

deploy/metrics/grafana_dashboards/grafana-dynamo-dashboard.json (1)

698-715: Dashboard queries updated to component-scoped metrics — LGTM.

PromQL now uses dynamo_component_* metrics and the dynamo_endpoint label as intended.

Also applies to: 803-807, 908-912

lib/runtime/src/metrics.rs (1)

1627-1627: All concurrent_requests refs removed; inflight_requests fully integrated
No stale occurrences of concurrent_requests remain, and the new inflight_requests metric is referenced across README, code, and tests.

lib/runtime/examples/system_metrics/tests/integration_test.rs (1)

121-123: Comment update aligns with rename

Excluding inflight_requests from the >0 assertion is appropriate since it can legitimately be 0 at rest.

lib/runtime/src/pipeline/network/ingress/push_handler.rs (3)

27-33: Field rename to inflight_requests is accurate

Public API field rename is consistent with the PR objective.


36-43: Constructor parameter renamed consistently

Constructor signature and usage updated to inflight_requests. No issues.


71-75: Metric creation uses the new 'inflight_requests' name

Endpoint gauge is correctly created as inflight_requests with clear help text.

@tzulingk tzulingk merged commit 6f7f6b1 into main Aug 19, 2025
11 of 14 checks passed
@tzulingk tzulingk deleted the tzulingk/rename_dis_350 branch August 19, 2025 22:23
hhzhang16 pushed a commit that referenced this pull request Aug 27, 2025
nv-anants pushed a commit that referenced this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants