feat: Add append_dimensions tests for collectd, ethtool, and cpu plugins#647
feat: Add append_dimensions tests for collectd, ethtool, and cpu plugins#647TravisStark wants to merge 2 commits intomainfrom
Conversation
b9614ef to
a5deece
Compare
the-mann
left a comment
There was a problem hiding this comment.
Can you extract the common validation logic? The 7 test files have significant duplication. A shared helper function for dimension validation would reduce this.
a5deece to
9dbae34
Compare
|
code review agent: Code Review: PR #647PR: feat: Add append_dimensions tests for collectd, ethtool, and cpu plugins CI StatusFindingsMajor1.
|
|
you can ignore the other stuff kiro mentioned btw i think it's all too minor to act on |
Description of the issue
The CloudWatch Agent supports
append_dimensionsat two configuration levels with different behaviors:metrics.append_dimensions): Adds EC2 metadata dimensions and drops thehostdimensionmetrics_collected.<plugin>.append_dimensions): Adds dimensions while keeping thehostdimensionThere were no integration tests validating this behavioral difference for collectd, CPU, or ethtool plugins. This gap made it difficult to catch regressions in dimension handling logic.
Description of changes
Added comprehensive integration tests for
append_dimensionssupport across multiple plugins:Collectd tests:
CollectdNoAppendDimensions- Baseline: verifieshostis present andInstanceIdis absent without configurationCollectdGlobalAppendDimensions- Verifies global config addsInstanceId/InstanceTypeand dropshostCollectdAppendDimensions- Verifies plugin-level config adds dimensions while keepinghostCollectdFleetAggregation- Verifies plugin-level config works withaggregation_dimensionsCPU tests:
CpuGlobalAppendDimensions- Verifies global config behavior for CPU metricsEthtool tests:
EthtoolAppendDimensions- Verifies global config dropshostEthtoolPluginAppendDimensions- Verifies plugin-level config keepshostInfrastructure improvements:
ethtool_test_helpers.gometrics_dimension_test.gowith dynamic column widths in summary tableLicense
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
go build ./...common.SendCollectDMetrics()to generate test data