Repository navigation
test(otel): cover removal of deprecated, doubled and cAdvisor cgroup-path attributes - #776
Open
petruanica wants to merge 4 commits into
Open
petruanica wants to merge 4 commits into
petruanica wants to merge 4 commits into
Conversation
Regression guards for the removal of deprecated semantic-convention and duplicated raw Prometheus attributes from the Container Insights pipelines, made in the paired helm-charts and cloudwatch-agent changes. TestDeprecatedSemconvAttributesRemoved asserts net.host.name, net.host.port and http.scheme are absent at resource scope across the Prometheus-scraped and kube-state-metrics name sets, and that url.scheme is still present. The url.scheme assertion is the point: before transform/cw_k8s_ci_v0_drop_deprecated_semconv existed, the karpenter and keda promote transforms deleted url.scheme — the current name — and kept http.scheme, the deprecated one. This fails if that inversion returns. TestRawLabelsNotBilledTwice asserts the raw Prometheus labels are gone from resource scope on cadvisor and kube-state-metrics. The datapoint copies, which are the ones dashboards read, must survive and are already covered by TestCadvisorHasRawPromotedKeys and the TestKSM_*_HasRaw*Label family, so this test only checks the resource side.
This was referenced Oct 5, 2026
…tion TestCadvisorIdLabelDropped asserts the cgroup path id no longer reaches datapoint scope on any cAdvisor metric. The assertion reads datapoint scope rather than resource scope because id is a raw Prometheus label that groupbyattrs never promotes, which is also why the attribute-limit denylist cannot remove it and a transform at context: datapoint does the work. TestCadvisorNameLabelRetained guards the decision to keep name. Once id is gone, name is the only remaining carrier of the container ID, so a later change that widened the removal to cover both would take the container ID out of the payload entirely. It requires at least one datapoint to still carry name rather than all of them, because node-scope cAdvisor series have no container and so no name.
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of the issue
The Container Insights pipelines are dropping three groups of attributes that duplicate values already being sent: the deprecated semantic conventions
net.host.name,net.host.portandhttp.scheme, the resource-scope copies of the raw Prometheus labels, and the cAdvisor cgroup-path attributeid. None of the three had integration coverage.The deprecated-semconv half has a specific history worth guarding. The karpenter and keda promote transforms previously deleted
url.scheme— the current name — while keepinghttp.scheme, the deprecated one. That inversion was invisible to tests.Description of changes
Adds four tests to the standard suite: one removal assertion per group, plus a retention guard alongside the cgroup-path one.
TestDeprecatedSemconvAttributesRemovedasserts the three deprecated attributes are absent at resource scope across both metric-name lists the suite already uses, the Prometheus-scraped set and the kube-state-metrics set, and thaturl.schemeis still present on at least one series. Theurl.schemeassertion is the valuable half: it fails if the inversion described above ever returns.TestRawLabelsOnlyAtDatapointScopeasserts the raw Prometheus labels are gone from resource scope on the cadvisor and kube-state-metrics pipelines. The datapoint copies, which are what dashboards read, must survive — those are already covered byTestCadvisorHasRawPromotedKeysand theTestKSM_*_HasRaw*Labelfamily, so this test checks only the resource side.TestCadvisorIdLabelDroppedasserts the cgroup pathidno longer reaches datapoint scope on any cAdvisor metric. The assertion reads datapoint scope rather than resource scope becauseidis a raw Prometheus label thatgroupbyattrsnever promotes — which is also why the attribute-limit denylist cannot remove it, and why the paired config change uses a transform atcontext: datapointinstead of a denylist entry.TestCadvisorNameLabelRetainedguards the decision to keepname. Onceidis gone,nameis the only remaining carrier of the container ID, which is not reconstructable from anything else in the payload and is what joins a series to its container logs. A later change that widened the removal to cover both would take the container ID out of Container Insights entirely, and this test is what makes that fail. It requires at least one datapoint to still carrynamerather than all of them, because node-scope cAdvisor series have no container and therefore noname.License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
gofmtclean andgo vet -tags integration ./test/otel/standard/passes; the test binary builds with all four test functions registered.These are integration tests, so they need a live cluster running the paired configuration change. They will fail against a cluster that has not yet taken it — that is the intended behaviour, and the reason this PR is paired one-to-one with the config change rather than bundled with the other Container Insights test additions.
Related pull requests
PR Checklist
gofmtclean,go vet -tags integrationpasses, test binary builds