fix(opentelemetry-collector): use valid regexp syntax in hostmetrics mount point excludes - #2217
Conversation
|
Hi @ccmtaylor I noticed issue #2216 and wanted to contribute a fix. The change is minimal, Happy to make any adjustments if the approach needs tweaking Thanks for reviewing! |
bc97a6d to
0b50009
Compare
|
Hi maintainers, The failing “Lint Charts / lint-test” check is due to a chart version bump requirement, not an issue with the regex fix in this PR. The failure message shows: chart version not ok. Needs a version bump! This is triggered by the CI rule requiring version increments whenever chart files or rendered outputs change. I have now updated the chart versions accordingly and pushed the fix. Please let me know if there is anything else required from my side for review approval. Thanks. |
|
@Cloud-Architect-Emma please only change 1 chart per PR |
8c60d17 to
2202f32
Compare
|
Hi @TylerHelmuth, I've squashed the changes down to the correct 3 files only (_config.tpl, configmap-agent.yaml, Chart.yaml). The diff is clean, old glob patterns fully removed, anchored regexp patterns in place. I noticed the lint failure occurs after Chart.yaml validation succeeds, and only affects v3.14.4 and v4.0.3 but not v3.9.4. This looks like a pre-existing CI environment issue rather than something introduced by this PR. Happy to investigate further if you can point me in the right direction. Thank you for your time reviewing this! |
|
@TylerHelmuth, could you please review at your convenience? Thanks |
|
Please fix lints, generate examples change PR description so its only collector chart and then we can move forward |
8f0c85f to
e55ab3a
Compare
e55ab3a to
f1149bf
Compare
|
Hi @povilasv @TylerHelmuth, all checks passed . The branch has been rebased on latest main, examples regenerated, and the chart version bumped to 0.157.1. Ready for review when you get a chance. Thank you! |
33f517f to
3252c19
Compare
|
Hi @povilasv @TylerHelmuth , all 5 checks are now passing. Would appreciate a review when you get a chance. Thanks! |
d523d28 to
9a67aea
Compare
|
Hi @dmitryax , thank you for the review! I've bumped the chart version to 0.157.3 and regenerated all examples. The commit is ready for another look when you get a chance. Thanks! |
9a67aea to
d6893d5
Compare
|
|
244d18a to
0217078
Compare
…mount point excludes Updates hostMetrics preset regex anchors and bumps chart version to clear merge conflicts. Signed-off-by: Emmanuela Opurum <emmanuela_prince@yahoo.com>
0217078 to
01ac942
Compare
Signed-off-by: Emmanuela Opurum <emmanuela_prince@yahoo.com>
Signed-off-by: Emmanuela Opurum <emmanuela_prince@yahoo.com>
…tance names Signed-off-by: Emmanuela Opurum <emmanuela_prince@yahoo.com>
|
Thanks, @TylerHelmuth, for approving! Hopefully, PR will be merged soon |
|
Thanks @TylerHelmuth, for the review! |
Related to #2216
The exclude_mount_points block in the hostMetrics preset was using glob-style patterns (e.g. /dev/*) with match_type: regexp. These are not valid regular expressions, they worked accidentally because regexp.MatchString does substring matching, so /dev/ would match any path containing that string.
Changes
Replace glob patterns with properly anchored regexp patterns in the opentelemetry-collector chart only:
/dev/* → ^/dev/
/proc/* → ^/proc/
/sys/* → ^/sys/
/run/k3s/containerd/* → ^/run/k3s/containerd/
/var/lib/docker/* → ^/var/lib/docker/
/var/lib/kubelet/* → ^/var/lib/kubelet/
/snap/* → ^/snap/
Files changed
charts/opentelemetry-collector/templates/_config.tpl
charts/opentelemetry-collector/examples/ (all rendered examples regenerated via make generate-examples)