Skip to content

KCNA · Domain 4: Cloud Native Architecture · 12% of the exam

Task 4.1: Observability

Logs, metrics and traces, Prometheus and the metrics pipeline, OpenTelemetry, distributed tracing, cluster-level logging, and service level objectives.

Study it

  • Logs, metrics and traces

    Partly covered by: Observability Basics

  • Distributed tracing and OpenTelemetry

    Partly covered by: Tracing a Request

  • Prometheus, the metrics pipeline and SLOs

    Lesson coming

Sample questions

Try each one before opening the answer. Every option is explained, with the CNCF documentation page that proves it.

Question 1 · choose 1

A checkout request passes through five services and sometimes takes eight seconds. Each service's dashboards look normal on average. Which signal shows where in the chain the time is actually spent for a single slow request?

  1. APer-service CPU and memory metrics averaged over five minutes
  2. BNode CPU pressure graphs for each worker node
  3. CDistributed traces that link the timed spans of one request
  4. DKubernetes events for the services' Pods
Show the answer and why
  • APer-service CPU and memory metrics averaged over five minutes

    Incorrect

    Aggregated metrics show trends per service; they cannot follow one request through the chain.

  • BNode CPU pressure graphs for each worker node

    Incorrect

    Node graphs show machine load, not where one request spent its time.

  • CDistributed traces that link the timed spans of one request

    Correct

    Traces capture how a request moves across components and link the latency and timing of each operation, so the slow hop stands out.

  • DKubernetes events for the services' Pods

    Incorrect

    Events report object changes such as scheduling or restarts, not request timings.

Metrics, logs and traces answer different questions. For "where did this request spend its time", traces are the signal.

Question 2 · choose 1

A team installs Prometheus to monitor the control plane. How does a typical Kubernetes metrics pipeline collect metrics from components such as kube-apiserver and the kubelet?

  1. AIt scrapes each component's /metrics endpoint at a regular interval
  2. BThe components push their metrics to Prometheus over OTLP as each value changes
  3. CPrometheus reads the metric values that the components store in etcd
  4. DThe kubelet writes metrics into each container's log stream for collection
Show the answer and why
  • AIt scrapes each component's /metrics endpoint at a regular interval

    Correct

    Kubernetes components emit metrics in Prometheus format from /metrics, and the pipeline periodically scrapes and stores the samples.

  • BThe components push their metrics to Prometheus over OTLP as each value changes

    Incorrect

    OTLP is how Kubernetes can export trace spans. Component metrics are pulled from /metrics endpoints.

  • CPrometheus reads the metric values that the components store in etcd

    Incorrect

    etcd holds API objects, not time series; metrics are served by each component.

  • DThe kubelet writes metrics into each container's log stream for collection

    Incorrect

    Container logs carry application output; metrics have their own endpoints.

Prometheus works by pulling: it scrapes HTTP /metrics endpoints on a schedule and stores the samples in its time series database.

Question 3 · choose 2

A team needs application logs kept for 30 days in a central store, even after Pods are deleted or rescheduled. Which two practices make up the common Kubernetes logging pattern for this? (Choose TWO.)

  1. AApplications write their logs to stdout and stderr
  2. BA node-level agent such as Fluent Bit ships the node's log files to the store
  3. CEngineers run kubectl logs and archive the output as needed
  4. DApplications write logs to an emptyDir volume so they survive restarts
  5. EThe API server is configured to store container logs in etcd
Show the answer and why
  • AApplications write their logs to stdout and stderr

    Correct

    The container runtime captures the stdout and stderr streams and the kubelet integration stores them as log files on the node.

  • BA node-level agent such as Fluent Bit ships the node's log files to the store

    Correct

    A node-level logging agent tails the node's log files and forwards entries to a central log store.

  • CEngineers run kubectl logs and archive the output as needed

    Incorrect

    kubectl logs reads what is still on the node; when the Pod is deleted or the logs rotate, that history is gone.

  • DApplications write logs to an emptyDir volume so they survive restarts

    Incorrect

    emptyDir is deleted with the Pod, so the logs disappear exactly when they are needed.

  • EThe API server is configured to store container logs in etcd

    Incorrect

    etcd stores API objects; container logs are not kept there.

Cluster-level logging needs storage independent of nodes and Pods: applications log to stdout and stderr, and a per-node agent forwards the files to a backend.

Question 4 · choose 1

A legacy application can only write its logs to a file inside the container, so nothing appears in kubectl logs. Without changing the application, how can its logs reach the standard logging path?

  1. ARaise the kubelet's container log rotation size
  2. BAdd a sidecar that streams the file to its own stdout
  3. CPut the log directory on an emptyDir that kubectl logs reads
  4. DSet terminationMessagePath to the application's log file
