New to Claude Skills? Learn how to install them →

google on GitHub

GKE Observability

Free

Streamline monitoring and logging for GKE clusters.

by google17.6k stars on google/skills
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What GKE Observability does

GKE Observability is a skill designed to help developers and DevOps engineers configure comprehensive monitoring, logging, and metrics collection for Google Kubernetes Engine (GKE) clusters. This skill leverages Google Cloud's tools to enable observability features such as Cloud Logging, Cloud Monitoring, and managed Prometheus, ensuring that users can effectively track the performance and health of their Kubernetes environments. By following the golden path approach, users can activate a full suite of logging and monitoring capabilities that cover both system components and workloads, providing insights into critical metrics that are essential for maintaining cluster performance.

The skill facilitates the configuration of control-plane metrics, which are vital for diagnosing issues at the cluster level. With the ability to monitor API server request latency, scheduling delays, and controller performance, users can quickly identify and address bottlenecks that may affect application performance. The inclusion of managed Prometheus allows for advanced metrics collection and querying, making it easier to visualize performance data through tools like Grafana. This integration is particularly beneficial for teams looking to implement robust observability practices in their cloud-native applications.

GKE Observability is suitable for teams working with GKE who need to set up or enhance their monitoring and logging strategies. Whether you are a developer looking to gain insights into your application performance or a DevOps engineer responsible for maintaining the health of the Kubernetes cluster, this skill provides the necessary tools to achieve those goals. However, it is important to note that this skill is not intended for configuring local application logging frameworks or external Application Performance Monitoring (APM) solutions outside of GKE, which may limit its applicability in certain scenarios.

When to use it

Use this skill when setting up or enhancing observability for GKE clusters, particularly when you need to monitor control-plane metrics and workloads.

When not to use it

This skill is not suitable for configuring local application logging or external APM tools that are not part of the GKE ecosystem.

What you can build with it

Setting Up GKE Monitoring

Quickly configure full monitoring for your GKE cluster by enabling the golden path observability defaults with this skill.

Diagnosing Cluster Issues

Utilize control-plane metrics to identify and troubleshoot performance bottlenecks in your Kubernetes environment.

Integrating Managed Prometheus

Easily set up managed Prometheus for advanced metrics collection and visualization in your GKE clusters.

How to install GKE Observability

View source

1. Install with the skills CLI

npx skills add google/skills/gke-observability --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by google

GKE Observability

This reference covers monitoring, logging, and metrics configuration for GKE. The golden path enables comprehensive observability including control-plane metrics.

MCP Tools: gke:get_cluster, gke:list_k8s_events, gke:get_k8s_logs, gke:get_k8s_cluster_info, gke:describe_k8s_resource. CLI-only: gcloud container clusters update --monitoring=..., gcloud logging read

Golden Path Observability Defaults

SettingGolden Path ValueNotes
loggingConfig componentsSYSTEM_COMPONENTS, WORKLOADSFull workload logging
monitoringConfig componentsSYSTEM_COMPONENTS, STORAGE, POD, DEPLOYMENT, STATEFULSET, DAEMONSET, HPA, JOBSET, CADVISOR, KUBELET, DCGM, APISERVER, SCHEDULER, CONTROLLER_MANAGERFull suite including control-plane
managedPrometheusConfig.enabledtrueGoogle-managed Prometheus
advancedDatapathObservabilityConfig.enableMetricstrueDataplane V2 flow metrics
loggingServicelogging.googleapis.com/kubernetesCloud Logging
monitoringServicemonitoring.googleapis.com/kubernetesCloud Monitoring

Control-Plane Metrics (Golden Path Addition)

The golden path adds three control-plane monitoring components not present in default clusters:

ComponentWhat It Monitors
APISERVERAPI server request latency, error rates, admission
: : webhook performance :
SCHEDULERScheduling latency, pending pods, scheduling failures
CONTROLLER_MANAGERController work queue depth, reconciliation latency

These are critical for diagnosing cluster-level issues (slow API responses, scheduling delays, stuck controllers).

Enabling Full Monitoring

# Enable golden path monitoring suite
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
  --monitoring=SYSTEM,API_SERVER,SCHEDULER,CONTROLLER_MANAGER,STORAGE,POD,DEPLOYMENT,STATEFULSET,DAEMONSET,HPA,CADVISOR,KUBELET,DCGM \
  --quiet

# Enable Managed Prometheus
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
  --enable-managed-prometheus \
  --quiet

# Enable Dataplane V2 observability metrics
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
  --enable-dataplane-v2-flow-observability \
  --quiet

Managed Prometheus

Golden path enables Google Managed Prometheus for metrics collection and querying.

Querying metrics:

  • Use Cloud Monitoring Metrics Explorer in the console
  • Use PromQL via the Prometheus UI or API
  • Grafana dashboards via Managed Grafana

Key GKE metrics:

