Skip to content

epomatti/grafana-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grafana Demo

Grafana Alloy deployment on a Linux host.

Create the Linux Host

This setup will use Vagrant with VirtualBox to create a local test instance:

mkdir -p vagrant/grafana-demo
cd vagrant/grafana-demo

vagrant init ubuntu/jammy64

Use the utils/Vagrantfile content to optimize the box creation.

Then, create the box:

vagrant up
vagrant ssh

Setup

Note

Using the standard architecture. The Fleet Management feature is currently in public preview and it was giving me trouble

Create and edit the variables file to configure Alloy. Use the utils/template_alloy_vars.yml template:

sudo touch /etc/ansible/alloy_vars.yml
sudo chmod 600 /etc/ansible/alloy_vars.yml
sudo vim /etc/ansible/alloy_vars.yml

Install Alloy

Use the Ansible playbooks to automate the Grafana configuration.

Tip

In preference of fine-grained control, I'm implementing the Install Grafana Alloy on Linux steps, but an official Ansible role is available.

Clone the Git repository, and copy the utils/ansible-pull.sh file for execution convenience.

Within the pull file, replace the TOKEN variable with a contents read-only Git token to be used for pulling configuration updates. You may instead prefer to use SSH and avoid dealing with tokens.

Run the configuration playbook:

sudo bash pull.sh

Verify that Alloy is installed and running:

sudo systemctl status alloy

Manual changes can also be reloaded instead of a restart:

sudo systemctl reload alloy

Configuration will be updated to the default path:

/etc/alloy/config.alloy

Service logs can be viewed with in the journal:

sudo journalctl -u alloy

The configuration is a combination from the documentation and guided setup in the Grafana console, with reference files:

Extras

Additional connectors and settings can be implemented such as prometheus.exporter.unix.

For extended troubleshooting, enable the UI by passing additional command-line flags.

Reference articles:

About

Grafana Alloy deployment with Linux host

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages