Here are some resources to help you run the Grafana Agent:
To run the Windows Installation, download the Windows Installer executable from the release page. Then run the installer, this will setup the Agent and run the Agent as a Windows Service. More details can be found in the Windows Guide
To run the Agent with Docker, you should have a configuration file on
your local machine ready to bind mount into the container. Then modify
the following command for your environment. Replace /path/to/config.yaml
with
the full path to your YAML configuration, and replace /tmp/agent
with the
directory on your host that you want the agent to store its WAL.
docker run \
-v /tmp/agent:/etc/agent/data \
-v /path/to/config.yaml:/etc/agent/agent.yaml \
grafana/agent:v0.24.1
Currently, you must provide your own system configuration files to run the Agent as a long-living process (e.g., write your own systemd unit files).
You can find sample deployment manifests in the Kubernetes directory.
These guides help you get up and running with the Agent and Grafana Cloud, and include sample ConfigMaps.
You can find them in the Grafana Cloud documentation
This guide will show you how to deploy the Grafana Agent Operator into your Kubernetes cluster using the grafana-agent-operator Helm chart.
You'll also deploy the following custom resources (CRs):
- A
GrafanaAgent
resource, which discovers one or moreMetricsInstance
andLogsInstances
resources. - A
MetricsInstance
resource that defines where to ship collected metrics. - A
ServiceMonitor
resource to collect cAdvisor and kubelet metrics. - A
LogsInstance
resource that defines where to ship collected logs. - A
PodLogs
resource to collect container logs from Kubernetes Pods.
You can find the guide here.
Go 1.14 is currently needed to build the agent from source. Run make agent
from the root of this repository, and then the build agent binary will be placed
at ./cmd/agent/agent
.
The Tanka configs we use to deploy the agent ourselves can be found in our production Tanka directory. These configs are also used to generate the Kubernetes configs for the install script. To get started with the tanka configs, do the following:
mkdir tanka-agent
cd tanka-agent
tk init --k8s=false
jb install github.com/grafana/agent/production/tanka/grafana-agent
# substitute your target k8s version for "1.16" in the next few commands
jb install github.com/jsonnet-libs/k8s-alpha/1.16
echo '(import "github.com/jsonnet-libs/k8s-alpha/1.16/main.libsonnet")' > lib/k.libsonnet
echo '+ (import "github.com/jsonnet-libs/k8s-alpha/1.16/extensions/kausal-shim.libsonnet")' >> lib/k.libsonnet
Then put this in environments/default/main.jsonnet
:
local agent = import 'grafana-agent/grafana-agent.libsonnet';
agent {
_config+:: {
namespace: 'grafana-agent'
},
}
If all these steps worked, tk eval environments/default
should output the
default JSON we use to build our Kubernetes manifests.