Skip to content

chore: handle OTEL vars the same in helm v3/v4 - #1204

Merged
mckornfield merged 1 commit into
mainfrom
helm-telemetry-env-var-tweak/mck
Aug 17, 2026
Merged

chore: handle OTEL vars the same in helm v3/v4#1204
mckornfield merged 1 commit into
mainfrom
helm-telemetry-env-var-tweak/mck

Conversation

@mckornfield

@mckornfield mckornfield commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Related Issue

Changes

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with documentation updates
  • Documentation only
  • Contributor tooling or automation
  • CI, build, or test infrastructure

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Documentation updated for user-visible behavior
  • Documentation not applicable — justification:

Verification

  • Pull request title follows the repository's Conventional Commit format
  • Every commit includes an appropriate Signed-off-by: trailer
  • uv run pre-commit run -a passes, or any blocked checks are identified below
  • Targeted tests pass, or tests are marked not applicable above
  • No secrets, API keys, or credentials are included

Targeted validation:

Summary by CodeRabbit

  • Bug Fixes

    • Telemetry environment variables are now omitted when their values are invalid or unset.
    • Explicitly configured empty telemetry endpoint values continue to be rendered correctly.
  • Tests

    • Added Helm validation checks covering unset defaults and explicitly empty telemetry endpoint configurations.

@mckornfield
mckornfield requested review from a team as code owners August 10, 2026 15:56
@github-actions github-actions Bot added the chore label Aug 10, 2026
Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
@mckornfield
mckornfield force-pushed the helm-telemetry-env-var-tweak/mck branch from c9a258c to 0fa1d9c Compare August 10, 2026 15:57
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Helm OTEL environment helper now omits invalid telemetry values. Helm lint checks that null endpoints are omitted and explicit empty-string endpoints are rendered.

Changes

OTEL environment rendering

Layer / File(s) Summary
Filter invalid OTEL values and validate endpoint rendering
k8s/helm/templates/_helpers.tpl, tools/lint/lint-helm.sh
The helper skips invalid telemetry values. Helm lint validates null defaults and explicit empty endpoint values.

Suggested reviewers: a2bondar, aahunt-nv, ajaythorve

🚥 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 clearly summarizes the main change: consistent OTEL variable handling between Helm v3 and Helm v4.
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 helm-telemetry-env-var-tweak/mck

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

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

🧹 Nitpick comments (1)
tools/lint/lint-helm.sh (1)

196-197: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the empty value, not only the variable name.

The checks at Line 196 and Line 197 pass when the endpoint names have any value. Match each endpoint name with its following value: "" entry and fail each assertion independently.

Proposed assertion change
-if grep -Fq "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT" <<<"${otel_explicit_empty_output}"
-grep -Fq "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT" <<<"${otel_explicit_empty_output}"
+if ! grep -A1 -F -- "name: OTEL_EXPORTER_OTLP_METRICS_ENDPOINT" \
+    <<<"${otel_explicit_empty_output}" | grep -Fq -- 'value: ""'; then
+  echo "Explicit empty OTEL metrics endpoint was not rendered" >&2
+  exit 1
+fi
+if ! grep -A1 -F -- "name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT" \
+    <<<"${otel_explicit_empty_output}" | grep -Fq -- 'value: ""'; then
+  echo "Explicit empty OTEL traces endpoint was not rendered" >&2
+  exit 1
+fi
🤖 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 `@tools/lint/lint-helm.sh` around lines 196 - 197, Update the assertions in the
otel_explicit_empty_output checks to match each endpoint variable name together
with its following value: "" entry, rather than matching only the variable name.
Keep the metrics and traces assertions separate so either mismatch fails
independently.
🤖 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 `@tools/lint/lint-helm.sh`:
- Around line 196-197: Update the assertions in the otel_explicit_empty_output
checks to match each endpoint variable name together with its following value:
"" entry, rather than matching only the variable name. Keep the metrics and
traces assertions separate so either mismatch fails independently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 82f793ce-7030-482c-807e-23bcaacd59db

📥 Commits

Reviewing files that changed from the base of the PR and between 8794430 and 0fa1d9c.

📒 Files selected for processing (2)
  • k8s/helm/templates/_helpers.tpl
  • tools/lint/lint-helm.sh

@github-actions

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 31778/40384 78.7% 63.4%
Integration Tests 18455/38314 48.2% 20.8%

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

Null isn't great anyway, but this works

@mckornfield
mckornfield added this pull request to the merge queue Aug 17, 2026
Merged via the queue into main with commit 31b3fe5 Aug 17, 2026
101 of 102 checks passed
@mckornfield
mckornfield deleted the helm-telemetry-env-var-tweak/mck branch August 17, 2026 19:17
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.

2 participants