Feedback

Chat Icon

Observability with Prometheus and Grafana

A Complete Hands-On Guide to Operational Clarity in Cloud-Native Systems

Prometheus on the Edge
95%

Setting Up the Agent Mode

To enable Prometheus Agent Mode, the --enable-feature=agent flag must be specified when starting Prometheus. Here is an example command to launch Prometheus in agent mode:

prometheus \
  --config.file=/etc/prometheus/prometheus.yml \
  --enable-feature=agent

If you are using Systemd to manage the Prometheus service, you can modify the service file to include the --enable-feature=agent flag in the ExecStart line.

Example of a Systemd service file snippet:

[Service]
[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target

[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus \
--config.file /etc/prometheus/prometheus.yml \
--storage.tsdb.path /var/lib/prometheus \
--web.console.templates=/etc/prometheus/consoles \
--web.console.libraries=/etc/prometheus/console_libraries \
--web.enable-lifecycle \
--enable-feature=agent

[Install]

Observability with Prometheus and Grafana

A Complete Hands-On Guide to Operational Clarity in Cloud-Native Systems

Enroll now to unlock all content and receive all future updates for free.