Grafana Kubernetes Monitoring
Grafana Kubernetes Monitoring provides a simplified approach to monitoring your Kubernetes fleet by:
- Deploying Grafana Agent with useful defaults for collecting metrics that help manage cardinality
- Providing custom queries to collect useful logs
- Providing preconfigured dashboards, alert rules, and recording rules
For details, see Understand Kubernetes Monitoring.
To get started right away, select a configuration method from the following table. For details about these approaches, see Grafana Agent versus Grafana Agent Operator.
Method | When to use |
---|---|
Kubernetes Monitoring using Grafana Agent | This method lets you quickly set up monitoring using Grafana Agent with useful defaults. See Grafana Agent for more details. |
Kubernetes Monitoring using Agent Operator | Use this method if you prefer to use a Kubernetes-style operator rather than an agent. See Grafana Agent Operator for details. |
Grafana Agent versus Grafana Agent Operator
The Kubernetes Monitoring interface lets you choose between Grafana Agent and Grafana Agent Operator to set up Kubernetes Monitoring. The following sections describe them to help you decide.
Grafana Agent
Grafana Agent collects and forwards telemetry data (metrics, logs and traces) to Grafana deployments— Grafana Open Source, Grafana Cloud, or Grafana Enterprise. Kubernetes Monitoring uses Grafana Agent to ship the telemetry data to Grafana Cloud.
Grafana Agent Operator
Grafana Agent Operator is a Kubernetes operator that makes it easier to deploy Grafana Agent to collect telemetry data from your pods.
Grafana Agent Operator is an abstraction over Grafana Agent. Agent Operator ultimately makes it easier to configure and run in Kubernetes clusters.
Grafana Agent Operator watches Kubernetes custom resources that specify:
- How to collect telemetry data from your Kubernetes cluster
- Where to send the telemetry data
If you choose Agent Operator, you’re actually using Grafana Agent beneath to collect and send telemetry data from your Kubernetes cluster.
Grafana Agent Operator deploys custom resources for MetricsInstance, LogsInstance, PodLogs, and others. It helps distribute the configuration for metrics and logs unlike Grafana Agent, which relies on a single large config map.
Grafana Agent Operator also makes scaling easier. It manages your deployments of Grafana Agent for you. If you run Grafana Agent directly in Kubernetes, you need to manage the deployments manually.
The following table compares Grafana Agent and Grafana Agent Operator.
Property | Grafana Agent | Grafana Agent Operator |
---|---|---|
Kubernetes native | ✘ | ✓ |
Works outside Kubernetes | ✓ | ✘ |
For details, see the Grafana Agent and Grafana Agent Operator documentation.
When to use Kubernetes Monitoring versus other approaches
Now that you understand the difference between Grafana Agent and Grafana Agent Operator, it’s also important to differentiate between them and Kubernetes Monitoring.
Grafana Agent ships data to Grafana Cloud, whereas Kubernetes Monitoring is an opinionated visualization of the data being received. You can ship data to Grafana Cloud and build visualizations with dashboards yourself, but that process takes time. With Kubernetes Monitoring, you have preconfigured dashboards and alerts, so you can get started faster.
Kubernetes Monitoring is the preferred approach, but you can use other methods, depending on the technologies you prefer. The following table describes when you might use other approaches.
Method | When to use |
---|---|
Ship selective data (metrics, logs, or traces) | With this method, you can manually customize your use of Grafana Agent to selectively ship metrics, logs, or traces. You can then use Kubernetes Monitoring to access preconfigured dashboards and alerts. |
Use remote_write to ship Prometheus metrics | Use this method if you already have a Prometheus instance and you now want to ship metrics to Grafana Cloud. You can then use Kubernetes Monitoring to access preconfigured dashboards and alerts. Note that there are some features (like pod logs, Kubernetes events, and resource management) that rely on specific recording rules and metrics that ship with Grafana Agent. These may not show properly. |
Scrape application Pod metrics | Configure Grafana Agent to scrape application Prometheus metrics. |