Kubernetes

Kubernetes

In this section you’ll learn how to ship your metrics, logs, and traces to Grafana Cloud.

Metrics

You can ship Prometheus metrics from your clusters to Grafana Cloud managed Prometheus in several ways:

Kubernetes Integration

The Grafana Cloud Kubernetes integration provides the following features:

  • Preconfigured manifests for deploying Grafana Agent and kube-state-metrics into your clusters.
  • 10 Grafana dashboards to drill into resource usage, beginning from the multi-cluster level down to individual containers and Pods.
  • A set of recording rules to speed up dashboard queries.
  • A set of alerting rules to alert on many conditions. For example, Pods crash looping and Pods getting stuck in “not ready” status.

To learn how to get started with the Kubernetes integration, see Kubernetes integration.

Grafana Agent

You can also deploy the Grafana Agent directly and configure it to scrape Prometheus metrics in your cluster. To learn how, please see Grafana Agent Metrics Kubernetes Quickstart.

These manifests and instructions closely mirror those found in the Kubernetes Integration UI.

Grafana Agent Operator (beta)

Grafana Agent Operator is a Prometheus Operator inspired project that allows you configure Grafana Agent using Kubernetes custom resources. It can greatly simplify managing, configuring, and deploying Grafana Agent into your Kubernetes clusters.

Agent Operator currently supports:

  • Metrics
  • Logs

Support for the following features is under development:

  • Traces
  • Grafana Agent integrations (like embedded node-exporter, MySQL exporter, etc.)
  • Grafana Cloud Kubernetes integration

To learn more, please see Grafana Agent Operator. These docs will show you how to install Agent Operator into your cluster (optionally using Helm), and configure custom resources to collect metrics and logs from your Kubernetes clusters.

Prometheus

If you have existing Prometheus instances running your clusters, you can configure these to remote_write metrics to Grafana Cloud. Instructions for configuring Prometheus remote_write vary depending on how you deployed Prometheus into your clusters. To get started configuring remote_write for your Prometheus instances, please see Using remote_write to ship Prometheus metrics.

Logs

You can ship logs to Grafana Cloud managed Loki in several ways:

Grafana Agent

Grafana Agent contains an embedded Promtail that allows you ship logs to Loki using the same Agent binary. To learn how, see Grafana Agent Logs Kubernetes Quickstart.

Note: While it is theoretically possible to configure the same Agent DaemonSet to collect and ship both metrics and logs to Grafana Cloud, support for this deployment model is currently minimal and under active development.

We recommend that you deploy the following:

  • A StatefulSet or Deployment of Agents to collect metrics (similar to how you’d roll out Prometheus).
  • A DaemonSet to collect logs.
  • A Deployment or DaemonSet to collect traces.
  • Additional Deployments and/or DaemonSets to export metrics using embedded integrations.

Grafana Agent Operator (beta)

To learn more, see Grafana Agent Operator. These docs will show you how to install Agent Operator into your cluster (optionally using Helm), and configure custom resources to collect metrics and logs from your Kubernetes clusters.

Promtail

You can also use the Promtail Loki client to ship Kubernetes logs to managed Loki. To learn how please see, Send logs from a Kubernetes cluster. These instructions mirror those from the Cloud Portal. For further information, see Install Promtail from the Loki docs.

Traces

Grafana Agent

You can ship traces to Grafana Cloud using Grafana Agent. To learn how, please see Grafana Agent Traces Kubernetes Quickstart.

To learn more, see Grafana Agent from the Tempo docs.

Grafana Agent Operator (beta)

Support for traces in Agent Operator is under active development and will be released soon.