GKE Metrics and Logging
Overview
GKE (Google Kubernetes Engine) is a managed Kubernetes service provided by Google that simplifies the deployment, management, and operation of Kubernetes clusters. By using this documentation, you can send the metrics and logs of the GKE cluster to SigNoz.
Prerequisites
- GKE cluster
- Install
kubectl
to access the GKE cluster. - Install Helm
- SigNoz Cloud Account (we are using SigNoz Cloud for this demonstration, we will also need ingestion details. To get your Ingestion Key and Ingestion URL, sign in to your SigNoz Cloud Account and go to Settings >> Ingestion Settings)
Quick Start
Check that the nodes in your GKE clusters are in Ready
state:
Step 1: Add the SigNoz helm repo using this command
helm repo add SigNoz https://charts.signoz.io
Step 2: Install Otel Agent and Deployment using signoz/k8s-infra
Helm chart.
helm install -n signoz --create-namespace kubelet-otel signoz/k8s-infra \\
--set signozApiKey=<ingestionKey> --set otelCollectorEndpoint="ingest.<region>.signoz.cloud:443" --set otelInsecure=false
After applying the above commands, check whether the signoz
namespace pods are running successfully or not:
If running, it should start sending logs and metrics to SigNoz.
Afterward, you could create a pod to check to validate whether the logs and metrics are being sent successfully to SigNoz Cloud.
kubectl run -n signoz test –image=nginx –port=80
Visualize the logs and metrics in Signoz Cloud
To visualize logs:
Go to your SigNoz UI, and navigate to the SigNoz dashboard. Click on the Logs section to view the logs
For metrics:
- Log in to your SigNoz cloud account.
- Navigate to the Dashboards, and add a dashboard
- Add a Timeseries Panel
- In Metrics, select any metric
- In Filter, put name = mention service name
- Hit “Save Changes”.
After saving changes, it should start showing collected metrics.
Troubleshooting
If you encounter any issues while setting up logging and metrics for your GKE cluster, follow these troubleshooting steps:
Check the logs of the OpenTelemetry Collector:
kubectl logs -f -n signoz -l app.kubernetes.io/component=otel-agent
Review the logs for any error messages or indications of misconfiguration.
Verify the rendered configuration:
kubectl get cm/kubelet-otel-k8s-infra-otel-agent -n signoz -o yaml
Ensure the configuration matches your expected settings, including the SigNoz API key and the OpenTelemetry Collector endpoint.
Confirm that the necessary Kubernetes resources are created:
kubectl get pods,services,configmaps -n signoz
Check if the required pods, services, and config maps are running and in a healthy state.
Verify network connectivity:
- Ensure that the GKE cluster has network access to the SigNoz ingestion endpoint (
ingest.<region>.signoz.cloud:443
). - Check if there are any network security groups or firewalls blocking the required ports.
- Ensure that the GKE cluster has network access to the SigNoz ingestion endpoint (
Double-check the SigNoz API key:
- Confirm that the provided
signozApiKey
is correct and has the necessary permissions to ingest data.
- Confirm that the provided