Repository navigation
test(otel): cover the Helm chart's default-on OTLP endpoint on EKS and AKS - #802
Draft
miconeilaws wants to merge 1 commit into
Draft
miconeilaws wants to merge 1 commit into
miconeilaws wants to merge 1 commit into
Conversation
…d AKS The amazon-cloudwatch-observability chart now serves an OTLP endpoint on the node agent by default (4317 gRPC, 4318 HTTP), with Container Insights enrichment, the OpenTelemetry Kubernetes service identity rules and otelFilters applied to OTLP telemetry. Ordinary pods send through the cloudwatch-agent Service, and the agent finds the sender pod from the connection's source IP. - terraform/eks/daemon/otel-otlp + test/otel/otlp: chart defaults plus OTel Container Insights. Senders through the Service cover the identity cases (app labels, annotations, a service.name the sender sets, unknown_service, DaemonSet, CronJob). The tests check the resource attributes against the sender pod and its node, scope tags, span metrics, the exact OTLP metric name set, logs in /aws/cwagent/<cluster>/otlp, traces in Transaction Search, and that Container Insights telemetry is unchanged. - terraform/eks/daemon/otel-otlp-disabled + test/otel/otlp_disabled: otlp.enabled=false. No OTLP Service or host ports, a send through the Service fails, and no metric with the OTLP scope arrives. - test/otel/filters: an OTLP sender container in every workload. The namespace, pod and node label and metric name filters apply to OTLP metrics, logs and spans; a non-empty metricNames.include also drops an unlisted OTLP metric and the span metrics. - test/azure/aks containerinsights mode: a sender through the Service and checks of its metrics, span metrics, metric names, logs and traces. The install values are unchanged; default:otel is now an alias of the default config. - terraform/otlp_service_sender.sh: the shared OTLP/HTTP sender. It logs the HTTP status of every post, which the tests read. - test/otel/otlpendpoint: helpers shared by the suites, with unit tests. - The new EKS terraform takes helm_chart_repo, so a chart branch on a fork can be tested, and stops with a clear error when the chart has no otlp values block.
Draft
7 of 10 tasks
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
aws-observability/helm-charts#425 makes the
amazon-cloudwatch-observabilitychart serve an OTLP endpoint on the node agent by default (4317 gRPC, 4318 HTTP). Workloads send to thecloudwatch-agentService, and the chart's OTLP pipelines enrich the telemetry like Container Insights enriches the same pod, set the service identity per the OpenTelemetry Kubernetes conventions, applyotelFilters, compute span metrics, and route logs to/aws/cwagent/<cluster>/otlp.otlp.enabled: falseturns it off, anddefault:otelbecomes an alias ofdefault.No suite covers this today. The AKS and GKE
default:otelsuites send over hostNetwork to127.0.0.1, so they never go through the Service or exercise pod association from a normal pod, and nothing checks labels,otelFiltersor the identity rules on OTLP telemetry.Description of changes
New EKS suite
test/otel/otlp+terraform/eks/daemon/otel-otlp(registered in the generator). Chart defaults plusotelContainerInsights.enabled=true, two nodes. Ordinary pods (no hostNetwork, no pod attributes) post OTLP/HTTP throughcloudwatch-agent.amazon-cloudwatch:4318, one workload per identity case:service.nameapp.kubernetes.io/nameand/versionlabels, one pod per noderesource.opentelemetry.io/service.nameand/service.versionannotations plus app labelsservice.name, has an app labelunknown_service:shThe tests check:
cloud.resource_id,k8s.workload.*,service.*,deployment.environment.name, pod and node labels), that labels on the built-in exclusion list are absent, and that no internal_tmp.*oraws.log.*attribute leaks;cloudwatch.source=cloudwatch-agent,cloudwatch.solution=otel-otlp;/aws/cwagent/<cluster>/otlp, stream<namespace>/<service.namespace>/<service.name>, including the stream of theunknown_servicecase;aws/spans);New EKS suite
test/otel/otlp_disabled+terraform/eks/daemon/otel-otlp-disabled(registered in the generator), following the one-terraform-directory-per-chart-configuration precedent. Same install withotlp.enabled=false: no OTLP Service or host ports, every post through the Service fails, and no metric with the OTLP scope arrives once Container Insights metrics are seen.test/otel/filtersgains an OTLP sender container in every workload, so OTLP telemetry from each namespace carries the same pod labels. New tests check that the namespace filter, the pod and node label filters and the metric name filter apply to OTLP metrics, logs and spans.metricNames.includenow also namesotlp_e2e_requests; the unlistedotlp_e2e_unlistedand the span metrics must be dropped.test/azure/aks(containerinsights mode), the mode that installs the chart with the valuesscripts/azure/setup.shuses: a sender through the Service, and checks of its metrics, span metrics, the OTLP metric name set, logs and traces with the AKS resource attributes. The install values are unchanged;agents[0].config=default:otelstays valid because it is now an alias ofdefault. The raw-agentdefault:otelmode (test/azure/aks) andtest/gcp/gkedo not install the chart, so the chart change does not affect them and they are unchanged.Shared pieces:
terraform/otlp_service_sender.sh(the sender; it logs the HTTP status of every post, which the tests read) andtest/otel/otlpendpoint(Kubernetes and log helpers, with unit tests). The new EKS terraform takeshelm_chart_repo(precedent:otel-llm-serving) so a chart branch on a fork can be tested, and stops with a clear error when the chart has nootlpvalues block.Note for reviewers: the first records a new pod sends can reach the agent before its pod cache has the pod's IP. Those records are exported without pod attributes (seen locally as a
defaultlog stream and as span metrics withoutk8s.*). The identity and attribute checks therefore select telemetry the agent matched to a pod, and the CronJob sender sends three rounds per run.Related PRs and merge order
release-*chart branch in CI (and fail fast if it has nootlpblock), and the AKS containerinsights suite installs the chart frommain.default:otelfrom the setup scripts. No order between the two: the AKS install values here keepdefault:otel, which is valid with and without #2402.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
go vet -tags integrationclean for every changed package;make simple-lint(license and import order) passes;go test -run=NO_MATCH ./...compiles every package;go test ./test/otel/otlpendpoint/passes;terraform fmt -checkandterraform validatepass for the four changed terraform directories;go run ./generatoremits both new EKS suites.000when the connection fails.otel-otlpresolved through the Service with the expectedservice.namefor all six cases and the attributes the tests expect; with theotel-filtersvalues only the kept namespaces, kept labels andotlp_e2e_requestscame through on metrics, logs and spans; withotlp.enabled=falsethe Service lost 4317/4318 and every probe post returned000, and after re-enabling the posts returned200. Theotlpendpointhelpers were run against that cluster.PR Checklist
makepasses locally (build, unit tests, lint):make simple-lint, test compile, unit teststest/otel/otlpendpoint