MetricSourceUse
container_cpu_usage_seconds_totalcAdvisorPod CPU usage
container_memory_working_set_bytescAdvisorPod memory
: : : usage :
kube_pod_status_phasekube-state-metricsPod lifecycle
apiserver_request_duration_secondsAPI ServerControl plane
: : : latency :
scheduler_scheduling_duration_secondsSchedulerScheduling
: : : performance :
node_cpu_seconds_totalKubeletNode CPU
DCGM_FI_DEV_GPU_UTILDCGMGPU
: : : utilization :

Live Resource Usage (kubectl-only)

No MCP or gcloud equivalent exists for live resource usage. Use kubectl top:

kubectl top pods --all-namespaces --sort-by=cpu
kubectl top nodes
kubectl top pods --containers -n <NAMESPACE>  # per-container breakdown

Cloud Logging (gcloud-only)

Querying cluster logs (no MCP equivalent — use gcloud logging read):

# System component logs
gcloud logging read \
  'resource.type="k8s_cluster" AND resource.labels.cluster_name="<CLUSTER_NAME>"' \
  --project <PROJECT_ID> --limit 50 \
  --quiet

# Workload logs for a specific namespace
gcloud logging read \
  'resource.type="k8s_container" AND resource.labels.cluster_name="<CLUSTER_NAME>" AND resource.labels.namespace_name="<NAMESPACE>"' \
  --project <PROJECT_ID> --limit 50 \
  --quiet

# Audit logs (who did what)
gcloud logging read \
  'resource.type="k8s_cluster" AND logName:"cloudaudit.googleapis.com"' \
  --project <PROJECT_ID> --limit 50 \
  --quiet

Diagnostic Settings

For security monitoring and troubleshooting, enable control-plane audit logs:

# View current logging config
gcloud container clusters describe <CLUSTER_NAME> --region <REGION> \
  --format="yaml(loggingConfig)" \
  --quiet

Alerting

Set up alerts for critical conditions:

ConditionMetricThreshold
High API server latencyapiserver_request_duration_secondsP99 > 5s
Pod crash loopskube_pod_container_status_restarts_total> 5 in 10min
Node not readykube_node_status_conditioncondition=Ready, status!=True
High GPU utilizationDCGM_FI_DEV_GPU_UTIL> 95% sustained
PVC near capacitykubelet_volume_stats_used_bytes / capacity> 85%
Scheduling failuresscheduler_schedule_attempts_total{result="error"}> 0

Proposing Dashboards & Alerts (Production Rules)

When designing or proposing alerting and dashboard strategies for GKE:

  1. Always explicitly name Google Cloud Monitoring as the platform to implement these alerts and dashboards.
  2. Always include API server latency (via apiserver_request_duration_seconds metric) on the dashboard as a critical indicator of control plane health, alongside node CPU/Memory and pod crash loops.

Node Health (Production Rules)

A comprehensive assessment of node health relies on analyzing these two metrics together:

  1. kubernetes.io/node/status_condition (filtered by status_condition="Ready"): Use this to track healthy nodes. Note that it will only report values for nodes that have successfully bootstrapped.
  2. compute.googleapis.com/instance_group/size (filtered by instance_group_name="gke-<cluster_name>-.*"): Use this to track the total number of nodes in a specific cluster. Note that it does not differentiate between healthy and unhealthy nodes.

Cost Considerations

Monitoring and logging have associated costs:

  • Cloud Logging: Charged per GiB ingested beyond free tier (50 GiB/project/month)
  • Cloud Monitoring: Free for GKE system metrics; custom metrics charged per time series
  • Managed Prometheus: Charged per samples ingested

To reduce costs in non-production:

# Reduce to system-only monitoring
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
  --monitoring=SYSTEM \
  --quiet

Distributed Tracing & Continuous Profiling (Recommended)

Not golden path defaults — recommended for production microservice architectures and performance-sensitive workloads.

  • Cloud Trace: Add OpenTelemetry SDK to your app with the opentelemetry-operations-go (or equivalent) exporter. Traces appear in Cloud Trace console. Identifies cross-service latency bottlenecks.
  • Cloud Profiler: Add the Cloud Profiler agent to your app. Profiles CPU and memory usage in production with low overhead. Identifies hotspots and compares across versions.

LQL Query Examples

Common Logging Query Language patterns for GKE troubleshooting:

# Error logs for a specific container
resource.type="k8s_container" AND resource.labels.container_name="my-app" AND severity>=ERROR

# OOMKilled events
resource.type="k8s_event" AND jsonPayload.reason="OOMKilling"

# Pod scheduling failures
resource.type="k8s_event" AND jsonPayload.reason="FailedScheduling"

# Audit logs (who did what)
resource.type="k8s_cluster" AND logName:"cloudaudit.googleapis.com"

Supporting Links

Frequently asked questions about GKE Observability

Similar skills