Repository navigation
feat(otel-ci): add Knative Serving metrics solution - #401
Merged
Merged
Conversation
This was referenced Oct 13, 2026
Data plane: request metrics from the queue-proxy of every revision pod, scraped by the agent on the pod's node. Discovery is filtered by node and revision label in the API server. Predictor revisions of a KServe InferenceService carry aws.service.type = ai_inference. Control plane: autoscaler, activator, controller and webhook metrics from the cluster-scraper, attributed to the component pod and Deployment, without the scraper node's AZ. Both the pre-1.19 and 1.19+ metric names are handled; the README covers the Knative 1.19+ observability settings and Istio STRICT mTLS.
Aakash-Dantre
force-pushed
the
otel-ci-knative-serving-metrics
branch
from
October 13, 2026 15:26
18b44dc to
aca6821
Compare
miconeilaws
approved these changes
Oct 13, 2026
9 tasks done
9 tasks done
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.
Summary
Adds
otelContainerInsights.solutions.knative: Knative Serving's request metrics (data plane) and its autoscaling and reconcile metrics (control plane), sent to CloudWatch over OTLP. Both are on by default and discover nothing on clusters without Knative.Knative Serving is what KServe runs on in Serverless mode, so for an InferenceService this is where request concurrency, request latency at the queue-proxy, and autoscaler decisions (desired, ready and pending pods, panic mode) come from. It works the same for plain Knative Services.
Part of the LLM model-serving solutions, alongside vLLM model-server metrics (#353) and KServe control-plane metrics (#389). End-to-end tests: aws/amazon-cloudwatch-agent-test#779.
Architecture
What is scraped
dataPlane: node agent, pipelinemetrics/cw_k8s_ci_v0_knative_dataplaneserving.knative.dev/revisionlabel on the agent's own node. Both filters run in the API server (field selectorspec.nodeNameplus a label selector), so no agent watches pods on other nodes or non-Knative pods. An optionalnamespacerestricts it further.http-usermetricport (9091), path/metrics, plain HTTP.kn_serving_*(Serving ≥ 1.19) andrevision_*request*(≤ 1.18), e.g.kn_serving_invocation_duration_seconds.podandnamespaceare promoted to the resource, sok8sattributesresolves the revision's Deployment (k8s.workload.name) and adds the pod's labels, including KServe'sk8s.pod.label.serving.kserve.io/inferenceservice. No custom attribute key is added. Node and cloud attributes are the node's.aws.service.type = ai_inferenceon predictor revisions of a KServe InferenceService (pod labelsserving.kserve.io/inferenceserviceandcomponent: predictor, read afterk8sattributes), matching the vLLM solution, so the CloudWatch (Omni) experience identifies them as AI inference. Transformer and explainer revisions carry the same InferenceService label but don't run the model, and plain Knative Services can be any workload, so neither getsaws.service.type.controlPlane: cluster-scraper, pipelinemetrics/cw_k8s_ci_v0_knative_controlplanenamespace(defaultknative-serving) whoseapplabel isactivator,autoscaler,controllerorwebhook. The pattern is fully anchored, sonet-istio-*and other add-ons are excluded. Themetricsport (9090), plain HTTP.kn_revision_*(desired, requested, ready, pending and terminating pods, concurrency, panic mode, capacity)kn_activator_*,kn_autoscaler_*,kn_workqueue_*,kn_webhook_*,kn_k8s_client_*http_server_*/http_client_*go_*,*_go_*,process_*,promhttp_*.k8s.pod.label.app; no custom key).groupbyattrsand a promote give one resource per component pod, thenk8sattributesandset_workloadadd its Deployment. A dedicatedresourcedetectionsets cloud provider, platform, region and account, but not AZ or host, which would describe the cluster-scraper's node.Both pipelines set scope
knative.dev/servingwithcloudwatch.pipeline = knative-dataplaneorknative-controlplane, and export through the existing SigV4 OTLP exporters.Knative requirements
Serving ≤ 1.18 exports Prometheus metrics by default (OpenCensus names:
revision_*,autoscaler_*). Serving ≥ 1.19 uses the OpenTelemetry SDK (kn_*names) and exports nothing until told to.metrics-protocolcovers the control plane andrequest-metrics-protocolthe queue-proxy:kubectl -n knative-serving patch cm config-observability --type merge \ -p '{"data":{"metrics-protocol":"prometheus","request-metrics-protocol":"prometheus"}}' kubectl -n knative-serving rollout restart deploymentThe components read
metrics-protocolonly at startup, hence the restart. The queue-proxy setting applies to revision pods started after the change. Both name sets are kept by the filters, and the README documents this.Istio sidecars with STRICT mTLS. KServe and Knative do not inject Istio sidecars into revision pods by default. If a namespace turns injection on and enforces
STRICTmTLS, the sidecar rejects the agent's plain-HTTP scrape, because the agent is not in the mesh. The README shows aPeerAuthenticationthat allows plain text on port 9091 for those pods (for KServe, selected bycomponent: predictor).Configuration
Testing
tests/knative_pipeline_shape.sh(make helm-knative-shape, part ofmake all) renders the chart and checks, on the parsedotelConfig:k8sattributes, and no custominferenceservicekeyaws.service.type = ai_inferenceonly for InferenceService predictor revisions, set afterk8sattributesknative_componentkey on the control planemake helm-lint helm-flag-matrix helm-yaml-injection helm-neuron-shapepass.test/otel/solutions/knativein test(otel): add vLLM, KServe and Knative solution integration tests aws/amazon-cloudwatch-agent-test#779 (Knative 1.21 under KServe Serverless on EKS, with load through the queue-proxy). The 5 tests cover:aws.service.type = ai_inferencePR Checklist
makechecks pass locallytest/otel/solutions/knative)tests/knative_pipeline_shape.sh)otelContainerInsights.solutions.knativevalues, on by default; Knative ≥ 1.19 needs theconfig-observabilitychange above