Skip to content

fix(http-invocation): remove account ID from request latency metric - #771

Merged
borao merged 1 commit into
mainfrom
fix/http-invocation/remove-metric-label
Aug 14, 2026
Merged

fix(http-invocation): remove account ID from request latency metric#771
borao merged 1 commit into
mainfrom
fix/http-invocation/remove-metric-label

Conversation

@borao

@borao borao commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Remove the nca_id label from function_request_latency while retaining function_id and function_version_id.

This reduces histogram series cardinality without changing request handling.

Additional Details

This change:

  • removes nca_id from the record_invocation_end metric API and histogram labels
  • updates the invocation response call site
  • adds a regression test confirming that the function and function-version labels remain while nca_id is omitted

Rollout order: deploy the autoscaler query change in #769 before deploying this change. The updated autoscaler query supports both the current and new metric label schemas.

For the Reviewer

Please focus on the emitted function_request_latency label set and the rollout relationship with #769.

For QA

Automated validation completed:

  • cargo test --package nvcf-invocation-service --lib
  • 76 tests passed
  • 4 Docker-dependent tests ignored

Checklist

  • I am familiar with the Contributing Guidelines.
  • I have signed off my commits for Developer Certificate of Origin (DCO) compliance.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Summary by CodeRabbit

  • Bug Fixes
    • Updated invocation latency metrics to report function and version details without including internal execution identifiers.
    • Improved metric consistency for streaming invocation responses.

Signed-off-by: Bora Oztekin <boztekin@nvidia.com>
@borao
borao requested a review from a team as a code owner August 11, 2026 18:13
@borao
borao requested a review from along-2017 August 11, 2026 18:13
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The invocation latency metric no longer includes the nca_id label. The metric API, streaming response call site, and test now use function and function-version labels only.

Changes

Invocation latency metrics

Layer / File(s) Summary
Metric label contract
src/invocation-plane-services/http-invocation/crates/server/src/metrics/mod.rs
record_invocation_end removes the nca_id parameter and label. A test verifies the remaining function and version labels.
Streaming response integration
src/invocation-plane-services/http-invocation/crates/server/src/routes/post_pexec.rs
The streaming response path calls record_invocation_end without nca_id.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • NVIDIA/nvcf#769: Removes nca_id from related invocation latency metric handling and aggregation.

Suggested reviewers: along-2017

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits format and accurately describes the removal of the account ID from the request latency metric.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/http-invocation/remove-metric-label

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

@github-actions

Copy link
Copy Markdown
Contributor

🛡️ CodeQL Analysis

🚨 Found 2 issue(s)

Severity Breakdown:

  • 🔴 Errors: 0
  • 🟡 Warnings: 0
  • 🔵 Notes: 0
📋 Top Issues

🔗 View full details in Security tab

🕐 Last updated: 2026-08-11 18:15:52 UTC | Commit: 7dff4a8

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/invocation-plane-services/http-invocation/crates/server/src/metrics/mod.rs`:
- Around line 379-386: Update the assertions for the metric key in the relevant
test to verify the complete label set: assert that exactly two labels exist and
that they are function_id and function_version_id with the expected values.
Remove the separate absence-only check for nca_id, while preserving the existing
expected label values.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3425c7b6-64a5-447e-aa82-e842cca4bb37

📥 Commits

Reviewing files that changed from the base of the PR and between 60bdfd1 and 7dff4a8.

📒 Files selected for processing (2)
  • src/invocation-plane-services/http-invocation/crates/server/src/metrics/mod.rs
  • src/invocation-plane-services/http-invocation/crates/server/src/routes/post_pexec.rs
💤 Files with no reviewable changes (1)
  • src/invocation-plane-services/http-invocation/crates/server/src/routes/post_pexec.rs

@balajinvda balajinvda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@borao
borao added this pull request to the merge queue Aug 14, 2026
Merged via the queue into main with commit 80275a1 Aug 14, 2026
19 checks passed
@borao
borao deleted the fix/http-invocation/remove-metric-label branch August 14, 2026 02:32
@balajinvda

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version nvcf-invocation-service-v0.10.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants