Skip to content

feat(nvca): wire BYOO metric subset config#326

Merged
kristinapathak merged 8 commits into
mainfrom
feat/nvca-byoo-sre-values
Jul 21, 2026
Merged

feat(nvca): wire BYOO metric subset config#326
kristinapathak merged 8 commits into
mainfrom
feat/nvca-byoo-sre-values

Conversation

@kristinapathak

@kristinapathak kristinapathak commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

TL;DR

  • Wires BYOO metric subset settings through NVCA agent config so Helm users can set them with agentConfig.mergeConfig.
  • Aligns the BYOO collector and NVCA config on metric subset naming.

Additional Details

  • Adds NVCA config support for byooMetricSubset.
  • Adds top-level byooWorkloadMetricsDropLabels for drops on the generated workload metrics pipeline.
  • Emits BYOO_METRIC_SUBSET_ENABLED, BYOO_METRIC_SUBSET_FILTER_CONFIG, and BYOO_WORKLOAD_METRICS_DROP_LABELS.
  • Renames collector IDs to metrics/metric_subset, filter/metric_subset, and batch/metric_subset.
  • Uses metric_subset_enabled as the default workload drop label only when metric subset is enabled.

For the Reviewer

  • Start with src/libraries/go/lib/pkg/types/nvca/config/types.go and the BYOO collector render path.
  • Verify NVCA injects these env vars only into the BYOO OTel collector container.

Testing and Documentation

  • go test ./internal/otelconfig -count=1
  • go test ./pkg/types/nvca/config -count=1
  • Focused NVCA tests for k8sutil, operator reconcile, webhook, miniservice reconcile, and pkg/nvca compile.
  • helm template for default chart values and a byooMetricSubset/byooWorkloadMetricsDropLabels mergeConfig overlay.

Issues

Closes #325

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 this.
  • The documentation is up to date.

Summary by CodeRabbit

  • New Features

    • Added configurable BYOO metric subsets with custom filters and workload metric label removal.
    • Metric subset data is now routed through a dedicated metrics pipeline when enabled.
    • Updated workload deployments to apply the relevant OpenTelemetry collector settings.
  • Bug Fixes

    • Corrected environment-variable propagation so metric subset settings reach the collector correctly.
  • Documentation

    • Added Helm and configuration examples for enabling metric subsets, filtering metrics, and dropping labels.
    • Updated collector configuration guidance and terminology for metric subset metrics.

@kristinapathak
kristinapathak requested a review from a team as a code owner July 21, 2026 20:34
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

NVCA and the BYOO OTel collector add metric subset configuration, replace SRE metrics naming and pipeline wiring, document mergeConfig examples, and propagate combined collector environment variables through miniservice, function, task, and webhook paths.

Changes

BYOO metric subset configuration and collector pipeline

Layer / File(s) Summary
Metric subset collector pipeline
src/compute-plane-services/byoo-otel-collector/...
Replaces SRE metrics configuration with metric subset environment variables, processors, exporter, and metrics/metric_subset pipeline, with updated examples and rendering tests.
NVCA configuration contract and merge support
src/libraries/go/lib/pkg/types/nvca/config/..., src/compute-plane-services/nvca/pkg/operator/..., deploy/helm/..., docs/*/cluster-management/...
Adds byooMetricSubset configuration, environment-variable generation, decoding and deep-copy coverage, merge assertions, and Helm/documentation examples.
OTel collector environment injection
src/compute-plane-services/nvca/internal/..., src/compute-plane-services/nvca/pkg/...
Generalizes BYOO pod environment injection and uses combined OTel collector variables across reconciliation, translated pods, tasks, and webhook mutation; tests verify collector-only placement.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MergeConfig
  participant AgentConfig
  participant MiniserviceReconciler
  participant ContainerExecution
  participant BYOOOTelCollector
  MergeConfig->>AgentConfig: decode byooMetricSubset settings
  AgentConfig->>MiniserviceReconciler: provide BYOO OTel collector env vars
  AgentConfig->>ContainerExecution: provide BYOO OTel collector env vars
  MiniserviceReconciler->>BYOOOTelCollector: inject collector env vars
  ContainerExecution->>BYOOOTelCollector: inject collector env vars
Loading

Possibly related PRs

  • NVIDIA/nvcf#194: Touches the same BYOO environment-variable injection paths.
  • NVIDIA/nvcf#266: Provides the preceding BYOO OTel collector SRE metrics pipeline wiring replaced here.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.42% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR wires the BYOO metric subset settings through all required NVCA/Helm paths and documents the mergeConfig shape for #325.
Out of Scope Changes check ✅ Passed All code, docs, and tests appear directly related to BYOO metric subset wiring; no unrelated changes are evident.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: wiring BYOO metric subset configuration through NVCA.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/nvca-byoo-sre-values

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

@github-actions

Copy link
Copy Markdown

@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 `@docs/ngc-managed/cluster-management/configuration.md`:
- Line 736: Update the “BYOO SRE metrics example” documentation heading to plain
text by removing the Markdown bold markers, while preserving the heading text
and colon.
🪄 Autofix (Beta)

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: 65d1f8cf-a1e7-4000-8d4a-bfa988447a45

📥 Commits

Reviewing files that changed from the base of the PR and between 5e459d7 and 0f4060a.

⛔ Files ignored due to path filters (3)
  • src/compute-plane-services/nvca/vendor/github.com/NVIDIA/nvcf/src/libraries/go/lib/pkg/types/nvca/config/types.go is excluded by !**/vendor/**
  • src/compute-plane-services/nvca/vendor/github.com/NVIDIA/nvcf/src/libraries/go/lib/pkg/types/nvca/config/zz_generated.deepcopy.go is excluded by !**/vendor/**, !**/zz_generated.*
  • src/libraries/go/lib/pkg/types/nvca/config/zz_generated.deepcopy.go is excluded by !**/zz_generated.*
📒 Files selected for processing (16)
  • deploy/helm/nvca-operator/nvca-operator/values.yaml
  • docs/ngc-managed/cluster-management/configuration.md
  • docs/user/cluster-management/configuration.md
  • src/compute-plane-services/nvca/internal/miniservice/reconcile.go
  • src/compute-plane-services/nvca/internal/miniservice/reconcile_test.go
  • src/compute-plane-services/nvca/internal/util/k8sutil/byoo_log_chunking.go
  • src/compute-plane-services/nvca/internal/util/k8sutil/byoo_log_chunking_test.go
  • src/compute-plane-services/nvca/pkg/nvca/k8scomputebackend.go
  • src/compute-plane-services/nvca/pkg/nvca/k8scomputebackend_task_container.go
  • src/compute-plane-services/nvca/pkg/operator/reconcile/nvcaagent_reconcile_test.go
  • src/compute-plane-services/nvca/pkg/webhook/miniservice_mutating_webhook.go
  • src/compute-plane-services/nvca/pkg/webhook/miniservice_mutating_webhook_test.go
  • src/libraries/go/lib/pkg/types/nvca/config/config_test.go
  • src/libraries/go/lib/pkg/types/nvca/config/deepcopy_test.go
  • src/libraries/go/lib/pkg/types/nvca/config/types.go
  • src/libraries/go/lib/pkg/types/nvca/config/types_test.go

Comment thread docs/ngc-managed/cluster-management/configuration.md Outdated
Add NVCA agent config for BYOO SRE metrics collector settings and pass the resulting environment variables through the existing BYOO OTel collector-only injection path. This lets Helm users configure the SRE metrics pipeline through agentConfig.mergeConfig without adding dedicated chart values.

Document the mergeConfig shape and extend focused tests for config decoding, env rendering, operator config merging, and collector-only pod mutation.

Closes #325

Signed-off-by: Kristina Pathak <kpathak@nvidia.com>
Signed-off-by: Kristina Pathak <kpathak@nvidia.com>
Signed-off-by: Kristina Pathak <kpathak@nvidia.com>
@kristinapathak
kristinapathak force-pushed the feat/nvca-byoo-sre-values branch from 2ffb514 to 2d935f8 Compare July 21, 2026 21:47

@estroz estroz 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.

LGTM aside from naming

Comment thread deploy/helm/nvca-operator/nvca-operator/values.yaml Outdated
Signed-off-by: Kristina Pathak <kpathak@nvidia.com>
@kristinapathak kristinapathak changed the title feat(nvca): wire BYOO SRE metrics config feat(nvca): wire BYOO metric subset config Jul 21, 2026

@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 `@docs/user/cluster-management/configuration.md`:
- Around line 865-870: Update the filterConfig example’s metric_conditions
predicate from equality to inequality so BpsInstrument is selected as the
exported subset, matching the default filter behavior; leave the surrounding
configuration unchanged.
🪄 Autofix (Beta)

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: aae2a577-b9b7-46a6-9f56-6df92a8baac4

📥 Commits

Reviewing files that changed from the base of the PR and between 2d935f8 and 5c52db3.

⛔ Files ignored due to path filters (3)
  • src/compute-plane-services/nvca/vendor/github.com/NVIDIA/nvcf/src/libraries/go/lib/pkg/types/nvca/config/types.go is excluded by !**/vendor/**
  • src/compute-plane-services/nvca/vendor/github.com/NVIDIA/nvcf/src/libraries/go/lib/pkg/types/nvca/config/zz_generated.deepcopy.go is excluded by !**/vendor/**, !**/zz_generated.*
  • src/libraries/go/lib/pkg/types/nvca/config/zz_generated.deepcopy.go is excluded by !**/zz_generated.*
📒 Files selected for processing (18)
  • deploy/helm/nvca-operator/nvca-operator/values.yaml
  • docs/ngc-managed/cluster-management/configuration.md
  • docs/user/cluster-management/configuration.md
  • src/compute-plane-services/byoo-otel-collector/README.md
  • src/compute-plane-services/byoo-otel-collector/examples/otelconfigs/k8s/config_function_container_metric_subset.yaml
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/embed_config.go
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/otelconfig.go
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/otelconfig_test.go
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/render.go
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/render_test.go
  • src/compute-plane-services/nvca/internal/miniservice/reconcile_test.go
  • src/compute-plane-services/nvca/internal/util/k8sutil/byoo_env_vars_test.go
  • src/compute-plane-services/nvca/pkg/operator/reconcile/nvcaagent_reconcile_test.go
  • src/compute-plane-services/nvca/pkg/webhook/miniservice_mutating_webhook_test.go
  • src/libraries/go/lib/pkg/types/nvca/config/config_test.go
  • src/libraries/go/lib/pkg/types/nvca/config/deepcopy_test.go
  • src/libraries/go/lib/pkg/types/nvca/config/types.go
  • src/libraries/go/lib/pkg/types/nvca/config/types_test.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/compute-plane-services/nvca/internal/util/k8sutil/byoo_env_vars_test.go
  • src/compute-plane-services/nvca/pkg/operator/reconcile/nvcaagent_reconcile_test.go
  • src/compute-plane-services/nvca/pkg/webhook/miniservice_mutating_webhook_test.go

Comment thread docs/user/cluster-management/configuration.md
Signed-off-by: Kristina Pathak <kpathak@nvidia.com>
Signed-off-by: Kristina Pathak <kpathak@nvidia.com>
Signed-off-by: Kristina Pathak <kpathak@nvidia.com>

@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.

🧹 Nitpick comments (1)
src/libraries/go/lib/pkg/types/nvca/config/deepcopy_test.go (1)

72-81: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert that DeepCopy returns a distinct object.

This test checks field values but would pass if DeepCopy() returned orig. Add the same assert.NotSame check used by the neighboring deep-copy test.

Suggested assertion
  out := orig.DeepCopy()
  require.NotNil(t, out)
+ assert.NotSame(t, orig, out)
  assert.Equal(t, orig.Enabled, out.Enabled)
🤖 Prompt for 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.

