1
0
mirror of https://github.com/coltoneshaw/CS-Repro-Mattermost.git synced 2025-12-23 18:11:34 +01:00
Files
Sven Hüster 7971f12489 switching out promtail for alloy (#22)
* rework grafana log ingestion using alloy

* fix docker-compose.yml formatting
2025-05-12 13:34:23 +02:00
..

Alloy Log Agent Configuration

This directory contains the configuration for Grafana Alloy, which has replaced Promtail as the log agent in this environment.

Key Differences

  • Alloy uses a component-based configuration format with .alloy extension
  • The web UI is available at http://localhost:9080
  • Alloy can handle logs, metrics, and traces in one agent
  • Configuration is more flexible with the River language

Configuration Explanation

The config.alloy file follows the component-based model where:

  1. loki.source.file components directly collect logs from Mattermost log files
  2. loki.process component parses and labels the JSON logs
  3. loki.write component sends the logs to Loki

Current Setup

Our configuration:

  • Monitors Mattermost logs directly from mounted volumes
  • Labels all logs with job="mattermost" for Grafana dashboard compatibility
  • Extracts log level, message, and other metadata from JSON logs
  • Sends logs to Loki service

Converting Promtail Config to Alloy

If you need to update the configuration, you can convert Promtail configs to Alloy format with:

# Example using the alloy CLI (if installed locally)
alloy convert --source-format=promtail --output=config.alloy promtail-config.yaml

Important Syntax Notes

  • The River language used by Alloy requires commas at the end of each key-value pair in objects
  • Trailing commas in lists and objects are supported and recommended

More Information