Kubernetes and Cloud Native Associate (KCNA)Cloud Native ObservabilityHard

A cloud-native application is experiencing high latency in one of its critical API endpoints. Developers suspect the issue might be due to a specific section of code within a microservice that is consuming excessive CPU cycles or memory. Which specialized observability technique, when applied to the microservice, would provide detailed insights into the runtime behavior of the code, identifying hot spots and resource bottlenecks at a function level?

  1. ASynthetic monitoring
  2. BLog aggregation
  3. CMetrics collection
  4. DContinuous profiling
Show answer & explanation

Correct answer: D. Continuous profiling

Continuous profiling is a technique that periodically collects and aggregates profiles of application runtime behavior, such as CPU usage, memory allocation, and I/O operations, down to the function or line-of-code level. This provides granular insights into 'hot spots' and resource bottlenecks within the code, directly addressing the need to identify excessive CPU/memory consumption in specific code sections. Log aggregation and metrics collection provide higher-level views, and synthetic monitoring checks external availability.

Why the other options are wrong

  • A. Synthetic monitoring tests external endpoints and doesn't provide internal code-level performance details.
  • B. Log aggregation provides event data, not granular code-level resource consumption insights.
  • C. Metrics collection provides aggregated numerical data, not detailed function-level resource usage profiles.

Continuous Profiling

A technique for continuously collecting and analyzing application performance profiles in production, identifying resource-intensive code paths (hot spots) like CPU usage, memory allocations, or I/O operations.

  • Provides granular, function-level insights into resource consumption.
  • Helps optimize code performance and reduce resource overhead.
  • Often uses sampling to minimize overhead in production environments.

Memory trick: Profiling is like a detailed MRI for your code.

More Cloud Native Observability questions