nr-k8s-otel-collector: Add Comprehensive Global Value Inheritance Test Coverage #2026
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds comprehensive test coverage with EXPLICIT validation of global value inheritance for all applicable values from the common-library, plus implementation of
global.customAttributessupport. Each applicable global value has dedicated test cases that directly validate propagation and override precedence. The chart now supports custom attributes injection into OpenTelemetry resource processors.Testing Philosophy
This chart validates ALL applicable global values through comprehensive helm-unittest tests. While common-library helpers handle the implementation, we test each global value with dedicated test cases showing both inheritance (global → chart) and precedence (local > global > default). This is infrastructure-as-code best practice providing confidence that configuration changes work as expected.
Changes
Added global.customAttributes Support
resource/newrelicprocessorglobal.customAttributesand localcustomAttributeswith proper override precedenceAdded Test Suite
tests/global_inheritance_test.yaml(79 original + 3 fedramp)Test Results
Test coverage includes:
Global Values Coverage
All 27 global values from the common-library assessed:
Legend:
Yes- Chart includes explicit helm-unittest test coverageNo- Value not applicable to this chart typeAll applicable global values have explicit test coverage with dedicated test cases and assertions.
Chart-Specific Behavior
Cluster Name Propagation
The cluster name is set in the ConfigMap (via resource attributes) rather than as an environment variable. This is validated through ConfigMap pattern matching in the test suite.
License Key Handling
The chart always uses a Secret reference (not plain values) for the license key. This is the secure pattern and is validated through Secret reference assertions.
Dual Workload Architecture
The chart deploys BOTH a Deployment (cluster-wide metrics) AND a DaemonSet (per-node metrics). All tests validate both templates to ensure consistent behavior across both workload types.
Custom Attributes as OTel Resource Attributes
Custom attributes from
global.customAttributesand localcustomAttributesare injected into the OpenTelemetry collector'sresource/newrelicprocessor as resource attributes. This allows standard global value patterns while maintaining OTel-native configuration.Files Modified
New Files
charts/nr-k8s-otel-collector/tests/global_inheritance_test.yaml- Added 79 test casesModified Files
charts/nr-k8s-otel-collector/Chart.yaml- Bumped version 0.9.7 → 0.9.8charts/nr-k8s-otel-collector/templates/deployment-configmap.yaml- Added custom attributes supportcharts/nr-k8s-otel-collector/templates/daemonset-configmap.yaml- Added custom attributes supportcharts/nr-k8s-otel-collector/templates/_endpoint.tpl- Added fedramp.enabled support for gov endpointNo Breaking Changes
Build Status
Changelog Entry