Skip to content

test(otel): cover removal of deprecated, doubled and cAdvisor cgroup-path attributes - #776

Open
petruanica wants to merge 4 commits into
aws:mainfrom
petruanica:otel-ci-l1-drop-redundant-attributes
Open

petruanica wants to merge 4 commits into
aws:mainfrom
petruanica:otel-ci-l1-drop-redundant-attributes

Conversation

@petruanica

@petruanica petruanica commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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.port and http.scheme, the resource-scope copies of the raw Prometheus labels, and the cAdvisor cgroup-path attribute id. 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 keeping http.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.

TestDeprecatedSemconvAttributesRemoved asserts 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 that url.scheme is still present on at least one series. The url.scheme assertion is the valuable half: it fails if the inversion described above ever returns.

TestRawLabelsOnlyAtDatapointScope asserts 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 by TestCadvisorHasRawPromotedKeys and the TestKSM_*_HasRaw*Label family, so this test checks only the resource side.

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 why the paired config change uses a transform at context: datapoint instead of a denylist entry.

TestCadvisorNameLabelRetained guards the decision to keep name. Once id is gone, name is 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 carry name rather than all of them, because node-scope cAdvisor series have no container and therefore no name.

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

gofmt clean and go 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

Chart change aws-observability/helm-charts#384
Sibling Container Insights changes #775, #777

PR Checklist

  • Commits are squashed into a logical, reviewable set (one commit for a single change)
  • Commits and PR description comply with Amazon internal guidelines
  • gofmt clean, go vet -tags integration passes, test binary builds
  • All GitHub Actions checks on the PR are passing
  • Integration test evidence: N/A — this PR is the integration test coverage. The tests require a cluster running the paired configuration change and will fail until it is deployed, which is intentional.
  • New or updated integration test coverage: N/A — this is the corresponding amazon-cloudwatch-agent-test PR
  • New functionality has unit tests; bug fixes have a reproducing test — N/A, test-only change
  • Config translation changes include updated golden files — N/A, no translator in this repo
  • Breaking or customer-visible changes are called out in the PR description — N/A, test-only change

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.
…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.
@petruanica petruanica changed the title test(otel): cover removal of deprecated and duplicated collector attributes test(otel): cover removal of deprecated, doubled and cAdvisor cgroup-path attributes Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant