mirror of
https://github.com/coltoneshaw/CS-Repro-Mattermost.git
synced 2025-12-23 18:11:34 +01:00
1.6 KiB
1.6 KiB
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
.alloyextension - 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:
loki.source.filecomponents directly collect logs from Mattermost log filesloki.processcomponent parses and labels the JSON logsloki.writecomponent 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