Show the answer and why
  • ARaise the kubelet's container log rotation size

    Incorrect

    Rotation applies to logs the runtime already captured, not to files inside a container.

  • BAdd a sidecar that streams the file to its own stdout

    Correct

    A streaming sidecar reads logs from a file, socket or journal and prints them to its own output streams.

  • CPut the log directory on an emptyDir that kubectl logs reads

    Incorrect

    kubectl logs returns the log file the kubelet keeps for the container's stdout and stderr streams; files in a volume are not part of it.

  • DSet terminationMessagePath to the application's log file

    Incorrect

    That path is for a short message about termination, not ongoing logs.

Sidecar containers adapt applications that cannot log to stdout and stderr.

Question 5 · choose 1

A manager asks what "observability" means for the team's systems. Which description fits the CNCF glossary?

  1. AHow well the system can grow to do more of its work
  2. BHow well the system recovers from failures without human help
  3. CHow well the system keeps working as its components fail
  4. DHow well the system's outputs explain its internal state
Show the answer and why
  • AHow well the system can grow to do more of its work

    Incorrect

    That is scalability, the glossary's term for how well a system can grow.

  • BHow well the system recovers from failures without human help

    Incorrect

    That is self-healing: a control loop compares actual with desired state and repairs certain failures without human intervention.

  • CHow well the system keeps working as its components fail

    Incorrect

    That is reliability, which the glossary describes as how well a system responds to failures.

  • DHow well the system's outputs explain its internal state

    Correct

    Observability is the degree to which a system can generate actionable insights, so that users can understand its state from its external outputs and take corrective action.

Observability, scalability, self-healing and reliability are separate properties in the CNCF glossary. An observable system produces signals such as logs, metrics and traces that let operators understand what is going on inside it and act on it.

Question 6 · choose 1

Metrics Server, the reference implementation of the Metrics API, reports CPU and memory use for each Pod. Where does it get these numbers?

  1. AFrom the kubelet on each node
  2. BFrom etcd, where each Pod's usage is recorded
  3. CFrom the container runtime on each node, over the CRI
  4. DFrom its own agent Pods, one per node, reading cgroups
Show the answer and why
  • AFrom the kubelet on each node

    Correct

    Metrics Server is a cluster add-on that pulls resource metrics from each kubelet, which exposes them through its /metrics/resource endpoint.

  • BFrom etcd, where each Pod's usage is recorded

    Incorrect

    The pipeline does not pass through etcd: usage is gathered on each node by cAdvisor in the kubelet, and Metrics Server pulls it from the kubelets.

  • CFrom the container runtime on each node, over the CRI

    Incorrect

    Runtime and cgroup figures reach the kubelet, through cAdvisor or CRI container metrics; Metrics Server talks to the kubelets, not to the runtimes.

  • DFrom its own agent Pods, one per node, reading cgroups

    Incorrect

    Metrics Server queries each node's kubelet over HTTP. Reading cgroups is the job of cAdvisor, which is built into the kubelet.

In the resource metrics pipeline, cAdvisor inside the kubelet collects container usage, the kubelet exposes it, and Metrics Server pulls it from every kubelet and serves it through the Metrics API.

Question 7 · choose 1

The security team wants Kubernetes audit events sent straight to its external analysis service over HTTP instead of files on control plane disks. What should be configured on kube-apiserver?

  1. AThe webhook backend, through --audit-webhook-config-file
  2. BThe log backend, through --audit-log-path
  3. CAn audit policy whose rules use the level RequestResponse
  4. DThe --audit-policy-file flag, set to the service's URL
Show the answer and why
  • AThe webhook backend, through --audit-webhook-config-file

    Correct

    The webhook backend sends audit events to a remote web API; its config file, in kubeconfig format, gives the service's address and credentials.

  • BThe log backend, through --audit-log-path

    Incorrect

    The log backend writes audit events into the file system at that path, which is what the team wants to move away from.

  • CAn audit policy whose rules use the level RequestResponse

    Incorrect

    The policy decides which events are recorded and how much of each request and response they include, not where the events are sent.

  • DThe --audit-policy-file flag, set to the service's URL

    Incorrect

    That flag takes the path of a local policy file with the rules; it does not name a destination for the events.

kube-apiserver has two built-in audit backends: the log backend writes events to files, and the webhook backend sends them to an external HTTP API. The audit policy, passed with --audit-policy-file, decides what is recorded for either backend.

Practise domain 4 →Practise all domains →