Configure Kubernetes Monitoring
You have many options for configuration, depending on your circumstances and the technologies you prefer.
Prepare for configuration
The following items can be part of your configuration, depending on your needs:
- kube-state-metrics: A service that generated metrics from Kubernetes API objects, and uses
client-goto communicate with Clusters. For Kubernetes client-go version compatibility and any other related details, refer to kube-state-metrics.
- Node exporter: Exports Prometheus metrics that indicate the health and state of nodes in a Cluster. For details, refer to Node exporter.
- OpenCost: Calculates Kubernetes infrastructure and container costs. Requires Kubernetes 1.8+ clusters.
- Windows Exporter: Exports Prometheus metrics for Windows machines. Requires Kubernetes 1.22+. Refer to windows_exporter on Kubernetes for any additional requirements.
Send metrics, logs, events, and cost metrics with Grafana Agent Flow mode
To send infrastructure data to Grafana Cloud, it is easiest to configure with Agent Flow mode. With this method, you can send metrics, logs, events, traces, and cost metrics.
Note: Grafana Agent Flow mode is recommended for use. However, you can also configure with Grafana Agent or Grafana Agent Operator manually.
Upgrade from Grafana Agent or Agent Operator
If you have already configured with either Agent static mode or Agent Operator, you can upgrade with the appropriate method:
Configure manually for infrastructure data
If you are already collecting telemetry data for your infrastructure and want to send it to Grafana Cloud, refer to the options available in Configure manually for infrastructure.
Note: You should have only one job scraping
kube-state-metrics. If you have multiple scrape jobs running at the same time, you might see an error similar to this error when you try to view objects in Cluster navigation:
execution: found duplicate series for the match group...
Configure manually for application data
To receive and send telemetry data to Grafana Cloud for an application in Kubernetes, refer to Configure manually for applications.