## Summary
- Add Grafana Alloy to replace node_exporter for metrics collection
- Add Loki for log aggregation and storage
- Configure Alloy to collect logs from all services (grafana, forgejo, prometheus, tailscale, transmission, devpi, kiwix, borgmatic)
- Update Prometheus to accept metrics via remote_write
- Add Loki datasource to Grafana
## Test plan
- [ ] Run \`mise run provision-indri -- --check --diff\` to verify changes
- [ ] Apply with \`mise run provision-indri\`
- [ ] Verify services: \`mise run indri-services-check\`
- [ ] Check Grafana Explore with Loki datasource
- [ ] Query logs: \`{service="grafana"}\`
- [ ] Verify metrics still flowing to Prometheus dashboards
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Reviewed-on: https://forge.tail8d86e.ts.net/eblume/blumeops/pulls/11
38 lines
933 B
YAML
38 lines
933 B
YAML
---
|
|
# Loki installation and configuration
|
|
|
|
- name: Install loki via homebrew
|
|
community.general.homebrew:
|
|
name: loki
|
|
state: present
|
|
|
|
- name: Ensure loki data directory exists
|
|
ansible.builtin.file:
|
|
path: "{{ loki_data_dir }}"
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: Ensure loki chunks directory exists
|
|
ansible.builtin.file:
|
|
path: "{{ loki_data_dir }}/chunks"
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: Ensure loki rules directory exists
|
|
ansible.builtin.file:
|
|
path: "{{ loki_data_dir }}/rules"
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: Deploy loki configuration
|
|
ansible.builtin.template:
|
|
src: loki-config.yaml.j2
|
|
dest: "{{ loki_config_file }}"
|
|
mode: '0644'
|
|
notify: restart loki
|
|
|
|
- name: Ensure loki service is started
|
|
ansible.builtin.command: brew services start loki
|
|
register: brew_start
|
|
changed_when: "'Successfully started' in brew_start.stdout"
|
|
failed_when: false
|