
Skill
gke-observability
audit GKE observability and monitoring
Description
Workflows for setting up and auditing observability (logging, monitoring, tracing) on GKE.
SKILL.md
GKE Observability Skill
This skill provides workflows for ensuring your GKE cluster and workloads have adequate observability for production use.
Workflows
1. Audit Cluster Observability
Check if Cloud Logging and Cloud Monitoring are enabled on the cluster.
Command:
gcloud container clusters describe <cluster-name> --region <region> --project <project-id> --format="json(loggingConfig, monitoringConfig)"
Look for loggingService and monitoringService to be set to something other than none (usually logging.googleapis.com/kubernetes and monitoring.googleapis.com/kubernetes).
2. Enable Managed Service for Prometheus
Google Cloud Managed Service for Prometheus is the recommended way to collect metrics from your applications.
Command to enable:
gcloud container clusters update <cluster-name> \
--enable-managed-prometheus \
--region <region>
Verify installation:
kubectl get pods -n gmp-system
3. Workload Logging Verification
Ensure your workloads are logging to standard output, which Cloud Logging collects automatically.
Check workload logs:
kubectl logs <pod-name> -n <namespace>
Ensure logs are in a structured format (like JSON) if possible, for easier querying.
4. Dashboards and Alerts
Recommend creating dashboards in Cloud Monitoring for key metrics:
- CPU Utilization
- Memory Utilization
- Request Latency
- Error Rate
Set up alerting policies for critical thresholds.
5. Distributed Tracing
Enable distributed tracing to track requests across microservices.
- Action: Recommend using OpenTelemetry in the application to send traces to Cloud Trace.
- Benefit: Helps identify latency bottlenecks in distributed systems.
6. Continuous Profiling
Use continuous profiling to analyze application performance in production with low overhead.
- Action: Recommend integrating the Cloud Profiler agent in your application code.
- Benefit: Helps identify CPU and memory-consuming functions in production.
7. Querying Logs with LQL
Use Logging Query Language (LQL) in Cloud Logging to find specific logs.
Example LQL Queries:
- Find error logs for a specific container:
resource.type="k8s_container" resource.labels.container_name="my-app" severity>=ERROR - Find logs with a specific message:
resource.type="k8s_container" textPayload:"connection refused"
8. Enable Control Plane Metrics
For Standard clusters, you can enable collection of metrics from the Kubernetes API server, scheduler, and controller manager.
Command:
gcloud container clusters update <cluster-name> \
--monitoring=SYSTEM,API_SERVER,SCHEDULER,CONTROLLER_MANAGER \
--region <region>
9. Enable Dataplane V2 Observability
If using GKE Dataplane V2, you can enable advanced L4 observability.
Command:
gcloud container clusters update <cluster-name> \
--enable-dataplane-v2-observability \
--region <region>
This allows you to observe traffic flows and network metrics.
Best Practices
- Structured Logging: Use JSON logging in your applications to make it easier to search and analyze logs in Cloud Logging.
- Custom Metrics: Use Managed Service for Prometheus to expose and collect custom application metrics.
- Full Pillars of Observability: Implement Tracing and Profiling in addition to Logs and Metrics for complete visibility.
- Control Plane Metrics: Enable control plane metrics (if using Standard) to monitor the health of the API server and scheduler.
More skills from the gke-mcp repository
View all 25 skillscustom-golden-image-discovery
discover golden base images for GKE nodes
Jul 12DeploymentGoogle CloudKubernetesgke-ai-troubleshooting-handle-disruption-gpu-tpu
diagnose GPU and TPU workload disruptions
Jul 28DebuggingGoogle CloudKubernetesPerformancegke-ai-troubleshooting-jobset-interruption
diagnose GKE JobSet interruptions
Jul 12DebuggingGoogle CloudKubernetesObservabilitygke-ai-troubleshooting-skill-creation-guide
create GKE troubleshooting skill bundles
Jul 12DocumentationEngineeringGoogle CloudTechnical Writinggke-ai-troubleshooting-tpu-connection-failure-vbar-oom
diagnose GKE TPU connection failures
Jul 12DebuggingGoogle CloudKubernetesPerformancegke-app-onboarding
containerize and deploy apps to GKE
Jul 12ContainersDeploymentGoogle CloudKubernetes +1
More from Google Cloud
View publisherkb-search
search and extract local knowledge base documents
knowledge-catalog
Jul 12DocumentationKnowledge BaseSearchknowledge_catalog_discovery_agent
search and rank Knowledge Catalog data entries
knowledge-catalog
Jul 12Data AnalysisGoogle CloudKnowledge ManagementSearchfabric-builder
generate Terraform code for Google Cloud
cloud-foundation-fabric
Jul 12Google CloudInfrastructure as CodeTerraformfast-0-org-setup-prereqs
prepare prerequisites for FAST 0-org-setup
cloud-foundation-fabric
Jul 12Google CloudOperationsagent-aware-cli
design agent-aware command-line interfaces
vertex-ai-creative-studio
Jul 12CLIEngineeringGoogle Cloudbuild-mcp-genmedia
build and configure GenAI MCP servers
vertex-ai-creative-studio
Jul 12API DevelopmentGoogle CloudLLMMCP