In `@src/libraries/go/lib/pkg/types/nvca/config/deepcopy_test.go` around lines 72
- 81, Update TestDeepCopy_BYOOMetricSubsetConfig to assert that the result of
orig.DeepCopy() is a distinct object from orig, matching the assert.NotSame
check in the neighboring deep-copy test while preserving the existing
field-value assertions.
🤖 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.

Nitpick comments:
In `@src/libraries/go/lib/pkg/types/nvca/config/deepcopy_test.go`:
- Around line 72-81: Update TestDeepCopy_BYOOMetricSubsetConfig to assert that
the result of orig.DeepCopy() is a distinct object from orig, matching the
assert.NotSame check in the neighboring deep-copy test while preserving the
existing field-value assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 20e30ffb-98a0-4cfe-9782-adc89de4d783

📥 Commits

Reviewing files that changed from the base of the PR and between 5c52db3 and aa9261e.

⛔ Files ignored due to path filters (3)
  • src/compute-plane-services/nvca/vendor/github.com/NVIDIA/nvcf/src/libraries/go/lib/pkg/types/nvca/config/types.go is excluded by !**/vendor/**
  • src/compute-plane-services/nvca/vendor/github.com/NVIDIA/nvcf/src/libraries/go/lib/pkg/types/nvca/config/zz_generated.deepcopy.go is excluded by !**/vendor/**, !**/zz_generated.*
  • src/libraries/go/lib/pkg/types/nvca/config/zz_generated.deepcopy.go is excluded by !**/zz_generated.*
📒 Files selected for processing (16)
  • deploy/helm/nvca-operator/nvca-operator/values.yaml
  • docs/ngc-managed/cluster-management/configuration.md
  • docs/user/cluster-management/configuration.md
  • src/compute-plane-services/byoo-otel-collector/README.md
  • src/compute-plane-services/byoo-otel-collector/examples/otelconfigs/k8s/config_function_container_metric_subset.yaml
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/embed_config.go
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/otelconfig.go
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/otelconfig_test.go
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/render.go
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/render_test.go
  • src/compute-plane-services/nvca/internal/miniservice/reconcile_test.go
  • src/compute-plane-services/nvca/pkg/operator/reconcile/nvcaagent_reconcile_test.go
  • src/libraries/go/lib/pkg/types/nvca/config/config_test.go
  • src/libraries/go/lib/pkg/types/nvca/config/deepcopy_test.go
  • src/libraries/go/lib/pkg/types/nvca/config/types.go
  • src/libraries/go/lib/pkg/types/nvca/config/types_test.go
🚧 Files skipped from review as they are similar to previous changes (13)
  • src/libraries/go/lib/pkg/types/nvca/config/config_test.go
  • src/libraries/go/lib/pkg/types/nvca/config/types_test.go
  • deploy/helm/nvca-operator/nvca-operator/values.yaml
  • src/compute-plane-services/nvca/pkg/operator/reconcile/nvcaagent_reconcile_test.go
  • docs/ngc-managed/cluster-management/configuration.md
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/otelconfig_test.go
  • src/compute-plane-services/byoo-otel-collector/README.md
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/otelconfig.go
  • src/compute-plane-services/nvca/internal/miniservice/reconcile_test.go
  • src/compute-plane-services/byoo-otel-collector/examples/otelconfigs/k8s/config_function_container_metric_subset.yaml
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/render.go
  • src/compute-plane-services/byoo-otel-collector/internal/otelconfig/render_test.go
  • docs/user/cluster-management/configuration.md

Signed-off-by: Kristina Pathak <kpathak@nvidia.com>
@kristinapathak
kristinapathak enabled auto-merge July 21, 2026 23:07
@kristinapathak
kristinapathak added this pull request to the merge queue Jul 21, 2026
Merged via the queue into main with commit 106c310 Jul 21, 2026
16 checks passed
@kristinapathak
kristinapathak deleted the feat/nvca-byoo-sre-values branch July 21, 2026 23:10
@balajinvda

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version helm-nvca-operator-v1.16.0 🎉

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.

Wire BYOO SRE metrics settings through NVCA config

3 participants