Repository navigation
test(otel): cover the cAdvisor rollup filter and node-exporter scrape self-telemetry - #777
petruanica wants to merge 2 commits into
Conversation
… self-telemetry Regression guards for the two halves of the duplicate-cAdvisor-series removal, made in the paired helm-charts and cloudwatch-agent changes. TestCadvisorNoPodScopeRollup asserts no surviving non-network cadvisor series carries an empty datapoint `container` or a missing k8s.container.name — i.e. the pod cgroup slice and the pause/sandbox container are gone. TestCadvisorNetworkKeepsPodScope asserts the other half: the sandbox owns the pod's network namespace, so for container_network_* the pod-scope series is the only series there is. If the exemption regex is ever narrowed, this fails loudly instead of silently removing all pod network telemetry. TestNodeExporterScrapeSelfTelemetryDropped asserts node_scrape_collector_duration_seconds and node_scrape_collector_success no longer arrive. node_textfile_scrape_error is deliberately not in the list and must keep flowing, because the kubernetes-mixin NodeTextFileCollectorScrapeError alerting rule reads it. Note that the pre-existing TestCadvisorNoPodSandboxMetrics asserts container != "POD", the dockershim spelling. On containerd the sandbox reports container == "", so that test passes vacuously today; the chart change is what makes its stated invariant actually hold.
|
I think the new tests cover the new dropping behaviour... But how are we sure we aren't inadvertently dropping something we don't want to drop? Do you think we have enough coverage to ensure the "Schemas" we want actually flow through? |
|
Partly. Every drop assertion here is gated on But you're right that it isn't a schema contract: |
Description of the issue
kubelet's cAdvisor endpoint reports every
container_*family exceptcontainer_network_*three times per pod — once per application container, once for the pod cgroup slice, and once for the pause/sandbox container — and the Container Insights pipelines are gaining a filter that drops the latter two.container_network_*is exempt, because for those eight families the sandbox series is the only one that exists. Neither the removal nor the exemption had integration coverage, and the exemption is the dangerous one: narrowing it would silently delete all pod network telemetry.Description of changes
Adds three tests to the standard suite, one commit.
TestCadvisorNoPodScopeRollupasserts that no surviving non-network cadvisor series carries an empty datapointcontaineror a missingk8s.container.name— that is, the pod cgroup slice and the pause/sandbox container are gone. The missing-k8s.container.nameclause is the one that fires on containerd; the empty-string clause is defensive, since the Prometheus receiver strips empty-valued labels before the pipeline sees them.TestCadvisorNetworkKeepsPodScopeasserts the other half: forcontainer_network_*the pod-scope series must still be present. If the exemption regex is ever narrowed, this fails loudly instead of the pipeline quietly losing every pod network metric.TestNodeExporterScrapeSelfTelemetryDroppedassertsnode_scrape_collector_duration_secondsandnode_scrape_collector_successno longer arrive.node_textfile_scrape_erroris deliberately absent from the list and must keep flowing, because the kubernetes-mixinNodeTextFileCollectorScrapeErroralerting rule reads it.Worth noting for reviewers: the pre-existing
TestCadvisorNoPodSandboxMetricsassertscontainer != "POD", the dockershim spelling. cAdvisor emitscontainer=""for the containerd sandbox, so that test passes vacuously today. The paired config change is what makes its stated invariant actually hold.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 three 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